X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Fmenu.c;h=6917d94c9801db2c782bc57a15e047ffadf9a2aa;hp=4c2bf1ed97b117233488d35941acb853de1bc1ef;hb=6920eb5798f2d9f25e5ea1af2ba86122cf408bd1;hpb=d240531be8ae2e28fed82a256e72ba449339540d diff --git a/lib-ui/menu.c b/lib-ui/menu.c index 4c2bf1e..6917d94 100644 --- a/lib-ui/menu.c +++ b/lib-ui/menu.c @@ -9,14 +9,12 @@ #include -#include "enter.h" #include "menu.h" #include "mutt.h" #include "charset.h" #include -#include extern size_t UngetCount; @@ -112,10 +110,7 @@ static void menu_pad_string (char *s, size_t n) void menu_redraw_full (MUTTMENU * menu) { SETCOLOR(main_w, MT_COLOR_NORMAL); - /* wclear() doesn't optimize screen redraws */ - wmove (main_w, 0, 0); - wclrtobot (main_w); - + werase(main_w); SETCOLOR(main_w, MT_COLOR_SIDEBAR); mvwhline(main_w, LINES - 2, 0, ACS_HLINE, getmaxx(main_w)); SETCOLOR(main_w, MT_COLOR_NORMAL); @@ -239,9 +234,9 @@ static void menu_redraw_prompt (MUTTMENU * menu) if (*Errorbuf) mutt_clear_error (); - SETCOLOR(main_w, MT_COLOR_NORMAL); - mvwaddstr (main_w, LINES - 1, 0, menu->prompt); - wclrtoeol (main_w); + SETCOLOR(stdscr, MT_COLOR_NORMAL); + mvwaddstr(stdscr, LINES - 1, 0, menu->prompt); + wclrtoeol(stdscr); } } @@ -497,7 +492,7 @@ static int menu_search_generic (MUTTMENU * m, regex_t * re, int n) char buf[LONG_STRING]; menu_make_entry (buf, sizeof (buf), m, n); - return (regexec (re, buf, 0, NULL, 0)); + return regexec (re, buf, 0, NULL, 0); } MUTTMENU *mutt_new_menu (void) @@ -511,7 +506,7 @@ MUTTMENU *mutt_new_menu (void) p->pagelen = LINES - 3; p->color = default_color; p->search = menu_search_generic; - return (p); + return p; } void mutt_menuDestroy (MUTTMENU ** p) @@ -545,7 +540,7 @@ static int menu_search (MUTTMENU * menu, int op) if (mutt_get_field ((op == OP_SEARCH) ? _("Search for: ") : _("Reverse search for: "), buf, sizeof (buf), M_CLEAR) != 0 || !buf[0]) - return (-1); + return -1; m_strreplace(&menu->searchBuf, buf); menu->searchDir = (op == OP_SEARCH) ? M_SEARCH_DOWN : M_SEARCH_UP; } @@ -553,7 +548,7 @@ static int menu_search (MUTTMENU * menu, int op) if (!menu->searchBuf) { mutt_error _("No search pattern."); - return (-1); + return -1; } } @@ -567,7 +562,7 @@ static int menu_search (MUTTMENU * menu, int op) regerror (r, &re, buf, sizeof (buf)); regfree (&re); mutt_error ("%s", buf); - return (-1); + return -1; } r = menu->current + searchDir; @@ -583,7 +578,7 @@ static int menu_search (MUTTMENU * menu, int op) regfree (&re); mutt_error _("Not found."); - return (-1); + return -1; } static int menu_dialog_translate_op (int i) @@ -634,7 +629,7 @@ int menu_redraw (MUTTMENU * menu) if (menu->redraw & REDRAW_FULL) { menu_redraw_full (menu); /* allow the caller to do any local configuration */ - return (OP_REDRAW); + return OP_REDRAW; } if (!menu->dialog) @@ -682,11 +677,11 @@ int mutt_menuLoop (MUTTMENU * menu) i = km_dokey (menu->menu); if (i == OP_TAG_PREFIX || i == OP_TAG_PREFIX_COND) { if (menu->tagged) { - mvwaddstr (main_w, LINES - 1, 0, "Tag-"); - wclrtoeol (main_w); + mvwaddstr(stdscr, LINES - 1, 0, "Tag-"); + wclrtoeol(stdscr); i = km_dokey (menu->menu); menu->tagprefix = 1; - CLEARLINE(main_w, LINES - 1); + CLEARLINE(stdscr, LINES - 1); } else if (i == OP_TAG_PREFIX) { mutt_error _("No tagged entries."); @@ -841,10 +836,6 @@ int mutt_menuLoop (MUTTMENU * menu) MAYBE_REDRAW (menu->redraw); break; - case OP_WHAT_KEY: - mutt_what_key (); - break; - case OP_REDRAW: clearok (main_w, TRUE); menu->redraw = REDRAW_FULL; @@ -863,7 +854,7 @@ int mutt_menuLoop (MUTTMENU * menu) break; default: - return (i); + return i; } } /* not reached */