Ticket #3563: 3563-directory-hotlist-dialog-should-use-WListbox-notification.patch

File 3563-directory-hotlist-dialog-should-use-WListbox-notification.patch, 2.3 KB (added by mooffie, 5 years ago)
  • src/filemanager/hotlist.c

    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) 
    335335/* --------------------------------------------------------------------------------------------- */ 
    336336 
    337337static int 
    338 hotlist_button_callback (WButton * button, int action) 
     338hotlist_run_cmd (int action) 
    339339{ 
    340     (void) button; 
    341  
    342340    switch (action) 
    343341    { 
    344342    case B_MOVE: 
    hotlist_button_callback (WButton * button, int action) 
    488486 
    489487/* --------------------------------------------------------------------------------------------- */ 
    490488 
     489static int 
     490hotlist_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 
    491502static inline cb_ret_t 
    492503hotlist_handle_key (WDialog * h, int key) 
    493504{ 
    hotlist_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void 
    568579        return hotlist_handle_key (h, parm); 
    569580 
    570581    case MSG_POST_KEY: 
    571         dlg_select_widget (h == hotlist_dlg ? l_hotlist : l_movelist); 
    572582        /* always stay on hotlist */ 
    573         /* fall through */ 
     583        dlg_select_widget (h == hotlist_dlg ? l_hotlist : l_movelist); 
     584        return MSG_HANDLED; 
    574585 
    575586    case MSG_INIT: 
    576587        update_path_name (); 
    hotlist_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void 
    581592        dlg_set_size (h, LINES - (h == hotlist_dlg ? 2 : 6), COLS - 6); 
    582593        return MSG_HANDLED; 
    583594 
     595    case MSG_ACTION: 
     596        if (sender != NULL)     /* The listbox tells us the item has changed. */ 
     597            update_path_name (); 
     598        /* fall through */ 
     599 
    584600    default: 
    585601        return dlg_default_callback (w, sender, msg, parm, data); 
    586602    }