X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=curs_main.c;h=4982c7382e7f96df279b9347f325062746e1389e;hp=97640d6e6cf1268934560df4a18ead3cd101a0a4;hb=ad29f4688c8a43e718f4cf25ab9337459fc472de;hpb=0d5798fa40d68a2cff1193196b9c4ddd67da5063 diff --git a/curs_main.c b/curs_main.c index 97640d6..4982c73 100644 --- a/curs_main.c +++ b/curs_main.c @@ -109,6 +109,22 @@ static const char *No_visible = N_("No visible messages."); extern const char *ReleaseDate; extern size_t UngetCount; +static void set_xterm_title_bar(char *title) +{ + fputs("\033]2;", stdout); + fputs(title, stdout); + fputs("\007", stdout); + fflush(stdout); +} + +static void set_xterm_icon_name(char *name) +{ + fputs("\033]1;", stdout); + fputs(name, stdout); + fputs("\007", stdout); + fflush(stdout); +} + void index_make_entry (char *s, size_t l, MUTTMENU *menu, int num) { format_flag flag = M_FORMAT_MAKEPRINT | M_FORMAT_ARROWCURSOR | M_FORMAT_INDEX; @@ -369,7 +385,7 @@ static void update_index (MUTTMENU *menu, CONTEXT *ctx, int check, if (menu->current < 0) menu->current = ci_first_message (); - + } static void resort_index (MUTTMENU *menu) @@ -590,6 +606,13 @@ int mutt_index_menu (void) mutt_paddstr (COLS, buf); SETCOLOR (MT_COLOR_NORMAL); menu->redraw &= ~REDRAW_STATUS; + if (option(OPTXTERMSETTITLES)) + { + menu_status_line (buf, sizeof (buf), menu, NONULL (XtermTitle)); + set_xterm_title_bar(buf); + menu_status_line (buf, sizeof (buf), menu, NONULL (XtermIcon)); + set_xterm_icon_name(buf); + } } menu->redraw = 0; @@ -1098,6 +1121,9 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE); else { mutt_set_flag (Context, CURHDR, M_TAG, !CURHDR->tagged); + Context->last_tag = CURHDR->tagged ? CURHDR : + ((Context->last_tag == CURHDR && !CURHDR->tagged) + ? NULL : Context->last_tag); menu->redraw = REDRAW_STATUS; if (option (OPTRESOLVE) && menu->current < Context->vcount - 1) { @@ -1152,6 +1178,9 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE); case OP_MAIN_SYNC_FOLDER: + if (Context && !Context->msgcount) + break; + CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -1273,6 +1302,12 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE); { int check; +#ifdef USE_COMPRESSED + if (Context->compressinfo && Context->realpath) + mutt_str_replace (&LastFolder, Context->realpath); + else +#endif + mutt_str_replace (&LastFolder, Context->path); oldcount = Context ? Context->msgcount : 0; @@ -2116,7 +2151,9 @@ CHECK_IMAP_ACL(IMAP_ACL_INSERT); break; CHECK_MSGCOUNT; CHECK_VISIBLE; - mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw); + if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)) + mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw); + if (menu->menu == MENU_PAGER) { op = OP_DISPLAY_MESSAGE;