add Lock/Unlock to summary view popup menu
authorPaul Mangan <paul@claws-mail.org>
Tue, 15 Apr 2003 20:00:23 +0000 (20:00 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 15 Apr 2003 20:00:23 +0000 (20:00 +0000)
ChangeLog.claws
configure.ac
src/summaryview.c
src/summaryview.h

index d223380a323c40c87249b4be90563da03ff8a841..6d3777829fa960bd0e84e0c0703815973c3da951 100644 (file)
@@ -1,3 +1,10 @@
+2003-04-15 [paul]      0.8.11claws92
+
+       * src/summaryview.[ch]
+               add /Mark/Lock and /Mark/Unlock to the pop-up
+               menu. Patch submitted by Ivan Francolin Martinez
+               <ivanfm@users.sourceforge.net>
+
 2003-04-15 [paul]      0.8.11claws91
 
        * sync with 0.8.11cvs24
index 955ec49cb9e36f3eb9da9b264a63fb7b1667d7ef..5c56403f7333dd59e39174cda150296c0ea9ce19 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws91
+EXTRA_VERSION=claws92
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index d48a0f54e9366829248921068ed2e74f0156a7d3..a2fae745bb9cb7686f4fd1f6b7172c25d5947155 100644 (file)
@@ -191,6 +191,8 @@ static void summary_mark_row                (SummaryView            *summaryview,
                                         GtkCTreeNode           *row);
 static void summary_lock_row           (SummaryView            *summaryview,
                                         GtkCTreeNode           *row);
+static void summary_unlock_row         (SummaryView            *summaryview,
+                                        GtkCTreeNode           *row);
 static void summary_mark_row_as_read   (SummaryView            *summaryview,
                                         GtkCTreeNode           *row);
 static void summary_mark_row_as_unread (SummaryView            *summaryview,
@@ -429,6 +431,8 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/_Mark/Mark all read"),    NULL, summary_mark_all_read, 0, NULL},
        {N_("/_Mark/Ignore thread"),    NULL, summary_ignore_thread, 0, NULL},
        {N_("/_Mark/Unignore thread"),  NULL, summary_unignore_thread, 0, NULL},
+       {N_("/_Mark/Lock"),             NULL, summary_msgs_lock, 0, NULL},
+       {N_("/_Mark/Unlock"),           NULL, summary_msgs_unlock, 0, NULL},
        {N_("/Color la_bel"),           NULL, NULL,             0, NULL},
 
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
@@ -1286,6 +1290,8 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
        menu_set_sensitive(ifactory, "/Mark/Mark all read", TRUE);
        menu_set_sensitive(ifactory, "/Mark/Ignore thread",   TRUE);
        menu_set_sensitive(ifactory, "/Mark/Unignore thread", TRUE);
+       menu_set_sensitive(ifactory, "/Mark/Lock", TRUE);
+       menu_set_sensitive(ifactory, "/Mark/Unlock", TRUE);
 
        menu_set_sensitive(ifactory, "/Color label", TRUE);
 
@@ -2763,7 +2769,6 @@ static void summary_mark_row(SummaryView *summaryview, GtkCTreeNode *row)
 
 static void summary_lock_row(SummaryView *summaryview, GtkCTreeNode *row)
 {
-       /* almost verbatim summary_mark_row(); may want a menu action? */
        gboolean changed = FALSE;
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        MsgInfo *msginfo;
@@ -2786,6 +2791,21 @@ static void summary_lock_row(SummaryView *summaryview, GtkCTreeNode *row)
        debug_print("Message %d is locked\n", msginfo->msgnum);
 }
 
+static void summary_unlock_row(SummaryView *summaryview, GtkCTreeNode *row)
+{
+       gboolean changed = FALSE;
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+       MsgInfo *msginfo;
+
+       msginfo = gtk_ctree_node_get_row_data(ctree, row);
+       if (!MSG_IS_LOCKED(msginfo->flags))
+               return;
+       procmsg_msginfo_set_to_folder(msginfo, NULL);
+       procmsg_msginfo_unset_flags(msginfo, MSG_LOCKED, 0);
+       summary_set_row_marks(summaryview, row);
+       debug_print("Message %d is unlocked\n", msginfo->msgnum);
+}
+
 void summary_mark(SummaryView *summaryview)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
@@ -2837,6 +2857,34 @@ void summary_mark_as_read(SummaryView *summaryview)
        summary_status_show(summaryview);
 }
 
+void summary_msgs_lock(SummaryView *summaryview)
+{
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+       GList *cur;
+
+       folder_item_update_freeze();
+       for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
+               summary_lock_row(summaryview,
+                                        GTK_CTREE_NODE(cur->data));
+       folder_item_update_thaw();
+       
+       summary_status_show(summaryview);
+}
+
+void summary_msgs_unlock(SummaryView *summaryview)
+{
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+       GList *cur;
+
+       folder_item_update_freeze();
+       for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
+               summary_unlock_row(summaryview,
+                                  GTK_CTREE_NODE(cur->data));
+       folder_item_update_thaw();
+       
+       summary_status_show(summaryview);
+}
+
 void summary_mark_all_read(SummaryView *summaryview)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
index d2c28801422fa35c403aebe9f3b39fc57e7d8ce5..0ed2b8a93e69252df612b92ea7ac71111ce4d9d2 100644 (file)
@@ -249,6 +249,8 @@ void summary_mark             (SummaryView          *summaryview);
 void summary_unmark              (SummaryView          *summaryview);
 void summary_mark_as_unread      (SummaryView          *summaryview);
 void summary_mark_as_read        (SummaryView          *summaryview);
+void summary_msgs_lock           (SummaryView          *summaryview);
+void summary_msgs_unlock         (SummaryView          *summaryview);
 void summary_mark_all_read       (SummaryView          *summaryview);
 void summary_add_address         (SummaryView          *summaryview);
 void summary_select_all                  (SummaryView          *summaryview);