X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=flags.c;h=fe4f79af8073c5320869dc57c8e080f8fc4ea8ef;hp=c767ac6aab510d4e96da448bffb10bb93481b09d;hb=19806c1ee3019ddf9facf23eb19a13c128abfba9;hpb=a552eb852c1d02cedb0c6517603ce44a219e3110 diff --git a/flags.c b/flags.c index c767ac6..fe4f79a 100644 --- a/flags.c +++ b/flags.c @@ -9,9 +9,8 @@ #include -#include +#include #include -#include #include #include "mutt.h" @@ -284,7 +283,7 @@ int mutt_thread_set_flag (HEADER * hdr, int flag, int bf, int subthread) if ((Sort & SORT_MASK) != SORT_THREADS) { mutt_error _("Threading is not enabled."); - return (-1); + return -1; } if (!subthread) @@ -296,7 +295,7 @@ int mutt_thread_set_flag (HEADER * hdr, int flag, int bf, int subthread) mutt_set_flag (Context, cur->message, flag, bf); if ((cur = cur->child) == NULL) - return (0); + return 0; for (;;) { if (cur->message) @@ -310,7 +309,7 @@ int mutt_thread_set_flag (HEADER * hdr, int flag, int bf, int subthread) while (!cur->next) { cur = cur->parent; if (cur == start) - return (0); + return 0; } cur = cur->next; } @@ -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; - mvprintw(LINES - 1, 0, "%s? (D/N/O/r/*/!): ", + snprintf(buf, sizeof(buf), "%s? (D/N/O/r/*/!): ", bf ? _("Set flag") : _("Clear flag")); - clrtoeol(); - - 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);