Simplifications.
[apps/madmutt.git] / recvattach.c
index 82aa139..91d6434 100644 (file)
@@ -13,7 +13,7 @@
 #include <lib-mime/mime.h>
 #include <lib-sys/unix.h>
 
-#include <lib-ui/curses.h>
+#include <lib-ui/lib-ui.h>
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 #include <lib-mx/mx.h>
 #include "attach.h"
 #include "copy.h"
 
-#define SW    (option(OPTMBOXPANE)?SidebarWidth:0)
-
-static struct mapping_t AttachHelp[] = {
-  {N_("Exit"), OP_EXIT},
-  {N_("Save"), OP_SAVE},
-  {N_("Pipe"), OP_PIPE},
-  {N_("Print"), OP_PRINT},
-  {N_("Help"), OP_HELP},
-  {NULL, OP_NULL}
-};
-
 void mutt_update_tree (ATTACHPTR ** idx, short idxlen)
 {
   char buf[STRING];
@@ -315,7 +304,7 @@ mutt_attach_fmt(char *dest, ssize_t destlen, char op, const char *src,
 
 static void attach_entry(char *b, ssize_t blen, MUTTMENU * menu, int num)
 {
-    m_strformat(b, blen, COLS - SW, AttachFormat, mutt_attach_fmt,
+    m_strformat(b, blen, getmaxx(main_w), AttachFormat, mutt_attach_fmt,
                 ((ATTACHPTR **) menu->data)[num], 0);
 }
 
@@ -495,7 +484,7 @@ mutt_query_pipe_attachment(char *command, FILE * fp, BODY * body, int afilter)
              _("WARNING!  You are about to overwrite %s, continue?"),
              body->filename);
     if (mutt_yesorno (warning, M_NO) != M_YES) {
-      CLEARLINE (LINES - 1);
+      CLEARLINE(main_w, LINES - 1);
       return;
     }
     tempfd = m_tempfd(tfile, sizeof(tfile), NONULL(mod_core.tmpdir), NULL);
@@ -799,7 +788,6 @@ void mutt_view_attachments (HEADER * hdr)
   int secured = 0;
   int need_secured = 0;
 
-  char helpstr[STRING];
   MUTTMENU *menu;
   BODY *cur = NULL;
   MESSAGE *msg;
@@ -868,8 +856,6 @@ void mutt_view_attachments (HEADER * hdr)
   menu->title = _("Attachments");
   menu->make_entry = attach_entry;
   menu->tag = mutt_tag_attach;
-  menu->help =
-    mutt_compile_help (helpstr, sizeof (helpstr), MENU_ATTACH, AttachHelp);
 
   mutt_attach_init (cur);
   attach_collapse (cur, 0, 1, 0);