X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=browser.c;h=21bb588ea2ac0c9c2d8eab7e81cbd10989ad3028;hp=2012ec8d89c316592624806a3a313c5514f09a57;hb=f2c6ea5470ab89bf4fd14958cc1090bedbb5b2e8;hpb=3d937534e7b1ee723f86594b5e4c64c95158a933 diff --git a/browser.c b/browser.c index 2012ec8..21bb588 100644 --- a/browser.c +++ b/browser.c @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include "mutt.h" #include "mutt_curses.h" #include "mutt_menu.h" @@ -30,6 +34,7 @@ #ifdef USE_NNTP #include "nntp.h" #endif +#include "sidebar.h" #include #include @@ -565,6 +570,7 @@ static int examine_directory (MUTTMENU *menu, struct browser_state *state, } closedir (dp); } + draw_sidebar (CurrentMenu); browser_sort (state); return 0; } @@ -1099,7 +1105,28 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num } break; - case OP_DELETE_MAILBOX: + case OP_RENAME_MAILBOX: + if (!state.entry[menu->current].imap) + mutt_error (_("Rename is only supported for IMAP mailboxes")); + else + { + int nentry = menu->current; + + if (imap_mailbox_rename (state.entry[nentry].name) >= 0) { + destroy_state (&state); + init_state (&state, NULL); + state.imap_browse = 1; + imap_browse (LastDir, &state); + menu->data = state.entry; + menu->current = 0; + menu->top = 0; + init_menu (&state, menu, title, sizeof (title), buffy); + MAYBE_REDRAW (menu->redraw); + } + } + break; + + case OP_DELETE_MAILBOX: if (!state.entry[menu->current].imap) mutt_error (_("Delete is only supported for IMAP mailboxes")); else