X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=flags.c;h=f83d2a38bbc41c4aac248b8824f996d15a6d19f7;hp=aca2dcfb2e4ae968d409d60ecb20e8ffe09913eb;hb=1b124c1023ddce763d17efc8d84a9d53a35be31b;hpb=8ab1ab66eb1c4b95f9b2a5ed9c2b2cf1dfa74544 diff --git a/flags.c b/flags.c index aca2dcf..f83d2a3 100644 --- a/flags.c +++ b/flags.c @@ -11,7 +11,6 @@ #include #include -#include #include #include "mutt.h" @@ -320,6 +319,8 @@ int mutt_thread_set_flag (HEADER * hdr, int flag, int bf, int subthread) int mutt_change_flag(HEADER * h, int bf) { + char buf[STRING]; + const char letters[] = "dDnNoOrR*!"; static char const actions[] = { ['d'] = M_DELETE, ['D'] = M_DELETE, ['n'] = M_NEW, ['N'] = M_NEW, @@ -331,23 +332,12 @@ int mutt_change_flag(HEADER * h, int bf) int c; - mvwprintw(main_w, LINES - 1, 0, "%s? (D/N/O/r/*/!): ", + snprintf(buf, sizeof(buf), "%s? (D/N/O/r/*/!): ", bf ? _("Set flag") : _("Clear flag")); - wclrtoeol(main_w); - - c = mutt_getch().ch; - if (c == -1) { - CLEARLINE(main_w, LINES - 1); - return (-1); - } - - CLEARLINE(main_w, LINES - 1); - - if (c < 0 || c > countof(actions) || !actions[c]) { - BEEP(); + c = mutt_multi_choice(buf, letters); + if (c <= 0) return -1; - } - + c = letters[c - 1]; if (actions[c] == M_OLD) { if (h) { mutt_set_flag(Context, h, M_READ, !bf);