* please see the file GPL in the top level source directory.
*/
-#include <lib-lib/lib-lib.h>
+#include <lib-ui/lib-ui.h>
#include <lib-ui/sidebar.h>
#include <lib-mx/mx.h>
#include "pop.h"
-#include "curses.h"
#include "menu.h"
#include "mutt.h"
#include <imap/imap_private.h>
#ifdef USE_NNTP
-#include <nntp/nntp.h>
+#include "nntp.h"
#endif
static const char *No_mailbox_is_open = N_("No mailbox is open.");
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 */
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 */
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);
+ wmove(stdscr, option (OPTSTATUSONTOP) ? 0 : LINES - 2,SW);
mutt_paddstr (COLS-SW, buf);
SETCOLOR (MT_COLOR_NORMAL);
BKGDSET (MT_COLOR_NORMAL);
menu->oldcurrent = -1;
if (option (OPTBRAILLEFRIENDLY))
- move (menu->current - menu->top + menu->offset, 0);
+ wmove (stdscr, menu->current - menu->top + menu->offset, 0);
else
- move (menu->current - menu->top + menu->offset, COLS - 1);
+ wmove (stdscr, 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 */
tag = 1;
/* give visual indication that the next command is a tag- command */
- mvaddstr (LINES - 1, 0, "tag-");
- clrtoeol ();
+ mvwaddstr (stdscr, LINES - 1, 0, "tag-");
+ wclrtoeol (stdscr);
/* get the real command */
if ((op = km_dokey (MENU_MAIN)) == OP_TAG_PREFIX) {
tag = 1;
/* give visual indication that the next command is a tag- command */
- mvaddstr (LINES - 1, 0, "tag-");
- clrtoeol ();
+ mvwaddstr (stdscr, LINES - 1, 0, "tag-");
+ wclrtoeol (stdscr);
/* get the real command */
if ((op = km_dokey (MENU_MAIN)) == OP_TAG_PREFIX) {
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 */
menu->current = mutt_thread_next_unread (Context, CURHDR);
}
- if (option (OPTPGPAUTODEC) &&
- (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
if ((op = mutt_display_message (CURHDR)) == -1) {
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;
CHECK_MX_ACL (Context, ACL_INSERT, _("Editing"));
- if (option (OPTPGPAUTODEC)
- && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
mutt_edit_message (Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
CHECK_VISIBLE;
CHECK_ATTACH;
- if (option (OPTPGPAUTODEC) &&
- (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
ci_send_message (SENDFORWARD, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
CHECK_VISIBLE;
CHECK_ATTACH;
- if (option (OPTPGPAUTODEC) &&
- (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
ci_send_message (SENDREPLY | SENDGROUPREPLY, NULL, NULL, Context,
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- if (option (OPTPGPAUTODEC) &&
- (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
ci_send_message (SENDREPLY | SENDLISTREPLY, NULL, NULL, Context,
break;
case OP_PIPE:
-
CHECK_MSGCOUNT;
CHECK_VISIBLE;
mutt_pipe_message (tag ? NULL : CURHDR);
- /* in an IMAP folder index with imap_peek=no, piping could change
- * * new or old messages status to read. Redraw what's needed.
- */
- if (Context->magic == M_IMAP && !option (OPTIMAPPEEK)) {
- menu->redraw = (tag ? REDRAW_INDEX : REDRAW_CURRENT) | REDRAW_STATUS;
- }
MAYBE_REDRAW (menu->redraw);
break;
case OP_PRINT:
-
CHECK_MSGCOUNT;
CHECK_VISIBLE;
mutt_print_message (tag ? NULL : CURHDR);
- /* in an IMAP folder index with imap_peek=no, piping could change
- * * new or old messages status to read. Redraw what's needed.
- */
- if (Context->magic == M_IMAP && !option (OPTIMAPPEEK)) {
- menu->redraw = (tag ? REDRAW_INDEX : REDRAW_CURRENT) | REDRAW_STATUS;
- }
break;
case OP_MAIN_READ_THREAD:
case OP_MAIN_READ_SUBTHREAD:
-
CHECK_MSGCOUNT;
CHECK_VISIBLE;
CHECK_READONLY;
_("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?"))
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- if (option (OPTPGPAUTODEC) &&
- (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
ci_send_message (SENDREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);