balsa r7870 - in trunk: . libbalsa src



Author: PeterB
Date: Wed Feb 27 13:57:02 2008
New Revision: 7870
URL: http://svn.gnome.org/viewvc/balsa?rev=7870&view=rev

Log:
various

Modified:
   trunk/ChangeLog
   trunk/libbalsa/mailbox.c
   trunk/libbalsa/mailbox_imap.c
   trunk/src/balsa-mblist.c
   trunk/src/balsa-mblist.h
   trunk/src/mailbox-node.c
   trunk/src/sendmsg-window.c

Modified: trunk/libbalsa/mailbox.c
==============================================================================
--- trunk/libbalsa/mailbox.c	(original)
+++ trunk/libbalsa/mailbox.c	Wed Feb 27 13:57:02 2008
@@ -681,7 +681,7 @@
                                    (mailbox));
         libbalsa_mailbox_set_unread(mailbox, mailbox->unread_messages);
     } else if (mailbox->has_unread_messages
-               && libbalsa_mailbox_get_unread(mailbox) == 0) {
+               && libbalsa_mailbox_get_unread(mailbox) <= 0) {
         /* Mail has arrived in a closed mailbox since our last check;
          * total is unknown, but mailbox->has_unread_messages is valid. */
         libbalsa_mailbox_set_total(mailbox, -1);

Modified: trunk/libbalsa/mailbox_imap.c
==============================================================================
--- trunk/libbalsa/mailbox_imap.c	(original)
+++ trunk/libbalsa/mailbox_imap.c	Wed Feb 27 13:57:02 2008
@@ -1197,7 +1197,7 @@
 
     if(libbalsa_imap_server_get_use_status(LIBBALSA_IMAP_SERVER(server))) {
         static struct ImapStatusResult info[] = {
-            { IMSTAT_RECENT, 0 }, { IMSTAT_NONE, 0 } };
+            { IMSTAT_UNSEEN, 0 }, { IMSTAT_NONE, 0 } };
         /* cannot do status on an open mailbox */
         g_return_val_if_fail(!mimap->opened, FALSE);
         if(imap_mbox_status(handle, mimap->path, info) != IMR_OK)

Modified: trunk/src/balsa-mblist.c
==============================================================================
--- trunk/src/balsa-mblist.c	(original)
+++ trunk/src/balsa-mblist.c	Wed Feb 27 13:57:02 2008
@@ -2347,6 +2347,24 @@
 /* Make a new row for mbnode in balsa_app.mblist_tree_store; the row
  * will be a child to the row for root, if we find it, and a top-level
  * row otherwise. */
+static gboolean
+bmbl_sort_idle(gpointer data)
+{
+    GtkTreeSortable *sortable = data;
+
+    gdk_threads_enter();
+
+    gtk_tree_sortable_set_sort_column_id(sortable,
+                                         balsa_app.mblist->sort_column_id,
+                                         GTK_SORT_ASCENDING);
+    balsa_app.mblist->sort_idle_id = 0;
+    g_object_unref(sortable);
+
+    gdk_threads_leave();
+
+    return FALSE;
+}
+
 void 
 balsa_mblist_mailbox_node_append(BalsaMailboxNode * root,
 				 BalsaMailboxNode * mbnode)
@@ -2359,9 +2377,21 @@
     gdk_threads_enter();
 
     model = GTK_TREE_MODEL(balsa_app.mblist_tree_store);
+
+    if (!balsa_app.mblist->sort_idle_id) {
+        GtkTreeSortable *sortable = GTK_TREE_SORTABLE(model);
+        gtk_tree_sortable_get_sort_column_id
+            (sortable, &balsa_app.mblist->sort_column_id, NULL);
+        gtk_tree_sortable_set_sort_column_id
+            (sortable, GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID,
+                       GTK_SORT_ASCENDING);
+        balsa_app.mblist->sort_idle_id =
+            g_idle_add(bmbl_sort_idle, g_object_ref(sortable));
+    }
+
     if (root && balsa_find_iter_by_data(&parent, root))
 	parent_iter = &parent;
-    gtk_tree_store_append(balsa_app.mblist_tree_store, &iter, parent_iter);
+    gtk_tree_store_prepend(balsa_app.mblist_tree_store, &iter, parent_iter);
     bmbl_store_redraw_mbnode(&iter, mbnode);
 
     if (parent_iter) {

Modified: trunk/src/balsa-mblist.h
==============================================================================
--- trunk/src/balsa-mblist.h	(original)
+++ trunk/src/balsa-mblist.h	Wed Feb 27 13:57:02 2008
@@ -40,6 +40,10 @@
     gboolean display_info;
     /* signal handler id */
     gulong toggled_handler_id;
+
+    /* to set sort order in an idle callback */
+    gint  sort_column_id;
+    guint sort_idle_id;
 };
 
 struct _BalsaMBListClass {

Modified: trunk/src/mailbox-node.c
==============================================================================
--- trunk/src/mailbox-node.c	(original)
+++ trunk/src/mailbox-node.c	Wed Feb 27 13:57:02 2008
@@ -1215,7 +1215,9 @@
 	    g_print(_("Local mailbox %s loaded as: %s\n"),
 		    mailbox->name,
 		    g_type_name(G_OBJECT_TYPE(mailbox)));
-	if (balsa_app.check_mail_upon_startup) {
+        if (balsa_app.check_mail_upon_startup
+            && libbalsa_mailbox_get_subscribe(mailbox) !=
+            LB_MAILBOX_SUBSCRIBE_NO) {
             g_object_ref(mailbox);
             g_idle_add((GSourceFunc) mailbox_check_idle, mailbox);
         }

Modified: trunk/src/sendmsg-window.c
==============================================================================
--- trunk/src/sendmsg-window.c	(original)
+++ trunk/src/sendmsg-window.c	Wed Feb 27 13:57:02 2008
@@ -1433,6 +1433,9 @@
                                               ident->replyto);
         gtk_widget_show(bsmsg->replyto[0]);
         gtk_widget_show(bsmsg->replyto[1]);
+    } else if (!sw_get_active(bsmsg, "ReplyTo")) {
+        gtk_widget_hide(bsmsg->replyto[0]);
+        gtk_widget_hide(bsmsg->replyto[1]);
     }
 #endif
 



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