From 43bbd6d299522bf05bd3194c1e66fc4fabb485d2 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sun, 29 Jun 2003 23:44:39 +0000 Subject: [PATCH] * hotlist.c: Add buttons "Refresh" and "Free VFSs now" to Active VFS dialog. (hotlist_button_callback): Handle the buttons. * main.c: Remove the 'Free VFS now' menu item. --- src/ChangeLog | 7 +++++++ src/hotlist.c | 35 ++++++++++++++++++++++++++++------- src/main.c | 1 - 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b8dc245d4..3e92f3350 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2003-06-27 David Sterba + + * hotlist.c: Add buttons "Refresh" and "Free VFSs now" to Active + VFS dialog. + (hotlist_button_callback): Handle the buttons. + * main.c: Remove the 'Free VFS now' menu item. + 2003-06-25 Andrew V. Samoilov * ext.c (regex_check_type): Fix previous change. diff --git a/src/hotlist.c b/src/hotlist.c index 97a8c6fac..566c47b95 100644 --- a/src/hotlist.c +++ b/src/hotlist.c @@ -68,6 +68,11 @@ #define B_APPEND (B_USER + 6) #define B_MOVE (B_USER + 7) +#ifdef USE_VFS +#define B_FREE_ALL_VFS (B_USER + 8) +#define B_REFRESH_VFS (B_USER + 9) +#endif + static WListbox *l_hotlist; static WListbox *l_movelist; @@ -117,6 +122,10 @@ static struct _hotlist_but { { B_CANCEL, NORMAL_BUTTON, 0, 53, N_("&Cancel"), "cc", LIST_HOTLIST|LIST_VFSLIST|LIST_MOVELIST}, { B_UP_GROUP, NORMAL_BUTTON, 0, 42, N_("&Up"), "up", LIST_HOTLIST|LIST_MOVELIST}, { B_ADD_CURRENT, NORMAL_BUTTON, 0, 20, N_("&Add current"),"ad", LIST_HOTLIST}, +#ifdef USE_VFS + { B_REFRESH_VFS, NORMAL_BUTTON, 0, 43, N_("&Refresh"), "r", LIST_VFSLIST}, + { B_FREE_ALL_VFS, NORMAL_BUTTON, 0, 20, N_("Fr&ee VFSs now"), "f", LIST_VFSLIST}, +#endif { B_ENTER, DEFPUSH_BUTTON, 0, 0, N_("Change &To"), "ct", LIST_HOTLIST|LIST_VFSLIST|LIST_MOVELIST}, }; @@ -252,6 +261,13 @@ unlink_entry (struct hotlist *entry) entry->up = 0; } +#ifdef USE_VFS +static void add_name_to_list (char *path) +{ + listbox_add_item (l_hotlist, 0, 0, path, 0); +} +#endif /* !USE_VFS */ + static int hotlist_button_callback (int action, void *data) { switch (action) { @@ -369,6 +385,18 @@ static int hotlist_button_callback (int action, void *data) break; } +#ifdef USE_VFS + case B_FREE_ALL_VFS: + vfs_expire (1); + /* fall through */ + + case B_REFRESH_VFS: + listbox_remove_list (l_hotlist); + listbox_add_item (l_hotlist, 0, 0, home_dir, 0); + vfs_fill_names (add_name_to_list); + return 0; +#endif /* USE_VFS */ + default: return 1; break; @@ -478,13 +506,6 @@ static int l_call (void *l) return listbox_nothing; } -#ifdef USE_VFS -static void add_name_to_list (char *path) -{ - listbox_add_item (l_hotlist, 0, 0, path, 0); -} -#endif /* !USE_VFS */ - /* * Expands all button names (once) and recalculates button positions. * returns number of columns in the dialog box, which is 10 chars longer diff --git a/src/main.c b/src/main.c index f96407f5f..937a1e4f3 100644 --- a/src/main.c +++ b/src/main.c @@ -917,7 +917,6 @@ static menu_entry CmdMenu[] = { {' ', N_("di&Rectory hotlist C-\\"), 'R', quick_chdir_cmd}, #ifdef USE_VFS {' ', N_("&Active VFS list C-x a"), 'A', reselect_vfs}, - {' ', N_("Fr&ee VFSs now"), 'E', free_vfs_now}, #endif #ifdef WITH_BACKGROUND {' ', N_("&Background jobs C-x j"), 'B', jobs_cmd},