add ability to 'Select thread'
authorPaul Mangan <paul@claws-mail.org>
Thu, 28 Feb 2002 11:58:02 +0000 (11:58 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 28 Feb 2002 11:58:02 +0000 (11:58 +0000)
AUTHORS
ChangeLog.claws
configure.in
src/mainwindow.c
src/summaryview.c
src/summaryview.h

diff --git a/AUTHORS b/AUTHORS
index dace2f67eb1261ddfc49c6e917824a27c0509dce..128b7a1a8cb82ac69bf7e5d2617df20b2cf8dc4d 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -120,3 +120,4 @@ contributors (beside the above; based on Changelog)
        Bob Forsman
        Ville Skytt√§
        Fredrik Olofsson
+       Colin Leroy
index 2dcfde3099a403834cd435114a56f863b567a4d8..660ea65e053ca1226028b4609938e57f1d134c36 100644 (file)
@@ -1,3 +1,12 @@
+2002-02-28 [paul]      0.7.2claws21
+
+       * src/mainwindow.c
+         src/summaryview.[ch]
+               add ability to 'Select thread'
+               combines Melvin's "Select thread's head" patch (#510907)
+               with Colin Leroy's <colin@colino.net> "Select whole thread" 
+               patch (#518514) 
+
 2002-02-28 [paul]      0.7.2claws20
 
        * src/mimeview.c
@@ -40,7 +49,7 @@
                  not displayed
 
        * src/mainwindow.c
-               "View/Folder Tree" becomes "View/Separate Folder View"
+               "View/Folder Tree" becomes "View/Separate Folder Tree"
                "View/Message View" becomes "View/Separate Message View"
                because its less ambiguous.
 
index e3ab4f8a973a6174f6c70e9a76ba8e3c16ac47c2..d7439f82521d0a92e750ee664fcfc27409bbdef8 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws20
+EXTRA_VERSION=claws21
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index ca5bf68cae9e58c7e1e0ab97ef419feab8a80be8..d3f0863e42bb8b0758ae1c07e79860a96d9d144d 100644 (file)
@@ -394,6 +394,9 @@ static void copy_cb          (MainWindow    *mainwin,
 static void allsel_cb           (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
+static void selthread_cb        (MainWindow    *mainwin,
+                                 guint          action,
+                                 GtkWidget     *widget);
 
 static void create_filter_cb    (MainWindow    *mainwin,
                                  guint          action,
@@ -474,6 +477,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Edit"),                          NULL, NULL, 0, "<Branch>"},
        {N_("/_Edit/_Copy"),                    "<control>C", copy_cb, 0, NULL},
        {N_("/_Edit/Select _all"),              "<control>A", allsel_cb, 0, NULL},
+       {N_("/_Edit/Select thread"),            "<control>Z", selthread_cb, 0, NULL},
        {N_("/_Edit/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_Edit/_Find in current message..."),
                                                "<control>F", search_cb, 0, NULL},
@@ -1535,6 +1539,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"/File/Exit" , M_UNLOCKED},
 
                {"/Edit/Actions"                   , M_MSG_EXIST},
+               {"/Edit/Select thread"             , M_SINGLE_TARGET_EXIST},
                {"/View/Sort"                      , M_MSG_EXIST},
                {"/View/Thread view"               , M_EXEC},
                {"/View/Hide read messages"        , M_HIDE_READ_MSG},
@@ -2869,6 +2874,12 @@ static void allsel_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
                messageview_select_all(mainwin->messageview);
 }
 
+static void selthread_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
+{
+       if (mainwin->summaryview->msg_is_toggled_on)
+               summary_select_thread(mainwin->summaryview);
+}
+
 static void create_filter_cb(MainWindow *mainwin, guint action,
                             GtkWidget *widget)
 {
index f976f2d7cfadc51ed843d56a28d80885224605ba..d4d56c109b10d4dc943033c405e61d226f6b8b27 100644 (file)
@@ -396,6 +396,9 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
        {N_("/Re-_edit"),               NULL, summary_reedit,   0, NULL},
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
+       {N_("/Select _thread"),         NULL, summary_select_thread, 0, NULL},
+       {N_("/Select _all"),            NULL, summary_select_all, 0, NULL},
+       {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
        {N_("/M_ove..."),               NULL, summary_move_to,  0, NULL},
        {N_("/_Copy..."),               NULL, summary_copy_to,  0, NULL},
        {N_("/_Delete"),                NULL, summary_delete,   0, NULL},
@@ -424,8 +427,6 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
        {N_("/_Save as..."),            NULL, summary_save_as,  0, NULL},
        {N_("/_Print..."),              NULL, summary_print,    0, NULL},
-       {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
-       {N_("/Select _all"),            NULL, summary_select_all, 0, NULL}
 };
 
 static const gchar *const col_label[N_SUMMARY_COLS] = {
@@ -1042,7 +1043,8 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
                menu_set_sensitive(ifactory, "/Move...", TRUE);
                menu_set_sensitive(ifactory, "/Delete", TRUE);
        }
-
+       menu_set_sensitive(ifactory, "/Select thread", TRUE);
+       menu_set_sensitive(ifactory, "/Select all", TRUE);
        menu_set_sensitive(ifactory, "/Copy...", TRUE);
        menu_set_sensitive(ifactory, "/Execute", TRUE);
 
@@ -1079,8 +1081,6 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
        menu_set_sensitive(ifactory, "/Save as...", sens);
        menu_set_sensitive(ifactory, "/Print...",   TRUE);
 
-       menu_set_sensitive(ifactory, "/Select all", TRUE);
-
        if (summaryview->folder_item->folder->account)
                sens = summaryview->folder_item->folder->account->protocol
                        == A_NNTP;
@@ -4380,6 +4380,7 @@ void summary_set_column_order(SummaryView *summaryview)
 }
 
 
+
 /* callback functions */
 
 static void summary_toggle_view_cb(GtkWidget *button,
@@ -4841,6 +4842,37 @@ static gint summary_cmp_by_locked(GtkCList *clist,
        return MSG_IS_LOCKED(msginfo1->flags) - MSG_IS_LOCKED(msginfo2->flags);
 }
 
+static void summary_select_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpointer data)
+{
+       SummaryView *summaryview = (SummaryView *) data;
+       MsgInfo *msginfo;
+
+       msginfo = gtk_ctree_node_get_row_data(ctree, row);
+       gtk_ctree_select(GTK_CTREE(ctree), row);        
+       debug_print(_("Message %d selected\n"),
+           msginfo->msgnum);
+}
+
+/* select current thread */
+void summary_select_thread(SummaryView *summaryview)
+{
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+       GtkCTreeNode *node = summaryview->selected;
+       GList *cur;
+
+       while (GTK_CTREE_ROW(node)->parent != NULL)
+               node = GTK_CTREE_ROW(node)->parent;
+
+       if (node && node != summaryview->selected)
+               summary_select_node(summaryview, node, TRUE, FALSE);
+
+       for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next) {
+               gtk_ctree_pre_recursive(ctree, GTK_CTREE_NODE(cur->data), GTK_CTREE_FUNC(summary_select_thread_func), summaryview);
+       }
+       
+       summary_status_show(summaryview);
+}
+
 static void summary_ignore_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpointer data)
 {
        SummaryView *summaryview = (SummaryView *) data;
@@ -4860,6 +4892,7 @@ static void summary_ignore_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpoin
            msginfo->msgnum);
 }
 
+
 static void summary_ignore_thread(SummaryView *summaryview)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
@@ -4903,7 +4936,6 @@ static void summary_unignore_thread(SummaryView *summaryview)
        summary_status_show(summaryview);
 }
 
-
 static gboolean processing_apply_func(GNode *node, gpointer data)
 {
        FolderItem *item;
index 9e2e8dd41b6e425fc39afdc3d4a687c7cfee8795..61ad9584e6ee70b9b22e20e0ea0fc172a143068b 100644 (file)
@@ -241,7 +241,7 @@ void summary_mark_all_read    (SummaryView          *summaryview);
 void summary_add_address         (SummaryView          *summaryview);
 void summary_select_all                  (SummaryView          *summaryview);
 void summary_unselect_all        (SummaryView          *summaryview);
-
+void summary_select_thread       (SummaryView          *summaryview);
 void summary_reply               (SummaryView          *summaryview,
                                   ComposeMode           mode);