2006-03-24 [colin] 2.0.0cvs168
authorColin Leroy <colin@colino.net>
Fri, 24 Mar 2006 18:28:37 +0000 (18:28 +0000)
committerColin Leroy <colin@colino.net>
Fri, 24 Mar 2006 18:28:37 +0000 (18:28 +0000)
* src/action.c
* src/summaryview.c
* src/summaryview.h
Update message cache after action
Patch by H. Merijn Brand
* src/prefs_msg_colors.c
Factorize label
Patch by Fabien Vantard
* src/plugins/spamassassin/spamassassin_gtk.c
Remove useless translation
Patch by Fabien Vantard

ChangeLog
PATCHSETS
configure.ac
src/action.c
src/plugins/spamassassin/spamassassin_gtk.c
src/prefs_msg_colors.c
src/summaryview.c
src/summaryview.h

index c80f50fd4b4563985417035682217afd13691db6..1ef1f20adff9db231e3264fdde9c2a71f46da0f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-03-24 [colin]     2.0.0cvs168
+
+       * src/action.c
+       * src/summaryview.c
+       * src/summaryview.h
+               Update message cache after action
+               Patch by H. Merijn Brand
+       * src/prefs_msg_colors.c
+               Factorize label 
+               Patch by Fabien Vantard
+       * src/plugins/spamassassin/spamassassin_gtk.c
+               Remove useless translation
+               Patch by Fabien Vantard
+
 2006-03-23 [colin]     2.0.0cvs167
 
        * src/common/ssl.c
index 65a9c098955f6782ccdcc15b982f765bfa26c582..135d30a2779dbbe87280b06392cf410388c31abf 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.36.2.59 -r 1.36.2.60 src/common/utils.c;  ) > 2.0.0cvs165.patchset
 ( cvs diff -u -r 1.395.2.185 -r 1.395.2.186 src/summaryview.c;  cvs diff -u -r 1.5.2.17 -r 1.5.2.18 src/gtk/description_window.c;  ) > 2.0.0cvs166.patchset
 ( cvs diff -u -r 1.9.2.12 -r 1.9.2.13 src/common/ssl.c;  ) > 2.0.0cvs167.patchset
+( cvs diff -u -r 1.12.2.32 -r 1.12.2.33 src/action.c;  cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/prefs_msg_colors.c;  cvs diff -u -r 1.395.2.186 -r 1.395.2.187 src/summaryview.c;  cvs diff -u -r 1.68.2.20 -r 1.68.2.21 src/summaryview.h;  cvs diff -u -r 1.23.2.26 -r 1.23.2.27 src/plugins/spamassassin/spamassassin_gtk.c;  ) > 2.0.0cvs168.patchset
index f05af6333a308efd47b0743937497b60e6f29c81..e1c5cdd45955426b37729f639638ae4894d53666 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=167
+EXTRA_VERSION=168
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index a061aea2a7836060c2e476b0fb19168105588cd5..f118b1ecc1256902f9235c45f33cad8ae2ea692b 100644 (file)
@@ -54,6 +54,7 @@
 #include "textview.h"
 #include "matcher_parser.h" /* CLAWS */
 #include "filtering.h"
+#include "procheader.h"
 
 typedef struct _Children               Children;
 typedef struct _ChildInfo              ChildInfo;
@@ -101,6 +102,8 @@ struct _ChildInfo
        GString         *output;
        void (*callback)(void *data);
        void *data;
+
+       GSList          *msginfo_list;
 };
 
 static void action_update_menu         (GtkItemFactory *ifactory,
@@ -749,6 +752,8 @@ static gboolean execute_actions(gchar *action, GSList *msg_list,
                                break;
                        }
                        if ((child_info = fork_child(cmd, msg_str, children))) {
+                               /* Pass msginfo to catch_status () */
+                               child_info->msginfo_list = g_slist_append (NULL, msginfo);
                                children_list = g_slist_append(children_list,
                                                               child_info);
                        }
@@ -759,8 +764,9 @@ static gboolean execute_actions(gchar *action, GSList *msg_list,
                                       user_str, user_hidden_str, sel_str);
                if (cmd) {
                        if ((child_info = fork_child(cmd, msg_str, children))) {
+                               child_info->msginfo_list = g_slist_copy (msg_list);
                                children_list = g_slist_append(children_list,
-                                                              child_info);
+                                                               child_info);
                        }
                        g_free(cmd);
                } else
@@ -1330,6 +1336,49 @@ static void catch_status(gpointer data, gint source, GdkInputCondition cond)
        childinfo_close_pipes(child_info);
        child_info->pid = 0;
 
+       if (child_info->children->action_type & (ACTION_SINGLE | ACTION_MULTIPLE)
+           && child_info->msginfo_list) {
+       /* Actions on message *files* might change size and
+       * time stamp, and thus invalidate the cache */
+       SummaryView *summaryview  = NULL;
+       GSList      *cur;
+       MsgInfo     *msginfo, *nmi;     /* newmsginfo */
+       char        *file;
+
+       if (mainwindow_get_mainwindow ())
+               summaryview = mainwindow_get_mainwindow ()->summaryview;
+       for (cur = child_info->msginfo_list; cur; cur = cur->next) {
+               msginfo = (MsgInfo *)cur->data;
+               if (!(msginfo && /* Stuff used valid? */
+                   msginfo->folder && msginfo->folder->cache)) 
+                       continue;
+               file = procmsg_get_message_file_path (msginfo);
+               if (!file) 
+                       continue;
+               nmi = procheader_parse_file (file, msginfo->flags, FALSE, FALSE);
+               if (!nmi) 
+                       continue; /* Deleted? */
+               if (msginfo->mtime != nmi->mtime || msginfo->size != nmi->size) {
+                       msginfo->mtime  = nmi->mtime;
+                       msginfo->size   = nmi->size;
+                       msgcache_update_msg (msginfo->folder->cache, msginfo);
+               }
+               procmsg_msginfo_free (nmi);
+
+               /* refresh the message display, but only if this message is still
+               * in focus */
+               if (summaryview
+                   && summaryview->displayed
+                   && summaryview->folder_item == msginfo->folder
+                   && summary_get_msgnum (summaryview, summaryview->displayed) == msginfo->msgnum) {
+                       summary_show (summaryview, summaryview->folder_item);
+                       summary_select_node (summaryview, summaryview->displayed, TRUE, TRUE);
+               }
+       }
+       g_slist_free (child_info->msginfo_list);
+       child_info->msginfo_list = NULL;
+       }
+
        wait_for_children(child_info->children);
 }
        
index 84ddacbc2f0278ec53366f77d28a7a99d8124ec0..d4a6417fe79aa76db5651c8d4f35e50b8ddbe7b1 100644 (file)
@@ -300,7 +300,7 @@ static void spamassassin_create_widget_func(PrefsPage * _page,
        gtk_tooltips_set_tip(tooltips, spamd_hostname_entry,
                        _("Hostname or IP address of spamd server"), NULL);
 
-       spamd_colon_label = gtk_label_new(_(":"));
+       spamd_colon_label = gtk_label_new(":");
        gtk_widget_show(spamd_colon_label);
        gtk_box_pack_start(GTK_BOX(hbox_spamd), spamd_colon_label, FALSE, FALSE, 0);
 
index 3f527c62ea296147c45ebfd3aa444adac67745e4..206cdaf980ae5c4916900c2126b3ada63006025b 100644 (file)
@@ -286,7 +286,7 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_box_pack_start (GTK_BOX (vbox_custom_colors), hbox_reset_custom_colors,
                FALSE, TRUE, 0);
 
-       reset_custom_colors_btn = gtk_button_new_with_label (_(" Reset to defaults "));
+       reset_custom_colors_btn = gtk_button_new_with_label (_(" Use default "));
        gtk_widget_show (reset_custom_colors_btn);
        gtk_box_pack_start (GTK_BOX (hbox_reset_custom_colors), reset_custom_colors_btn,
                FALSE, FALSE, 0);
index 21207d457a3198d7219a862476899629fa5dcb68..2427be3654a384ceb2612d5606a50f4b22af1eb6 100644 (file)
@@ -140,14 +140,14 @@ static void summary_set_marks_func        (GtkCTree               *ctree,
                                         GtkCTreeNode           *node,
                                         gpointer                data);
 
-void summary_set_menu_sensitive        (SummaryView            *summaryview);
+void  summary_set_menu_sensitive       (SummaryView            *summaryview);
+guint summary_get_msgnum               (SummaryView            *summaryview,
+                                        GtkCTreeNode           *node);
+
 
 static void summary_set_hide_read_msgs_menu (SummaryView *summaryview,
                                             guint action);
 
-static guint summary_get_msgnum                (SummaryView            *summaryview,
-                                        GtkCTreeNode           *node);
-
 static GtkCTreeNode *summary_find_prev_msg
                                        (SummaryView            *summaryview,
                                         GtkCTreeNode           *current_node);
@@ -1670,7 +1670,7 @@ void summary_select_node(SummaryView *summaryview, GtkCTreeNode *node,
        }
 }
 
-static guint summary_get_msgnum(SummaryView *summaryview, GtkCTreeNode *node)
+guint summary_get_msgnum(SummaryView *summaryview, GtkCTreeNode *node)
 {
        GtkCTree *ctree =NULL;
        MsgInfo *msginfo;
index c3af27e946c02ff313e4adbecfa36cc2df09f754..2d556b3d7d2c4c3df5e27a7241db9c0a31d85ee3 100644 (file)
@@ -234,6 +234,8 @@ gboolean summary_step                 (SummaryView          *summaryview,
                                   GtkScrollType         type);
 void summary_toggle_view         (SummaryView          *summaryview);
 void summary_set_marks_selected          (SummaryView          *summaryview);
+guint summary_get_msgnum         (SummaryView          *summaryview,
+                                  GtkCTreeNode         *node);
 
 void summary_move_selected_to    (SummaryView          *summaryview,
                                   FolderItem           *to_folder);