X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Fcurs_main.c;h=257cd96591e6211956b1a815042e4972a03c993e;hp=6648b1a49e600aa53cbaaf50096642945af793d4;hb=7dcd7ee09b8760133ac8ec00562e4d60b2f0aebd;hpb=b7a46c16244533f5c6a2d6964a4fbb591ccc5588 diff --git a/lib-ui/curs_main.c b/lib-ui/curs_main.c index 6648b1a..257cd96 100644 --- a/lib-ui/curs_main.c +++ b/lib-ui/curs_main.c @@ -10,13 +10,12 @@ * please see the file GPL in the top level source directory. */ -#include +#include #include #include #include "pop.h" -#include "curses.h" #include "menu.h" #include "mutt.h" @@ -32,7 +31,7 @@ #include #ifdef USE_NNTP -#include +#include "nntp.h" #endif static const char *No_mailbox_is_open = N_("No mailbox is open."); @@ -87,7 +86,6 @@ static const char *No_visible = N_("No visible messages."); #define CURHDR Context->hdrs[Context->v2r[menu->current]] #define OLDHDR Context->hdrs[Context->v2r[menu->oldcurrent]] #define UNREAD(h) mutt_thread_contains_unread (Context, h) -#define SW (option(OPTMBOXPANE)?SidebarWidth:0) extern size_t UngetCount; @@ -350,38 +348,12 @@ static void resort_index (MUTTMENU * menu) menu->redraw = REDRAW_INDEX | REDRAW_STATUS; } -struct mapping_t IndexHelp[] = { - {N_("Quit"), OP_QUIT}, - {N_("Del"), OP_DELETE}, - {N_("Undel"), OP_UNDELETE}, - {N_("Save"), OP_SAVE}, - {N_("Mail"), OP_MAIL}, - {N_("Reply"), OP_REPLY}, - {N_("Group"), OP_GROUP_REPLY}, - {N_("Help"), OP_HELP}, - {NULL, OP_NULL} -}; - -#ifdef USE_NNTP -struct mapping_t IndexNewsHelp[] = { - {N_("Quit"), OP_QUIT}, - {N_("Del"), OP_DELETE}, - {N_("Undel"), OP_UNDELETE}, - {N_("Save"), OP_SAVE}, - {N_("Post"), OP_POST}, - {N_("Followup"), OP_FOLLOWUP}, - {N_("Catchup"), OP_CATCHUP}, - {N_("Help"), OP_HELP}, - {NULL, OP_NULL} -}; -#endif - /* This function handles the message index window as well as commands returned * from the pager (MENU_PAGER). */ int mutt_index_menu (void) { - char buf[LONG_STRING], helpstr[STRING]; + char buf[LONG_STRING]; int flags; int op = OP_NULL; int done = 0; /* controls when to exit the "event" loop */ @@ -404,13 +376,6 @@ int mutt_index_menu (void) menu->make_entry = (void *) index_make_entry; menu->color = index_color; menu->current = ci_first_message (); - menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_MAIN, -#ifdef USE_NNTP - (Context - && (Context->magic == - M_NNTP)) ? IndexNewsHelp : -#endif - IndexHelp); if (!attach_msg) { buffy_check (0); /* force the buffy check after we enter the folder */ @@ -532,14 +497,13 @@ int mutt_index_menu (void) if (menu->redraw & REDRAW_STATUS) { menu_status_line (buf, sizeof (buf), menu, NONULL (Status)); - CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES - 2); - sidebar_draw_frames(); - SETCOLOR (MT_COLOR_STATUS); - BKGDSET (MT_COLOR_STATUS); - move(option (OPTSTATUSONTOP) ? 0 : LINES - 2,SW); - mutt_paddstr (COLS-SW, buf); - SETCOLOR (MT_COLOR_NORMAL); - BKGDSET (MT_COLOR_NORMAL); + CLEARLINE(main_w, 0); + SETCOLOR(main_w, MT_COLOR_STATUS); + BKGDSET(main_w, MT_COLOR_STATUS); + wmove(main_w, 0, 0); + mutt_paddstr (main_w, getmaxx(main_w), buf); + SETCOLOR(main_w, MT_COLOR_NORMAL); + BKGDSET(main_w, MT_COLOR_NORMAL); sidebar_set_buffystats (Context); menu->redraw &= ~REDRAW_STATUS; if (option (OPTXTERMSETTITLES)) { @@ -556,32 +520,18 @@ int mutt_index_menu (void) menu->oldcurrent = menu->current; else menu->oldcurrent = -1; - - if (option (OPTBRAILLEFRIENDLY)) - move (menu->current - menu->top + menu->offset, 0); - else - move (menu->current - menu->top + menu->offset, COLS - 1); mutt_refresh (); -#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM) if (SigWinch) { mutt_flushinp (); - mutt_resize_screen (); + ui_layout_resize(); menu->redraw = REDRAW_FULL; menu->menu = MENU_MAIN; - SigWinch = 0; menu->top = 0; /* so we scroll the right amount */ - /* - * force a real complete redraw. clrtobot() doesn't seem to be able - * to handle every case without this. - */ - clearok (stdscr, TRUE); continue; } -#endif op = km_dokey (MENU_MAIN); - if (op == -1) continue; /* either user abort or timeout */ @@ -603,13 +553,13 @@ int mutt_index_menu (void) tag = 1; /* give visual indication that the next command is a tag- command */ - mvaddstr (LINES - 1, 0, "tag-"); - clrtoeol (); + mvwaddstr (main_w, LINES - 1, 0, "tag-"); + wclrtoeol (main_w); /* get the real command */ if ((op = km_dokey (MENU_MAIN)) == OP_TAG_PREFIX) { /* abort tag sequence */ - CLEARLINE (LINES - 1); + CLEARLINE(main_w, LINES - 1); continue; } } @@ -638,13 +588,13 @@ int mutt_index_menu (void) tag = 1; /* give visual indication that the next command is a tag- command */ - mvaddstr (LINES - 1, 0, "tag-"); - clrtoeol (); + mvwaddstr (main_w, LINES - 1, 0, "tag-"); + wclrtoeol (main_w); /* get the real command */ if ((op = km_dokey (MENU_MAIN)) == OP_TAG_PREFIX) { /* abort tag sequence */ - CLEARLINE (LINES - 1); + CLEARLINE(main_w, LINES - 1); continue; } } @@ -984,8 +934,7 @@ int mutt_index_menu (void) break; case OP_REDRAW: - - clearok (stdscr, TRUE); + clearok (main_w, TRUE); menu->redraw = REDRAW_FULL; break; @@ -1133,7 +1082,7 @@ int mutt_index_menu (void) case OP_MAIN_CHANGE_GROUP: case OP_MAIN_CHANGE_GROUP_READONLY: #endif - if (attach_msg || option (OPTREADONLY) || + if (attach_msg || #ifdef USE_NNTP op == OP_MAIN_CHANGE_GROUP_READONLY || #endif @@ -1180,7 +1129,7 @@ int mutt_index_menu (void) break; } if (!buf[0]) { - CLEARLINE (LINES - 1); + CLEARLINE(main_w, LINES - 1); break; } @@ -1235,14 +1184,6 @@ int mutt_index_menu (void) menu->current = 0; sidebar_set_current (buf); -#ifdef USE_NNTP - /* buffy_check() must be done with mail-reader mode! */ - menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_MAIN, - (Context - && (Context->magic == - M_NNTP)) ? IndexNewsHelp : - IndexHelp); -#endif mutt_clear_error (); buffy_check (0); /* force the buffy check after we have changed the folder */ @@ -1929,7 +1870,7 @@ int mutt_index_menu (void) case OP_CATCHUP: if (Context && Context->magic == M_NNTP) { if (mutt_newsgroup_catchup (CurrentNewsSrv, - ((NNTP_DATA *) Context->data)->group)) + ((nntp_data_t *) Context->data)->group)) menu->redraw = REDRAW_INDEX | REDRAW_STATUS; } break; @@ -2114,7 +2055,7 @@ int mutt_index_menu (void) _("Reply by mail as poster prefers?")) != M_YES) { if (Context && Context->magic == M_NNTP - && !((NNTP_DATA *) Context->data)->allowed + && !((nntp_data_t *) Context->data)->allowed && query_quadoption (OPT_TOMODERATED, _ ("Posting to this group not allowed, may be moderated. Continue?"))