Re: opening imap inboxes automatically (and an icon in the notification area)



Hi Bruno!

On 02/27/2009 09:34:38 AM Fri, Bruno Miguel wrote:
Hello.

I'm noticing what is, to me, a strange behavior by Balsa. I've checked
the option that makes Balsa check IMAP mailboxes, but when I open it it
doesn't really open them. I have to click, one by one, in all my six
email account Inboxes to see if I have new mail. I've even checked the
option to let Balsa fetch new mails at startup,  but it remains the
same: I have to open, one by one, all my Inboxes.

This may be a timing issue. Balsa adds many mailboxes to the mailbox tree in a timeout handler that runs after the initialization, but on startup-up checks only the the mailboxes in the initial startup tree. The attached patch moves the check to another timeout handler that runs after the one that adds mailboxes to the tree. Please check it out to see if it fixes the issue.

This can be quite frustrating, especially when I forget Balsa doesn't
have an option to put it hidden in the notification area and I close
it thinking it has (Kmail habits...). When that happens, I have to
repeat the all process.

I'm not clear about this. What icons would you like to see Balsa put in the "notification area", and what would you like to happen when you click on them?

Thanks for the feedback!

Peter
Index: src/main-window.c
===================================================================
--- src/main-window.c	(revision 8086)
+++ src/main-window.c	(working copy)
@@ -2695,10 +2695,8 @@
 	if (!LIBBALSA_IS_MAILBOX_IMAP(mbnode->mailbox) ||
 	    bw_imap_check_test(mbnode->dir ? mbnode->dir :
 			    libbalsa_mailbox_imap_get_path
-			    (LIBBALSA_MAILBOX_IMAP(mbnode->mailbox)))) {
-	    g_object_ref(mbnode->mailbox);
-	    *list = g_slist_prepend(*list, mbnode->mailbox);
-	}
+			    (LIBBALSA_MAILBOX_IMAP(mbnode->mailbox))))
+	    *list = g_slist_prepend(*list, g_object_ref(mbnode->mailbox));
     }
     g_object_unref(mbnode);
 
Index: src/main.c
===================================================================
--- src/main.c	(revision 8086)
+++ src/main.c	(working copy)
@@ -736,6 +736,13 @@
 }
 #endif
 
+static gboolean
+balsa_main_check_new_messages(gpointer data)
+{
+    check_new_messages_real(data, TYPE_CALLBACK);
+    return FALSE;
+}
+
 /* -------------------------- main --------------------------------- */
 int
 main(int argc, char *argv[])
@@ -886,13 +893,12 @@
     }
     gtk_widget_show(window);
 
-    if (cmd_check_mail_on_startup || balsa_app.check_mail_upon_startup)
-	check_new_messages_cb(NULL, NULL);
-
-
     g_idle_add((GSourceFunc) scan_mailboxes_idle_cb, NULL);
     g_timeout_add(1801*1000, (GSourceFunc) periodic_expunge_cb, NULL);
 
+    if (cmd_check_mail_on_startup || balsa_app.check_mail_upon_startup)
+        g_idle_add((GSourceFunc) balsa_main_check_new_messages, NULL);
+
     accel_map_load();
     gdk_threads_enter();
     gtk_main();

Attachment: pgpnG6rOKOaox.pgp
Description: PGP signature



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