X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=flags.c;h=a893cc74f2c8705ffc8aac7a4feb9729431fd29a;hp=afadb4ce699b418f5f41a85cc7e492efe8bc9798;hb=00f34116b32751764d42f81159c292d850c74bac;hpb=8e39affbf1cd8a2a5ff5c9991650d54fdcea4997 diff --git a/flags.c b/flags.c index afadb4c..a893cc7 100644 --- a/flags.c +++ b/flags.c @@ -9,7 +9,7 @@ #include -#include +#include #include #include #include @@ -320,6 +320,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 +333,12 @@ int mutt_change_flag(HEADER * h, int bf) int c; - mvwprintw(stdscr, LINES - 1, 0, "%s? (D/N/O/r/*/!): ", + snprintf(buf, sizeof(buf), "%s? (D/N/O/r/*/!): ", bf ? _("Set flag") : _("Clear flag")); - wclrtoeol(stdscr); - - c = mutt_getch().ch; - if (c == -1) { - CLEARLINE (LINES - 1); - return (-1); - } - - CLEARLINE (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);