From: Pierre Habouzit Date: Tue, 13 Nov 2007 23:35:30 +0000 (+0100) Subject: move browser in the lib-ui X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=c81a65db2499a363af5af28610db5f7e69e15839;p=apps%2Fmadmutt.git move browser in the lib-ui Signed-off-by: Pierre Habouzit --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e0e34d..10966bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,7 +304,6 @@ MADMUTT_SOURCES(madmuttsrc madmuttgen account.c attach.c - browser.c commands.c compose.c copy.c @@ -336,7 +335,7 @@ MADMUTT_SOURCES(madmuttsrc madmuttgen STRING(REGEX REPLACE ";" " " MUTTLIBS "${MUTTLIBS}") ADD_EXECUTABLE(madmutt ${madmuttsrc}) -TARGET_LINK_LIBRARIES(madmutt mime sys mx lua imap ui lib) +TARGET_LINK_LIBRARIES(madmutt mime sys mx lua ui imap lib) SET_TARGET_PROPERTIES(madmutt PROPERTIES LINK_FLAGS "${MUTTLIBS}") # generate_files hack {{{ diff --git a/imap/imap.c b/imap/imap.c index 8fd96f8..de761d3 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -18,7 +18,6 @@ #include "globals.h" #include "pattern.h" #include "sort.h" -#include "browser.h" #include "message.h" #include "imap_private.h" #include "buffy.h" diff --git a/imap/imap.h b/imap/imap.h index a1ef7e6..29a2454 100644 --- a/imap/imap.h +++ b/imap/imap.h @@ -12,9 +12,9 @@ #define _IMAP_H 1 #include +#include #include "account.h" -#include "browser.h" extern mx_t const imap_mx; diff --git a/lib-ui/CMakeLists.txt b/lib-ui/CMakeLists.txt index 04c676a..4548293 100644 --- a/lib-ui/CMakeLists.txt +++ b/lib-ui/CMakeLists.txt @@ -1,4 +1,5 @@ ADD_LIBRARY(ui + browser.c color.c complete.c curs_lib.c diff --git a/browser.c b/lib-ui/browser.c similarity index 99% rename from browser.c rename to lib-ui/browser.c index 8075655..466cf77 100644 --- a/browser.c +++ b/lib-ui/browser.c @@ -7,20 +7,19 @@ * please see the file GPL in the top level source directory. */ -#include +#include #include #include #include -#include -#include #include +#include "menu.h" +#include "browser.h" #include "mutt.h" #include "buffy.h" #include "sort.h" -#include "browser.h" #include "attach.h" #include diff --git a/browser.h b/lib-ui/browser.h similarity index 82% rename from browser.h rename to lib-ui/browser.h index c4aa293..cdb19f7 100644 --- a/browser.h +++ b/lib-ui/browser.h @@ -39,4 +39,10 @@ struct browser_state { unsigned unmarked:1; }; +/* flags to mutt_select_file() */ +#define M_SEL_BUFFY (1<<0) +#define M_SEL_MULTI (1<<1) +#define M_SEL_FOLDER (1<<2) +void mutt_select_file (char *, ssize_t, int, char ***, int *); + #endif /* _BROWSER_H */ diff --git a/lib-ui/curs_lib.c b/lib-ui/curs_lib.c index 2268e5b..cfdba38 100644 --- a/lib-ui/curs_lib.c +++ b/lib-ui/curs_lib.c @@ -21,6 +21,7 @@ #include #include "menu.h" +#include "browser.h" #include "mutt.h" #include "pager.h" diff --git a/lib-ui/enter.c b/lib-ui/enter.c index 44ccb69..860f667 100644 --- a/lib-ui/enter.c +++ b/lib-ui/enter.c @@ -11,6 +11,7 @@ #include #include "menu.h" +#include "browser.h" #include "mutt.h" #include "alias.h" diff --git a/main.c b/main.c index 6247429..72166ea 100644 --- a/main.c +++ b/main.c @@ -86,7 +86,6 @@ usage: madmutt [ -nRyzZ ] [ -e ] [ -F ] [ -f ]\n\ puts(_(" -R open mailbox in read-only mode")); puts(_(" -s specify a subject (must be in quotes if it has spaces)")); puts(_(" -v show version and compile-time definitions")); - puts(_(" -y select a mailbox specified in your `mailboxes' list")); puts(_(" -z exit immediately if there are no messages in the mailbox")); puts(_(" -Z open the first folder with new message, exit immediately if none")); puts(_(" -h this help message")); @@ -171,8 +170,6 @@ static void show_version (void) #define M_BUFFY (1<<1) /* -Z */ #define M_NOSYSRC (1<<2) /* -n */ #define M_RO (1<<3) /* -R */ -#define M_SELECT (1<<4) /* -y */ -#define M_NEWS (1<<5) /* -g and -G */ __attribute__((format(printf, 1, 0))) static void mutt_nocurses_error (const char *fmt, ...) @@ -219,7 +216,7 @@ int main (int argc, char **argv) srand48 (time (NULL)); umask (077); - while ((i = getopt(argc, argv, "a:b:F:f:c:e:H:s:i:hnpRTtvyzZ")) >= 0) + while ((i = getopt(argc, argv, "a:b:F:f:c:e:H:s:i:hnpRTtvzZ")) >= 0) switch (i) { case 'a': if (strlen(optarg)<=512) @@ -283,10 +280,6 @@ int main (int argc, char **argv) version++; break; - case 'y': /* My special hack mode */ - flags |= M_SELECT; - break; - case 'z': flags |= M_IGNORE; break; @@ -479,20 +472,6 @@ int main (int argc, char **argv) folder[0] = 0; buffy_next (folder, sizeof (folder)); } - else if (flags & M_SELECT) { - if (!Incoming.len) { - mutt_endwin _("No incoming mailboxes defined."); - - exit (1); - } - folder[0] = 0; - mutt_select_file(folder, sizeof(folder), M_SEL_FOLDER | M_SEL_BUFFY, - NULL, NULL); - if (!folder[0]) { - mutt_endwin (NULL); - exit (0); - } - } if (!folder[0]) m_strcpy(folder, sizeof(folder), NONULL(Spoolfile)); diff --git a/mutt.h b/mutt.h index b1c5995..ec87e8e 100644 --- a/mutt.h +++ b/mutt.h @@ -182,11 +182,6 @@ enum { #define SENDRESEND (1<<6) #define SENDNEWS (1<<7) -/* flags to mutt_select_file() */ -#define M_SEL_BUFFY (1<<0) -#define M_SEL_MULTI (1<<1) -#define M_SEL_FOLDER (1<<2) - /* boolean vars */ enum { OPTALLOW8BIT, diff --git a/protos.h b/protos.h index d44db3d..ce22711 100644 --- a/protos.h +++ b/protos.h @@ -76,7 +76,6 @@ void mutt_safe_path (char *s, ssize_t l, address_t * a); void mutt_save_path (char *s, ssize_t l, address_t * a); void mutt_select_fcc (char *, ssize_t, HEADER *); -void mutt_select_file (char *, ssize_t, int, char ***, int *); void mutt_message_hook (CONTEXT *, HEADER *, int); void _mutt_set_flag (CONTEXT *, HEADER *, int, int, int);