sync with 0.8.9cvs3
authorPaul Mangan <paul@claws-mail.org>
Thu, 30 Jan 2003 11:27:22 +0000 (11:27 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 30 Jan 2003 11:27:22 +0000 (11:27 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/gtk/gtkutils.c
src/gtk/gtkutils.h
src/prefs_common.c
src/summaryview.c

index b0f5869..4f70cab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-01-30
+
+       * src/summaryview.c: summary_execute(): select appropriate node
+         if currently selected node is to be deleted.
+       * src/gtkutils.[ch]: gtkut_ctree_node_is_selected(): new. Returns
+         TRUE if the specified node is selected.
+
 2003-01-30
 
        * src/summaryview.c: summary_status_show(): fixed a occasional crash
index 294c10b..d94331d 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-30 [paul]      0.8.9claws22
+
+       * sync with 0.8.9cvs3
+               see ChangeLog 2003-01-30
+
 2003-01-30 [paul]      0.8.9claws21
 
        * sync with 0.8.9cvs2
index 7d28495..3b59858 100644 (file)
@@ -1,3 +1,10 @@
+2003-01-30
+
+       * src/summaryview.c: summary_execute(): ¸½ºßÁªÂò¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤¬
+         ºï½ü¤µ¤ì¤ë¾ì¹ç¤ÏŬÀڤʥΡ¼¥É¤òÁªÂò¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/gtkutils.[ch]: gtkut_ctree_node_is_selected(): ¿·µ¬¡£»ØÄꤷ¤¿
+         ¥Î¡¼¥É¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ì¤Ð TRUE ¤òÊÖ¤¹¡£
+
 2003-01-30
 
        * src/summaryview.c: summary_status_show(): ºï½ü¤¢¤ë¤¤¤Ï°ÜÆ°»þ¤Ë
index 99c3957..9f3aeb3 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=9
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws21
+EXTRA_VERSION=claws22
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 630e9d4..9f6ee3e 100644 (file)
@@ -236,6 +236,19 @@ GtkCTreeNode *gtkut_ctree_node_next(GtkCTree *ctree, GtkCTreeNode *node)
        return NULL;
 }
 
+gboolean gtkut_ctree_node_is_selected(GtkCTree *ctree, GtkCTreeNode *node)
+{
+       GtkCList *clist = GTK_CLIST(ctree);
+       GList *cur;
+
+       for (cur = clist->selection; cur != NULL; cur = cur->next) {
+               if (node == GTK_CTREE_NODE(cur->data))
+                       return TRUE;
+       }
+
+       return FALSE;
+}
+
 GtkCTreeNode *gtkut_ctree_find_collapsed_parent(GtkCTree *ctree,
                                                GtkCTreeNode *node)
 {
index 63bb3be..2d484d0 100644 (file)
@@ -101,6 +101,8 @@ gint gtkut_ctree_get_nth_from_node  (GtkCTree       *ctree,
                                         GtkCTreeNode   *node);
 GtkCTreeNode *gtkut_ctree_node_next    (GtkCTree       *ctree,
                                         GtkCTreeNode   *node);
+gboolean gtkut_ctree_node_is_selected  (GtkCTree       *ctree,
+                                        GtkCTreeNode   *node);
 GtkCTreeNode *gtkut_ctree_find_collapsed_parent
                                        (GtkCTree       *ctree,
                                         GtkCTreeNode   *node);
index fc82ae1..b27665b 100644 (file)
@@ -306,7 +306,7 @@ static PrefParam param[] = {
        {"inc_local", "TRUE", &prefs_common.inc_local, P_BOOL,
         &receive.checkbtn_local,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"filter_on_inc_local", "FALSE", &prefs_common.filter_on_inc, P_BOOL,
+       {"filter_on_inc_local", "TRUE", &prefs_common.filter_on_inc, P_BOOL,
         &receive.checkbtn_filter_on_inc,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"spool_path", DEFAULT_SPOOL_PATH, &prefs_common.spool_path, P_STRING,
index 38d7570..27e15d0 100644 (file)
@@ -1643,7 +1643,7 @@ static GtkCTreeNode *summary_find_prev_msg(SummaryView *summaryview,
 
        for (; node != NULL; node = GTK_CTREE_NODE_PREV(node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
-               if (!MSG_IS_DELETED(msginfo->flags)) break;
+               if (msginfo && !MSG_IS_DELETED(msginfo->flags)) break;
        }
 
        return node;
@@ -1663,7 +1663,7 @@ static GtkCTreeNode *summary_find_next_msg(SummaryView *summaryview,
 
        for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
-               if (!MSG_IS_DELETED(msginfo->flags)) break;
+               if (msginfo && !MSG_IS_DELETED(msginfo->flags)) break;
        }
 
        return node;
@@ -1688,7 +1688,7 @@ static GtkCTreeNode *summary_find_prev_flagged_msg(SummaryView *summaryview,
 
        for (; node != NULL; node = GTK_CTREE_NODE_PREV(node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
-               if ((msginfo->flags.perm_flags & flags) != 0) break;
+               if (msginfo && (msginfo->flags.perm_flags & flags) != 0) break;
        }
 
        return node;
@@ -1716,7 +1716,7 @@ static GtkCTreeNode *summary_find_next_flagged_msg(SummaryView *summaryview,
                /* Find msg with matching flags but ignore messages with
                   ignore flags, if searching for new or unread messages */
                if (!(((flags & (MSG_NEW | MSG_UNREAD)) != 0) && MSG_IS_IGNORE_THREAD(msginfo->flags)) && 
-                       ((msginfo->flags.perm_flags & flags) != 0))
+                       (msginfo && (msginfo->flags.perm_flags & flags) != 0))
                        break;
        }
 
@@ -1734,7 +1734,7 @@ static GtkCTreeNode *summary_find_msg_by_msgnum(SummaryView *summaryview,
 
        for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
-               if (msginfo->msgnum == msgnum) break;
+               if (msginfo && msginfo->msgnum == msgnum) break;
        }
 
        return node;
@@ -3464,6 +3464,7 @@ gboolean summary_execute(SummaryView *summaryview)
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
        GtkCTreeNode *node, *next;
+       GtkCTreeNode *new_selected = NULL;
 
        if (!summaryview->folder_item) return FALSE;
 
@@ -3482,19 +3483,36 @@ gboolean summary_execute(SummaryView *summaryview)
        folder_item_update_thaw();
 
        node = GTK_CTREE_NODE(clist->row_list);
-       while (node != NULL) {
+       for (; node != NULL; node = next) {
                next = gtkut_ctree_node_next(ctree, node);
-               if (gtk_ctree_node_get_row_data(ctree, node) == NULL) {
-                       if (node == summaryview->displayed) {
-                               messageview_clear(summaryview->messageview);
-                               summaryview->displayed = NULL;
-                       }
-                       if (GTK_CTREE_ROW(node)->children != NULL)
-                               g_warning("summary_execute(): children != NULL\n");
-                       else
-                               gtk_ctree_remove_node(ctree, node);
+               if (gtk_ctree_node_get_row_data(ctree, node) != NULL) continue;
+
+               if (node == summaryview->displayed) {
+                       messageview_clear(summaryview->messageview);
+                       summaryview->displayed = NULL;
                }
-               node = next;
+               if (GTK_CTREE_ROW(node)->children != NULL) {
+                       g_warning("summary_execute(): children != NULL\n");
+                       continue;
+               }
+
+               if (!new_selected &&
+                   gtkut_ctree_node_is_selected(ctree, node)) {
+                       gtk_sctree_unselect_all(GTK_SCTREE(ctree));
+                       new_selected = summary_find_next_msg(summaryview, node);
+                       if (!new_selected)
+                               new_selected = summary_find_prev_msg
+                                       (summaryview, node);
+               }
+
+               gtk_ctree_remove_node(ctree, node);
+       }
+
+       if (new_selected) {
+               gtk_sctree_select
+                       (GTK_SCTREE(ctree),
+                        summaryview->displayed ? summaryview->displayed
+                        : new_selected);
        }
 
        if (summaryview->threaded)