* please see the file GPL in the top level source directory.
*/
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-ui/sidebar.h>
+#include <lib-mx/mx.h>
#include <pop/pop.h>
#include "curses.h"
#include "menu.h"
#include "mutt.h"
-#include "mx.h"
+#include "crypt.h"
+#include "pattern.h"
+#include "alias.h"
#include "sort.h"
#include "recvattach.h"
#include "buffy.h"
-#include "mx.h"
-#include "sidebar.h"
#include "thread.h"
-#include "xterm.h"
#include <imap/imap_private.h>
-#include <lib-crypt/crypt.h>
-
#ifdef USE_NNTP
-#include "nntp/nntp.h"
-#endif
-
-#ifdef USE_SASL
-#include "mutt_sasl.h"
+#include <nntp/nntp.h>
#endif
-#include "lib/debug.h"
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/wait.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <errno.h>
-
static const char *No_mailbox_is_open = N_("No mailbox is open.");
static const char *There_are_no_messages = N_("There are no messages.");
static const char *Mailbox_is_read_only = N_("Mailbox is read-only.");
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)
*/
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 */
("Mailbox was externally modified. Flags may be wrong."));
else if (check == M_NEW_MAIL) {
/* on new mail: redraw sidebar */
- sidebar_draw (CurrentMenu);
+ sidebar_draw ();
mutt_message (_("New mail in this mailbox."));
- if (option (OPTBEEPNEW))
+ if (MCore.beep_new)
beep ();
}
else if (check == M_FLAGS)
menu->redraw |= REDRAW_SIDEBAR;
}
if (do_buffy_notify) {
- if (buffy_notify () && option (OPTBEEPNEW))
+ if (buffy_notify () && MCore.beep_new)
beep ();
}
else
if (op != -1)
mutt_curs_set (0);
if (menu->redraw & REDRAW_SIDEBAR)
- sidebar_draw (menu->menu);
+ sidebar_draw ();
if (menu->redraw & REDRAW_FULL) {
menu_redraw_full (menu);
- sidebar_draw (menu->menu);
+ sidebar_draw ();
mutt_show_error ();
}
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);
}
}
op = km_dokey (MENU_MAIN);
- debug_print (4, ("Got op %d\n", op));
-
if (op == -1)
continue; /* either user abort or timeout */
break;
}
else {
- LIST *ref = CURHDR->env->references;
+ string_list_t *ref = CURHDR->env->references;
if (!ref) {
mutt_error (_("Article has no parent reference!"));
m_strcpy(buf, sizeof(buf), CURHDR->env->message_id);
if (op == OP_RECONSTRUCT_THREAD) {
- LIST *ref = CURHDR->env->references;
+ string_list_t *ref = CURHDR->env->references;
while (ref) {
nntp_check_msgid (Context, ref->data);
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);
}
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;
if (Context) {
int check;
- if (Context->compressinfo && Context->realpath)
+ if (Context->cinfo && Context->realpath)
m_strreplace(&LastFolder, Context->realpath);
else
m_strreplace(&LastFolder, Context->path);
}
if ((menu->menu == MENU_MAIN)
- && (query_quadoption (OPT_QUIT,
+ && (query_quadoption2(MCore.quit,
_("Exit Madmutt without saving?")) == M_YES))
{
if (Context) {
menu->redraw = REDRAW_FULL;
break;
-
- case OP_FORGET_PASSPHRASE:
- crypt_forget_passphrase ();
- break;
-
case OP_GROUP_REPLY:
CHECK_MSGCOUNT;
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;
case OP_SIDEBAR_PREV:
case OP_SIDEBAR_NEXT_NEW:
case OP_SIDEBAR_PREV_NEW:
- sidebar_scroll (op, menu->menu);
+ sidebar_scroll (op);
break;
default:
if (menu->menu == MENU_MAIN)
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)
#ifdef USE_NNTP
/* Close all open NNTP connections */
nntp_logout_all ();
-#endif
-#ifdef USE_SASL
- mutt_sasl_done ();
#endif
}