Re: mblist fixup [PATCH]



On 2001.08.15 06:51 Ali Akcaagac wrote:
> hello,
> 
> whenever i read src/balsa-mblist.c i come over to this line that
> you read in the attached fix. i wonder if this shouldn't be fixed
> as i recommend it. i am not 100% sure about this but the previous
> if clause don't allow trash mailbox to go into this loop, so it
> must be right. please someone confirm my theory and if i was right
> please commit this fix to the CVS.
> 
> -- 
> Name....: Ali Akcaagac
> Status..: Student Of Computer & Economic Science
> E-Mail..: mailto:ali.akcaagac@stud.fh-wilhelmshaven.de
> WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
> 

Here are a couple of other changes that were prompted by revisiting
src/balsa-mblist.c:
1. Update the style of every node in the tree when an unread message count
changes, instead of waiting for the next mail check.
2. Propagate the `unread' style up the tree only as far as the first
viewable node.

Rationale:
1. There doesn't seem to be any reason not to.
2. It's nice to be shown that there's some unread mail in a mailbox in a
collapsed part of the tree, but it's not necessary to show this all the way
to the root. When non-leaf nodes couldn't be mailboxes, it didn't matter
much, but currently the display doesn't distinguish between a mailbox with
unread mail and one with a *child* with unread mail. With the present
change, that ambiguity is limited to the last parent that's viewable, and
one click to expand it resolves the ambiguity.

There may be reasons for preferring the current way of showing
things--please don't hold back, if you know of any!

Peter
diff -Nur balsa-cvs/src/balsa-mblist.c balsa-temp/src/balsa-mblist.c
--- balsa-cvs/src/balsa-mblist.c	Wed Aug  1 05:22:51 2001
+++ balsa-temp/src/balsa-mblist.c	Wed Aug 15 13:21:28 2001
@@ -466,10 +466,10 @@
 
     gtk_ctree_construct(GTK_CTREE(tree), 3, 0, titles);
 
-    gtk_signal_connect(GTK_OBJECT(tree), "tree_expand",
-		       GTK_SIGNAL_FUNC(mailbox_tree_expand), NULL);
-    gtk_signal_connect(GTK_OBJECT(tree), "tree_collapse",
-		       GTK_SIGNAL_FUNC(mailbox_tree_collapse), NULL);
+    gtk_signal_connect_after(GTK_OBJECT(tree), "tree_expand",
+			     GTK_SIGNAL_FUNC(mailbox_tree_expand), NULL);
+    gtk_signal_connect_after(GTK_OBJECT(tree), "tree_collapse",
+			     GTK_SIGNAL_FUNC(mailbox_tree_collapse), NULL);
 
     gtk_signal_connect(GTK_OBJECT(tree), "size_allocate",
 		       GTK_SIGNAL_FUNC(size_allocate_cb), NULL);
@@ -751,6 +751,7 @@
 
     mbnode = gtk_ctree_node_get_row_data(ctree, GTK_CTREE_NODE(node));
     mbnode->expanded = TRUE;
+    balsa_mblist_have_new(balsa_app.mblist);
 }
 
 static void
@@ -760,6 +761,7 @@
 
     mbnode = gtk_ctree_node_get_row_data(ctree, GTK_CTREE_NODE(node));
     mbnode->expanded = FALSE;
+    balsa_mblist_have_new(balsa_app.mblist);
 }
 
 /* balsa_mblist_column_resize [MBG]
@@ -1168,7 +1170,7 @@
 	}
 
 	/* propagate up to next level */
-        if (show_unread)
+        if (show_unread && !gtk_ctree_is_viewable(ctree, node))
 	    has_unread |= 1 << (GTK_CTREE_ROW(node)->level);
 
 	return;
@@ -1189,8 +1191,9 @@
             if (GTK_CTREE_ROW(node)->parent == NULL) {
                 has_unread = 0;
             } else {
-            has_unread |= (1 << (GTK_CTREE_ROW(node)->level));
-            has_unread &= ~(1 << (GTK_CTREE_ROW(node)->level + 1));
+		if (!gtk_ctree_is_viewable(ctree, node))
+		    has_unread |= (1 << (GTK_CTREE_ROW(node)->level));
+		has_unread &= ~(1 << (GTK_CTREE_ROW(node)->level + 1));
             }
 
         } else if (mbnode->style & MBNODE_STYLE_NEW_MAIL) {
@@ -1453,6 +1456,9 @@
 	GTK_CTREE(mblist),
 	node,
 	gtk_ctree_node_get_row_data(GTK_CTREE(mblist), node));
+    /* Do the folder styles as well */
+    gtk_ctree_post_recursive(GTK_CTREE(mblist), NULL,
+			     balsa_mblist_folder_style, NULL);
     gtk_clist_thaw(GTK_CLIST(mblist));
 }
 


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