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 dace2f6..128b7a1 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 2dcfde3..660ea65 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 e3ab4f8..d7439f8 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 ca5bf68..d3f0863 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 f976f2d..d4d56c1 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 9e2e8dd..61ad958 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);