From fac25a0ae6be5d1b3fc223eb8fde3bb3b66029c8 Mon Sep 17 00:00:00 2001
From: Mooffie <mooffie@gmail.com>
Date: Sat, 21 Nov 2015 22:53:51 +0200
Subject: [PATCH] "Directory hotlist" dialog should use WListbox's change
notification.
---
src/filemanager/hotlist.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/src/filemanager/hotlist.c b/src/filemanager/hotlist.c
index 3d76082..ac7608f 100644
a
|
b
|
add_name_to_list (const char *path) |
335 | 335 | /* --------------------------------------------------------------------------------------------- */ |
336 | 336 | |
337 | 337 | static int |
338 | | hotlist_button_callback (WButton * button, int action) |
| 338 | hotlist_run_cmd (int action) |
339 | 339 | { |
340 | | (void) button; |
341 | | |
342 | 340 | switch (action) |
343 | 341 | { |
344 | 342 | case B_MOVE: |
… |
… |
hotlist_button_callback (WButton * button, int action) |
488 | 486 | |
489 | 487 | /* --------------------------------------------------------------------------------------------- */ |
490 | 488 | |
| 489 | static int |
| 490 | hotlist_button_callback (WButton * button, int action) |
| 491 | { |
| 492 | int ret; |
| 493 | |
| 494 | (void) button; |
| 495 | ret = hotlist_run_cmd (action); |
| 496 | update_path_name (); |
| 497 | return ret; |
| 498 | } |
| 499 | |
| 500 | /* --------------------------------------------------------------------------------------------- */ |
| 501 | |
491 | 502 | static inline cb_ret_t |
492 | 503 | hotlist_handle_key (WDialog * h, int key) |
493 | 504 | { |
… |
… |
hotlist_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void |
568 | 579 | return hotlist_handle_key (h, parm); |
569 | 580 | |
570 | 581 | case MSG_POST_KEY: |
571 | | dlg_select_widget (h == hotlist_dlg ? l_hotlist : l_movelist); |
572 | 582 | /* always stay on hotlist */ |
573 | | /* fall through */ |
| 583 | dlg_select_widget (h == hotlist_dlg ? l_hotlist : l_movelist); |
| 584 | return MSG_HANDLED; |
574 | 585 | |
575 | 586 | case MSG_INIT: |
576 | 587 | update_path_name (); |
… |
… |
hotlist_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void |
581 | 592 | dlg_set_size (h, LINES - (h == hotlist_dlg ? 2 : 6), COLS - 6); |
582 | 593 | return MSG_HANDLED; |
583 | 594 | |
| 595 | case MSG_ACTION: |
| 596 | if (sender != NULL) /* The listbox tells us the item has changed. */ |
| 597 | update_path_name (); |
| 598 | /* fall through */ |
| 599 | |
584 | 600 | default: |
585 | 601 | return dlg_default_callback (w, sender, msg, parm, data); |
586 | 602 | } |