sync with sylpheed 0.7.1cvs9
authorPaul Mangan <paul@claws-mail.org>
Fri, 15 Feb 2002 09:26:31 +0000 (09:26 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 15 Feb 2002 09:26:31 +0000 (09:26 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/mainwindow.c
src/summary_search.c
src/summaryview.c
src/summaryview.h

index 621f043f42bfef710072d85fb8fbea52fd60f14c..b0ff4ab7383b3b00e6f87b7a941c9d37367de303 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-02-15
+
+       * src/mainwindow.c: main_window_set_menu_sensitive(): set 'Show
+         all header' toggle state from the property of the TextView.
+       * src/summaryview.[ch]: made 'All header' toggle switch.
+         Prohibited unnecessary menu update.
+         summary_select_node(): added the argument 'do_refresh'.
+         Some code cleanups.
+
 2002-02-14
 
        * src/utils.c: strsplit_with_quote(): remove quotation characters
index b7235c39dc5578d67489ae428310609eb31e2880..8438bd08ca2f102576f145d5a71ced3eed4cb28f 100644 (file)
@@ -1,3 +1,11 @@
+2002-02-15 [paul]      0.7.1claws5
+
+       * sync with sylpheed 0.7.1cvs9
+               see ChangeLog entry 2002-02-15
+
+       * po/POTFILES.in
+               remove unneeded headerwindow.c entry
+
 2002-02-14 [carsten]   0.7.1claws4
        * src/summaryview.c
                fixed a bug for "Go to next unread message": there was
index 3c5b757cc7ef2b2e51fb8613158e481c23a7a0b5..6d343b5e67adb9462073d39e3b6770001e8f1e44 100644 (file)
@@ -1,3 +1,12 @@
+2002-02-15
+
+       * src/mainwindow.c: main_window_set_menu_sensitive(): ¡ÖÁ´¤Æ¤Î
+         ¥Ø¥Ã¥À¤òɽ¼¨¡×¤Î¥È¥°¥ë¾õÂÖ¤ò TextView ¤Î¾õÂÖ¤«¤é¥»¥Ã¥È¡£
+       * src/summaryview.[ch]: ¡ÖÁ´¤Æ¤Î¥Ø¥Ã¥À¡×¤ò¥È¥°¥ë¥¹¥¤¥Ã¥Á¤Ë¤·¤¿¡£
+         ÉÔÍפʥá¥Ë¥å¡¼¤Î¹¹¿·¤òÍÞÀ©¡£
+         summary_select_node(): °ú¿ô 'do_refresh' ¤òÄɲá£
+         ¥³¡¼¥É¤ÎÀ°Íý¡£
+
 2002-02-14
 
        * src/utils.c: strsplit_with_quote(): ¤³¤Î´Ø¿ôÃæ¤Ç°úÍÑʸ»ú¤òºï½ü
index 37cbe6d15faebacdf7cabad1936b8933920cf1d5..79a99ee45dae515ac90b57e48759363673112670 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws4
+EXTRA_VERSION=claws5
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 095efdb7e139bdc643d7d2543b2178d241ebd65a..e50f2a5af33c9ea88e1f34be5aa2667c690b2d77 100644 (file)
@@ -1573,7 +1573,9 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
 
        main_window_menu_callback_block(mainwin);
        menuitem = gtk_item_factory_get_widget(ifactory, "/View/Show all header");
-       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), FALSE);
+       gtk_check_menu_item_set_active
+               (GTK_CHECK_MENU_ITEM(menuitem),
+                mainwin->messageview->textview->show_all_headers);
        menuitem = gtk_item_factory_get_widget(ifactory, "/View/Thread view");
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
                                       (state & M_THREADED) != 0);
index 2f31620bc929a05da3bc157d775794c27e28cdc8..3a2d8c8fa2a35b3bb710cb3570b895e971181ea6 100644 (file)
@@ -353,7 +353,7 @@ static void summary_search_execute(GtkButton *button, gpointer data)
                        else {
                                if (summaryview->msg_is_toggled_on) {
                                        summary_select_node
-                                               (summaryview, node, TRUE);
+                                               (summaryview, node, TRUE, FALSE);
                                        if (body_matched) {
                                                messageview_search_string
                                                        (summaryview->messageview,
@@ -361,7 +361,7 @@ static void summary_search_execute(GtkButton *button, gpointer data)
                                        }
                                } else {
                                        summary_select_node
-                                               (summaryview, node, FALSE);
+                                               (summaryview, node, FALSE, FALSE);
                                }
                                break;
                        }
index b0ff2d05b2c0a3eed268e0902051f8e26f5e5ed9..eba2c5c2e60f5ded39ce0f9182d732c3b410782d 100644 (file)
@@ -421,7 +421,7 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/_View/Open in new _window"),
                                        NULL, summary_open_msg, 0, NULL},
        {N_("/_View/_Source"),          NULL, summary_view_source, 0, NULL},
-       {N_("/_View/All _header"),      NULL, summary_show_all_header_cb, 0, NULL},
+       {N_("/_View/All _header"),      NULL, summary_show_all_header_cb, 0, "<ToggleItem>"},
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
        {N_("/_Save as..."),            NULL, summary_save_as,  0, NULL},
        {N_("/_Print..."),              NULL, summary_print,    0, NULL},
@@ -739,7 +739,6 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
 
        summary_clear_list(summaryview);
        summary_set_column_titles(summaryview);
-       summary_set_menu_sensitive(summaryview);
        if (!is_refresh)
                messageview_clear(summaryview->messageview);
 
@@ -879,7 +878,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
                        if (node == NULL && GTK_CLIST(ctree)->row_list != NULL)
                                node = gtk_ctree_node_nth
                                        (ctree, GTK_CLIST(ctree)->rows - 1);
-                       summary_select_node(summaryview, node, FALSE);
+                       summary_select_node(summaryview, node, FALSE, TRUE);
                }
        } else {
                /* select first unread message */
@@ -896,10 +895,10 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
                }       
                if (prefs_common.open_unread_on_enter) {
                        summary_unlock(summaryview);
-                       summary_select_node(summaryview, node, TRUE);
+                       summary_select_node(summaryview, node, TRUE, TRUE);
                        summary_lock(summaryview);
                } else
-                       summary_select_node(summaryview, node, FALSE);
+                       summary_select_node(summaryview, node, FALSE, TRUE);
        }
 
        summary_status_show(summaryview);
@@ -1019,6 +1018,7 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
 {
        GtkItemFactory *ifactory = summaryview->popupfactory;
        SummarySelection selection;
+       GtkWidget *menuitem;
        gboolean sens;
 
        selection = summary_get_selection_type(summaryview);
@@ -1043,7 +1043,7 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
        menu_set_sensitive(ifactory, "/Copy...", TRUE);
        menu_set_sensitive(ifactory, "/Execute", TRUE);
 
-        menu_set_sensitive(ifactory, "/Mark", TRUE);
+       menu_set_sensitive(ifactory, "/Mark", TRUE);
        menu_set_sensitive(ifactory, "/Mark/Mark",   TRUE);
        menu_set_sensitive(ifactory, "/Mark/Unmark", TRUE);
 
@@ -1084,12 +1084,17 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
        else
                sens = FALSE;
        menu_set_sensitive(ifactory, "/Follow-up and reply to", sens);
+       summary_lock(summaryview);
+       menuitem = gtk_item_factory_get_widget(ifactory, "/View/All header");
+       gtk_check_menu_item_set_active
+               (GTK_CHECK_MENU_ITEM(menuitem),
+                summaryview->messageview->textview->show_all_headers);
+       summary_unlock(summaryview);
 }
 
 void summary_select_prev_unread(SummaryView *summaryview)
 {
        GtkCTreeNode *node;
-       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
        node = summary_find_prev_unread_msg(summaryview, summaryview->selected);
 
@@ -1117,16 +1122,10 @@ void summary_select_prev_unread(SummaryView *summaryview)
                node = summary_find_prev_unread_msg(summaryview, NULL);
        }
 
-       if (!node) {
+       if (!node)
                alertpanel_notice(_("No unread messages."));
-       } else {
-               gtkut_ctree_expand_parent_all(ctree, node);
-               gtk_sctree_unselect_all(GTK_SCTREE(ctree));
-               gtk_sctree_select(GTK_SCTREE(ctree), node);
-               if (summaryview->displayed == node)
-                       summaryview->displayed = NULL;
-               summary_display_msg(summaryview, node);
-       }
+       else
+               summary_select_node(summaryview, node, TRUE, FALSE);
 }
 
 void summary_select_next_unread(SummaryView *summaryview)
@@ -1169,20 +1168,13 @@ void summary_select_next_unread(SummaryView *summaryview)
                        return;
        }
 
-       if (node) {
-               gtkut_ctree_expand_parent_all(ctree, node);
-               gtk_sctree_unselect_all(GTK_SCTREE(ctree));
-               gtk_sctree_select(GTK_SCTREE(ctree), node);
-               if (summaryview->displayed == node)
-                       summaryview->displayed = NULL;
-               summary_display_msg(summaryview, node);
-       }
+       if (node)
+               summary_select_node(summaryview, node, TRUE, FALSE);
 }
 
 void summary_select_prev_marked(SummaryView *summaryview)
 {
        GtkCTreeNode *node;
-       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
        node = summary_find_prev_marked_msg(summaryview, summaryview->selected);
 
@@ -1197,22 +1189,15 @@ void summary_select_prev_marked(SummaryView *summaryview)
                node = summary_find_prev_marked_msg(summaryview, NULL);
        }
 
-       if (!node) {
+       if (!node)
                alertpanel_notice(_("No marked messages."));
-       } else {
-               gtkut_ctree_expand_parent_all(ctree, node);
-               gtk_sctree_unselect_all(GTK_SCTREE(ctree));
-               gtk_sctree_select(GTK_SCTREE(ctree), node);
-               if (summaryview->displayed == node)
-                       summaryview->displayed = NULL;
-               summary_display_msg(summaryview, node);
-       }
+       else
+               summary_select_node(summaryview, node, TRUE, FALSE);
 }
 
 void summary_select_next_marked(SummaryView *summaryview)
 {
        GtkCTreeNode *node;
-       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
        node = summary_find_next_marked_msg(summaryview, summaryview->selected);
 
@@ -1227,22 +1212,15 @@ void summary_select_next_marked(SummaryView *summaryview)
                node = summary_find_next_marked_msg(summaryview, NULL);
        }
 
-       if (!node) {
+       if (!node)
                alertpanel_notice(_("No marked messages."));
-       } else {
-               gtkut_ctree_expand_parent_all(ctree, node);
-               gtk_sctree_unselect_all(GTK_SCTREE(ctree));
-               gtk_sctree_select(GTK_SCTREE(ctree), node);
-               if (summaryview->displayed == node)
-                       summaryview->displayed = NULL;
-               summary_display_msg(summaryview, node);
-       }
+       else
+               summary_select_node(summaryview, node, TRUE, FALSE);
 }
 
 void summary_select_prev_labeled(SummaryView *summaryview)
 {
        GtkCTreeNode *node;
-       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
        node = summary_find_prev_labeled_msg(summaryview, summaryview->selected);
 
@@ -1257,22 +1235,15 @@ void summary_select_prev_labeled(SummaryView *summaryview)
                node = summary_find_prev_labeled_msg(summaryview, NULL);
        }
 
-       if (!node) {
+       if (!node)
                alertpanel_notice(_("No labeled messages."));
-       } else {
-               gtkut_ctree_expand_parent_all(ctree, node);
-               gtk_sctree_unselect_all(GTK_SCTREE(ctree));
-               gtk_sctree_select(GTK_SCTREE(ctree), node);
-               if (summaryview->displayed == node)
-                       summaryview->displayed = NULL;
-               summary_display_msg(summaryview, node);
-       }
+       else
+               summary_select_node(summaryview, node, TRUE, FALSE);
 }
 
 void summary_select_next_labeled(SummaryView *summaryview)
 {
        GtkCTreeNode *node;
-       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
        node = summary_find_next_labeled_msg(summaryview, summaryview->selected);
 
@@ -1287,16 +1258,10 @@ void summary_select_next_labeled(SummaryView *summaryview)
                node = summary_find_next_labeled_msg(summaryview, NULL);
        }
 
-       if (!node) {
+       if (!node)
                alertpanel_notice(_("No labeled messages."));
-       } else {
-               gtkut_ctree_expand_parent_all(ctree, node);
-               gtk_sctree_unselect_all(GTK_SCTREE(ctree));
-               gtk_sctree_select(GTK_SCTREE(ctree), node);
-               if (summaryview->displayed == node)
-                       summaryview->displayed = NULL;
-               summary_display_msg(summaryview, node);
-       }
+       else
+               summary_select_node(summaryview, node, TRUE, FALSE);
 }
 
 void summary_select_by_msgnum(SummaryView *summaryview, guint msgnum)
@@ -1304,7 +1269,7 @@ void summary_select_by_msgnum(SummaryView *summaryview, guint msgnum)
        GtkCTreeNode *node;
 
        node = summary_find_msg_by_msgnum(summaryview, msgnum);
-       summary_select_node(summaryview, node, FALSE);
+       summary_select_node(summaryview, node, FALSE, TRUE);
 }
 
 /**
@@ -1312,22 +1277,28 @@ void summary_select_by_msgnum(SummaryView *summaryview, guint msgnum)
  * @summaryview: Summary view.
  * @node: Summary tree node.
  * @display_msg: TRUE to display the selected message.
+ * @do_refresh: TRUE to refresh the widget.
  *
  * Select @node (bringing it into view by scrolling and expanding its
  * thread, if necessary) and unselect all others.  If @display_msg is
  * TRUE, display the corresponding message in the message view.
+ * If @do_refresh is TRUE, the widget is refreshed.
  **/
 void summary_select_node(SummaryView *summaryview, GtkCTreeNode *node,
-                        gboolean display_msg)
+                        gboolean display_msg, gboolean do_refresh)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
        if (node) {
-               GTK_EVENTS_FLUSH();
                gtkut_ctree_expand_parent_all(ctree, node);
-               gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0);
-               gtk_widget_grab_focus(GTK_WIDGET(ctree));
+               if (do_refresh) {
+                       GTK_EVENTS_FLUSH();
+                       gtk_widget_grab_focus(GTK_WIDGET(ctree));
+                       gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0);
+               }
                gtk_sctree_unselect_all(GTK_SCTREE(ctree));
+               if (display_msg && summaryview->displayed == node)
+                       summaryview->displayed = NULL;
                summaryview->display_msg = display_msg;
                gtk_sctree_select(GTK_SCTREE(ctree), node);
        }
@@ -2369,6 +2340,8 @@ static void summary_display_msg_full(SummaryView *summaryview,
                gtk_clist_thaw(GTK_CLIST(ctree));
                summary_status_show(summaryview);
        }
+       summary_set_menu_sensitive(summaryview);
+       main_window_set_toolbar_sensitive(summaryview->mainwin);
 
        summary_unlock(summaryview);
 }
@@ -2376,6 +2349,7 @@ static void summary_display_msg_full(SummaryView *summaryview,
 void summary_display_msg_selected(SummaryView *summaryview,
                                  gboolean all_headers)
 {
+       if (summary_is_locked(summaryview)) return;
        summaryview->displayed = NULL;
        summary_display_msg_full(summaryview, summaryview->selected, FALSE,
                                 all_headers);
@@ -2444,11 +2418,11 @@ void summary_step(SummaryView *summaryview, GtkScrollType type)
                        gtkut_ctree_expand_parent_all(ctree, node);
        }
 
+       if (summaryview->msg_is_toggled_on)
+               summaryview->display_msg = TRUE;
+
        gtk_signal_emit_by_name(GTK_OBJECT(ctree), "scroll_vertical",
                                type, 0.0);
-
-       if (summaryview->msg_is_toggled_on)
-               summary_display_msg(summaryview, summaryview->selected);
 }
 
 static void summary_toggle_view(SummaryView *summaryview)
@@ -2955,7 +2929,8 @@ void summary_delete(SummaryView *summaryview)
                        summary_step(summaryview, GTK_SCROLL_STEP_BACKWARD);
                else
                        summary_select_node(summaryview, node,
-                                           summaryview->msg_is_toggled_on);
+                                           summaryview->msg_is_toggled_on,
+                                           FALSE);
        }
 
        if (prefs_common.immediate_exec || item->stype == F_TRASH)
@@ -4537,12 +4512,12 @@ static void summary_selected(GtkCTree *ctree, GtkCTreeNode *row,
        MsgInfo *msginfo;
 
        summary_status_show(summaryview);
-       summary_set_menu_sensitive(summaryview);
-       main_window_set_toolbar_sensitive(summaryview->mainwin);
 
        if (GTK_CLIST(ctree)->selection &&
             GTK_CLIST(ctree)->selection->next) {
                summaryview->display_msg = FALSE;
+               summary_set_menu_sensitive(summaryview);
+               main_window_set_toolbar_sensitive(summaryview->mainwin);
                return;
        }
 
@@ -4584,10 +4559,13 @@ static void summary_selected(GtkCTree *ctree, GtkCTreeNode *row,
                break;
        }
 
-       if (summaryview->display_msg)
+       if (summaryview->display_msg) {
                summary_display_msg(summaryview, row);
-
-       summaryview->display_msg = FALSE;
+               summaryview->display_msg = FALSE;
+       } else {
+               summary_set_menu_sensitive(summaryview);
+               main_window_set_toolbar_sensitive(summaryview->mainwin);
+       }
 }
 
 static void summary_col_resized(GtkCList *clist, gint column, gint width,
@@ -4613,7 +4591,8 @@ static void summary_execute_cb(SummaryView *summaryview, guint action,
 static void summary_show_all_header_cb(SummaryView *summaryview,
                                       guint action, GtkWidget *widget)
 {
-       summary_display_msg_selected(summaryview, TRUE);
+       summary_display_msg_selected(summaryview,
+                                    GTK_CHECK_MENU_ITEM(widget)->active);
 }
 
 static void summary_add_address_cb(SummaryView *summaryview,
index 61be2228d71c21bc8dbfd79c14174965d2fe196d..9e2e8dd41b6e425fc39afdc3d4a687c7cfee8795 100644 (file)
@@ -190,7 +190,8 @@ void summary_select_by_msgnum         (SummaryView          *summaryview,
 guint summary_get_current_msgnum  (SummaryView         *summaryview);
 void summary_select_node         (SummaryView          *summaryview,
                                   GtkCTreeNode         *node,
-                                  gboolean              display_msg);
+                                  gboolean              display_msg,
+                                  gboolean              do_refresh);
 
 void summary_thread_build        (SummaryView          *summaryview);
 void summary_unthread            (SummaryView          *summaryview);