X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Fcurs_main.c;h=45c510542e9c19ade0d1780405bde97704ea9e93;hp=fdce20e261297a049455c6b11330a7872728888d;hb=2afa942ab1afde7acc8c8ef4670cddcbd25b1b3e;hpb=74697a5c38af6a85ce3b0062d781c35814a9f536 diff --git a/lib-ui/curs_main.c b/lib-ui/curs_main.c index fdce20e..45c5105 100644 --- a/lib-ui/curs_main.c +++ b/lib-ui/curs_main.c @@ -13,32 +13,25 @@ #include #include - +#include #include #include "curses.h" #include "menu.h" #include "mutt.h" +#include "crypt.h" +#include "pattern.h" #include "alias.h" -#include "mx.h" #include "sort.h" #include "recvattach.h" #include "buffy.h" -#include "mx.h" #include "thread.h" -#include "xterm.h" #include -#include - #ifdef USE_NNTP -#include "nntp/nntp.h" -#endif - -#ifdef USE_SASL -#include "mutt_sasl.h" +#include #endif static const char *No_mailbox_is_open = N_("No mailbox is open."); @@ -99,12 +92,14 @@ extern size_t UngetCount; void index_make_entry (char *s, ssize_t l, struct menu_t * menu, int num) { - format_flag flag = - M_FORMAT_MAKEPRINT | M_FORMAT_ARROWCURSOR | M_FORMAT_INDEX; + format_flag flag = M_FORMAT_MAKEPRINT | M_FORMAT_INDEX; int edgemsgno, reverse = Sort & SORT_REVERSE; HEADER *h = Context->hdrs[Context->v2r[num]]; THREAD *tmp; + if (option(OPTARROWCURSOR)) + flag |= M_FORMAT_ARROWCURSOR; + if ((Sort & SORT_MASK) == SORT_THREADS && h->tree) { flag |= M_FORMAT_TREE; /* display the thread tree */ if (h->display_subject) @@ -388,7 +383,7 @@ struct mapping_t IndexNewsHelp[] = { */ int mutt_index_menu (void) { - char buf[LONG_STRING], helpstr[SHORT_STRING]; + char buf[LONG_STRING], helpstr[STRING]; int flags; int op = OP_NULL; int done = 0; /* controls when to exit the "event" loop */ @@ -479,7 +474,7 @@ int mutt_index_menu (void) sidebar_draw (); mutt_message (_("New mail in this mailbox.")); - if (option (OPTBEEPNEW)) + if (MCore.beep_new) beep (); } else if (check == M_FLAGS) @@ -506,7 +501,7 @@ int mutt_index_menu (void) menu->redraw |= REDRAW_SIDEBAR; } if (do_buffy_notify) { - if (buffy_notify () && option (OPTBEEPNEW)) + if (buffy_notify () && MCore.beep_new) beep (); } else @@ -550,10 +545,11 @@ int mutt_index_menu (void) sidebar_set_buffystats (Context); menu->redraw &= ~REDRAW_STATUS; if (option (OPTXTERMSETTITLES)) { - menu_status_line (buf, sizeof (buf), menu, NONULL (XtermTitle)); - mutt_xterm_set_title (buf); - menu_status_line (buf, sizeof (buf), menu, NONULL (XtermIcon)); - mutt_xterm_set_icon (buf); + menu_status_line(buf, sizeof(buf), menu, NONULL(XtermTitle)); + printf("\033]2;%s\007", buf); + menu_status_line(buf, sizeof(buf), menu, NONULL(XtermIcon)); + printf("\033]1;%s\007", buf); + fflush(stdout); } } @@ -926,15 +922,14 @@ int mutt_index_menu (void) if (op == OP_TOGGLE_READ) { char buffer[LONG_STRING]; - if (!Context->pattern - || strncmp (Context->pattern, "!~R!~D~s", 8) != 0) { + if (m_strncmp (Context->pattern, "!~R!~D~s", 8) != 0) { snprintf (buffer, sizeof (buffer), "!~R!~D~s%s", Context->pattern ? Context->pattern : ".*"); set_option (OPTHIDEREAD); } else { m_strcpy(buf, sizeof(buf), Context->pattern + 8); - if (!*buf || strncmp (buf, ".*", 2) == 0) + if (m_strncmp (buf, ".*", 2) == 0) snprintf (buf, sizeof (buf), "~A"); unset_option (OPTHIDEREAD); } @@ -974,7 +969,7 @@ int mutt_index_menu (void) break; } - if (query_quadoption (OPT_QUIT, _("Quit Madmutt?")) == M_YES) { + if (query_quadoption2(MCore.quit, _("Quit Madmutt?")) == M_YES) { int check; oldcount = Context ? Context->msgcount : 0; @@ -1302,7 +1297,7 @@ int mutt_index_menu (void) } if ((menu->menu == MENU_MAIN) - && (query_quadoption (OPT_QUIT, + && (query_quadoption2(MCore.quit, _("Exit Madmutt without saving?")) == M_YES)) { if (Context) { @@ -1994,11 +1989,6 @@ int mutt_index_menu (void) menu->redraw = REDRAW_FULL; break; - - case OP_FORGET_PASSPHRASE: - crypt_forget_passphrase (); - break; - case OP_GROUP_REPLY: CHECK_MSGCOUNT; @@ -2036,13 +2026,6 @@ int mutt_index_menu (void) menu->redraw = REDRAW_FULL; break; - case OP_MAIL_KEY: - CHECK_ATTACH; - ci_send_message (SENDKEY, NULL, NULL, NULL, NULL); - menu->redraw = REDRAW_FULL; - break; - - case OP_EXTRACT_KEYS: CHECK_MSGCOUNT; CHECK_VISIBLE; @@ -2318,9 +2301,6 @@ int mutt_index_menu (void) if (menu->menu == MENU_PAGER) { menu->menu = MENU_MAIN; menu->redraw = REDRAW_FULL; -#if 0 - set_option (OPTWEED); /* turn header weeding back on. */ -#endif } if (done) @@ -2333,9 +2313,6 @@ int mutt_index_menu (void) #ifdef USE_NNTP /* Close all open NNTP connections */ nntp_logout_all (); -#endif -#ifdef USE_SASL - mutt_sasl_done (); #endif }