[balsa] Open first mailbox not hidden



commit 5e08102bbbccae66ae639520712959cc02f5e412
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Mar 27 08:15:32 2010 -0400

    Open first mailbox not hidden
    
    	* src/balsa-app.c (open_mailbox_by_url),
    	(open_mailboxes_idle_cb): open first mailbox not hidden, open
    	the remainder hidden.

 ChangeLog       |    6 ++++++
 src/balsa-app.c |   19 +++++++++++--------
 2 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c5139f7..6648cc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-03-27  Peter Bloomfield
 
+	* src/balsa-app.c (open_mailbox_by_url),
+	(open_mailboxes_idle_cb): open first mailbox not hidden, open
+	the remainder hidden.
+
+2010-03-27  Peter Bloomfield
+
 	* src/balsa-index.c (bndx_destroy): recheck index->mailbox_node
 	after dropping the gdk lock.
 
diff --git a/src/balsa-app.c b/src/balsa-app.c
index 91b35fe..93060a8 100644
--- a/src/balsa-app.c
+++ b/src/balsa-app.c
@@ -513,7 +513,7 @@ append_url_if_open(const gchar * url, LibBalsaMailboxView * view,
 }
 
 static void
-open_mailbox_by_url(const gchar * url)
+open_mailbox_by_url(const gchar * url, gboolean hidden)
 {
     LibBalsaMailbox *mailbox;
 
@@ -524,11 +524,12 @@ open_mailbox_by_url(const gchar * url)
     if (balsa_app.debug)
         fprintf(stderr, "open_mailboxes_idle_cb: opening %s => %p..\n",
                 url, mailbox);
-    if (mailbox)
-        /* The first mailbox we open will be shown; later mailboxes will
-         * have notebook pages, but will not be shown. */
-        balsa_mblist_open_mailbox_hidden(mailbox);
-    else {
+    if (mailbox) {
+        if (hidden)
+            balsa_mblist_open_mailbox_hidden(mailbox);
+        else
+            balsa_mblist_open_mailbox(mailbox);
+    } else {
         /* Do not try to open it next time. */
         LibBalsaMailboxView *view =
             g_hash_table_lookup(libbalsa_mailbox_view_table, url);
@@ -569,10 +570,12 @@ open_mailboxes_idle_cb(gchar ** urls)
 
     if (urls) {
         if (*urls) {
-            open_mailbox_by_url(balsa_app.current_mailbox_url);
+            open_mailbox_by_url(balsa_app.current_mailbox_url, FALSE);
 
             for (tmp = urls; *tmp; ++tmp)
-                open_mailbox_by_url(*tmp);
+                if (!balsa_app.current_mailbox_url
+                    || strcmp(*tmp, balsa_app.current_mailbox_url))
+                    open_mailbox_by_url(*tmp, TRUE);
         }
 
         g_strfreev(urls);



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