Patch: Open Inbox at startup



I suspect that I've missed something obvious that makes this unnecessary, 
but in case I'm wrong, here is a patch that will add the following option:

   -i, --open-inbox                   Opens default Inbox

-- 
Toralf Lund <toralf@kscanners.com>  +47 66 85 51 22
Kongsberg Scanners AS               +47 66 85 51 00 (switchboard)
http://www.kscanners.no/~toralf     +47 66 85 51 01 (fax)
Index: src/main.c
===================================================================
RCS file: /cvs/gnome/balsa/src/main.c,v
retrieving revision 1.122
diff -u -b -r1.122 main.c
--- src/main.c	2001/10/20 12:14:55	1.122
+++ src/main.c	2001/10/25 13:37:11
@@ -100,7 +100,7 @@
 */
 static gchar *cmd_line_open_mailboxes;
 static gboolean cmd_check_mail_on_startup,
-     cmd_open_unread_mailbox;
+    cmd_open_unread_mailbox, cmd_open_inbox;
 
 static void
 balsa_init(int argc, char **argv)
@@ -119,6 +119,9 @@
 	{"open-unread-mailbox", 'u', POPT_ARG_NONE,
 	 &(cmd_open_unread_mailbox), 0,
 	 N_("Opens first unread mailbox"), NULL},
+	{"open-inbox", 'i', POPT_ARG_NONE,
+	 &(cmd_open_inbox), 0,
+	 N_("Opens default Inbox"), NULL},
 	{"debug-pop", 'd', POPT_ARG_NONE, &PopDebug, 0, 
 	 N_("Debug POP3 connection"), NULL},
 	{NULL, '\0', 0, NULL, 0}	/* end the list */
@@ -249,6 +252,22 @@
     return FALSE;
 }
 
+
+static gboolean
+initial_open_inbox()
+{
+    GList *i;
+    
+    if (!balsa_app.inbox)
+	return FALSE;
+
+    printf("opening %s..\n", (LIBBALSA_MAILBOX(balsa_app.inbox))->name);
+    mblist_open_mailbox(LIBBALSA_MAILBOX(balsa_app.inbox));
+    
+    return FALSE;
+}
+
+
 /* -------------------------- main --------------------------------- */
 int
 main(int argc, char *argv[])
@@ -360,6 +379,9 @@
 
     if (cmd_open_unread_mailbox || balsa_app.open_unread_mailbox)
 	gtk_idle_add((GtkFunction) initial_open_unread_mailboxes, NULL);
+
+    if (cmd_open_inbox)
+	gtk_idle_add((GtkFunction) initial_open_inbox, NULL);
 
     if (cmd_line_open_mailboxes) {
 	gchar **names = g_strsplit(cmd_line_open_mailboxes, ";", 20);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]