2007-08-02 [paul] 2.10.0cvs84
authorPaul Mangan <paul@claws-mail.org>
Thu, 2 Aug 2007 08:33:19 +0000 (08:33 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 2 Aug 2007 08:33:19 +0000 (08:33 +0000)
* src/folderview.c
* src/mainwindow.c
* src/mainwindow.h
enable running folder Processing
rules on demand

ChangeLog
PATCHSETS
configure.ac
src/folderview.c
src/mainwindow.c
src/mainwindow.h

index a14c6087f20b288c98611136beeb8de09d70eec7..5fc0ba8ad1d96929f7f0087ae245cce14e453feb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-08-02 [paul]      2.10.0cvs84
+
+       * src/folderview.c
+       * src/mainwindow.c
+       * src/mainwindow.h
+               enable running folder Processing
+               rules on demand
+
 2007-08-02 [paul]      2.10.0cvs83
 
        * src/textview.c
index 4f556168abd8e3a3be277eed7665490f69d457bf..52f975767e897df737950cd73c96b55ca57bb165 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.5.2.13 -r 1.5.2.14 src/setup.c;  cvs diff -u -r 1.5.2.62 -r 1.5.2.63 src/gtk/gtkutils.c;  ) > 2.10.0cvs81.patchset
 ( cvs diff -u -r 1.39.2.39 -r 1.39.2.40 src/mainwindow.h;  cvs diff -u -r 1.43.2.80 -r 1.43.2.81 src/toolbar.c;  cvs diff -u -r 1.1.14.1 -r 1.1.14.2 src/pixmaps/close.xpm;  cvs diff -u -r 1.1.16.1 -r 1.1.16.2 src/pixmaps/jpilot.xpm;  ) > 2.10.0cvs82.patchset
 ( cvs diff -u -r 1.96.2.179 -r 1.96.2.180 src/textview.c;  ) > 2.10.0cvs83.patchset
+( cvs diff -u -r 1.207.2.170 -r 1.207.2.171 src/folderview.c;  cvs diff -u -r 1.274.2.204 -r 1.274.2.205 src/mainwindow.c;  cvs diff -u -r 1.39.2.40 -r 1.39.2.41 src/mainwindow.h;  ) > 2.10.0cvs84.patchset
index f0bc3c8da145c280749f297a619d3f877648fe47..70ec5de1166496b375169f09c86eee73f72b1045 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=10
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=83
+EXTRA_VERSION=84
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 15bd011bd555966a051c496856bec6fc635072e8..2bfd2c24e2c9d59ba5174f6bb18eb5896748643f 100644 (file)
@@ -237,6 +237,9 @@ static void folderview_send_queue_cb        (FolderView     *folderview,
 static void folderview_search_cb       (FolderView     *folderview,
                                         guint           action,
                                         GtkWidget      *widget);
+static void folderview_run_processing_cb(FolderView    *folderview,
+                                        guint           action,
+                                        GtkWidget      *widget);
 
 static void folderview_property_cb     (FolderView     *folderview,
                                         guint           action,
@@ -289,6 +292,7 @@ static GtkItemFactoryEntry folderview_common_popup_entries[] =
 {
        {N_("/Mark all re_ad"),         NULL, mark_all_read_cb, 0, NULL},
        {"/---",                        NULL, NULL, 0, "<Separator>"},
+       {N_("/Run processing rules"),   NULL, folderview_run_processing_cb, 0, NULL},
        {N_("/_Search folder..."),      NULL, folderview_search_cb, 0, NULL},
        {N_("/_Properties..."),         NULL, folderview_property_cb, 0, NULL},
        {N_("/Process_ing..."),         NULL, folderview_processing_cb, 0, NULL},
@@ -1906,6 +1910,8 @@ static void folderview_set_sens_and_popup_menu(FolderView *folderview, gint row,
        SET_SENS("/Mark all read", item->unread_msgs >= 1);
        SET_SENS("/Search folder...", item->total_msgs >= 1 && 
                 folderview->selected == folderview->opened);
+       SET_SENS("/Run processing rules", item->prefs->processing &&
+                item->total_msgs >= 1);
        SET_SENS("/Properties...", TRUE);
        SET_SENS("/Processing...", item->node->parent != NULL);
        if (item == folder->trash || item == special_trash
@@ -2430,6 +2436,21 @@ static void folderview_search_cb(FolderView *folderview, guint action,
        summary_search(folderview->summaryview);
 }
 
+static void folderview_run_processing_cb(FolderView *folderview, guint action,
+                                GtkWidget *widget)
+{
+       GtkCTree *ctree = GTK_CTREE(folderview->ctree);
+       FolderItem *item;
+
+       if (!folderview->selected) return;
+
+       item = gtk_ctree_node_get_row_data(ctree, folderview->selected);
+       g_return_if_fail(item != NULL);
+       g_return_if_fail(item->folder != NULL);
+
+       folder_item_apply_processing(item);
+}
+
 static void folderview_property_cb(FolderView *folderview, guint action,
                                   GtkWidget *widget)
 {
index bd4f762abab730ed363c8ca804448dc6fd4f1d52..ff8a1db5875c818c604f961cdf899452fe88ec7c 100644 (file)
@@ -339,6 +339,9 @@ static void delete_duplicated_all_cb (MainWindow    *mainwin,
 static void filter_cb           (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
+static void process_cb          (MainWindow    *mainwin,
+                                 guint          action,
+                                 GtkWidget     *widget);
 static void execute_summary_cb  (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
@@ -849,6 +852,8 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                NULL, filter_cb, 0, NULL},
        {N_("/_Tools/Filter _selected messages"),
                                                NULL, filter_cb, 1, NULL},
+       {N_("/_Tools/Run folder processing rules"),
+                                               NULL, process_cb, 0, NULL},
        {N_("/_Tools/_Create filter rule"),     NULL, NULL, 0, "<Branch>"},
        {N_("/_Tools/_Create filter rule/_Automatically"),
                                                NULL, create_filter_cb, FILTER_BY_AUTO, NULL},
@@ -2502,6 +2507,9 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
        if (any_folder_want_synchronise())
                state |= M_WANT_SYNC;
 
+       if (item && item->prefs->processing && selection != SUMMARY_NONE)
+               state |= M_HAVE_PROCESSING;
+
        for ( ; account_list != NULL; account_list = account_list->next) {
                if (((PrefsAccount*)account_list->data)->protocol == A_NNTP) {
                        state |= M_HAVE_NEWS_ACCOUNT;
@@ -2613,6 +2621,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                                                       , M_TARGET_EXIST},
                {"/Tools/Filter all messages in folder", M_MSG_EXIST|M_EXEC},
                {"/Tools/Filter selected messages"     , M_TARGET_EXIST|M_EXEC},
+               {"/Tools/Run folder processing rules"  , M_HAVE_PROCESSING},
                {"/Tools/Create filter rule"           , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
                {"/Tools/Create processing rule"       , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
                {"/Tools/List URLs..."                 , M_TARGET_EXIST},
@@ -3939,6 +3948,14 @@ static void filter_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
        summary_filter(mainwin->summaryview, (gboolean)action);
 }
 
+static void process_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
+{
+       FolderItem *item = mainwin->summaryview->folder_item;   
+       g_return_if_fail(item != NULL);
+
+       folder_item_apply_processing(item);     
+}
+
 static void execute_summary_cb(MainWindow *mainwin, guint action,
                               GtkWidget *widget)
 {
index 18c3b18178633dd0d430e7eef738ca0040f69c9c..268979d11a5cc910754e4b97c0a6951120a380d4 100644 (file)
@@ -58,7 +58,8 @@ typedef enum
        M_ACTIONS_EXIST       = 1 << 17,
        M_HAVE_QUEUED_MAILS   = 1 << 18,
        M_WANT_SYNC           = 1 << 19,
-       M_TAGS_EXIST          = 1 << 20
+       M_TAGS_EXIST          = 1 << 20,
+       M_HAVE_PROCESSING     = 1 << 21
 } SensitiveCond;
 
 typedef enum