2008-01-08 [wwp] 3.2.0cvs32
authorTristan Chabredier <wwp@claws-mail.org>
Tue, 8 Jan 2008 13:45:41 +0000 (13:45 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Tue, 8 Jan 2008 13:45:41 +0000 (13:45 +0000)
* src/folder.c
* src/folder_item_prefs.c
* src/folder_item_prefs.h
* src/prefs_folder_item.c
It's now possible to disable processing rules when
entering a folder (this adds a new option to the
folder properties dialog).

ChangeLog
PATCHSETS
configure.ac
src/folder.c
src/folder_item_prefs.c
src/folder_item_prefs.h
src/prefs_folder_item.c

index e2719ae1421c8fbb83bf8e1ada47d5cf3becd661..d9df51696aefc93480b2e1dd8a33360dce8ba487 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-01-08 [wwp]       3.2.0cvs32
+
+       * src/folder.c
+       * src/folder_item_prefs.c
+       * src/folder_item_prefs.h
+       * src/prefs_folder_item.c
+               It's now possible to disable processing rules when
+               entering a folder (this adds a new option to the
+               folder properties dialog).
+
 2008-01-08 [wwp]       3.2.0cvs31
 
        * src/common/utils.c
index 82a1c094ab9961fc5e89efa213e66e3527559967..e5f99ddab2034610f38b08cf6251639ff6043a79 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.59.2.62 -r 1.59.2.63 src/prefs_filtering.c;  ) > 3.2.0cvs29.patchset
 ( cvs diff -u -r 1.395.2.347 -r 1.395.2.348 src/summaryview.c;  ) > 3.2.0cvs30.patchset
 ( cvs diff -u -r 1.36.2.131 -r 1.36.2.132 src/common/utils.c;  ) > 3.2.0cvs31.patchset
+( cvs diff -u -r 1.213.2.173 -r 1.213.2.174 src/folder.c;  cvs diff -u -r 1.2.2.25 -r 1.2.2.26 src/folder_item_prefs.c;  cvs diff -u -r 1.2.2.13 -r 1.2.2.14 src/folder_item_prefs.h;  cvs diff -u -r 1.52.2.54 -r 1.52.2.55 src/prefs_folder_item.c;  ) > 3.2.0cvs32.patchset
index 0dcbb700109143334ddfa454f149a56634d6dea2..e03c757907710a3aa0b23a544f5670e3a63b6470 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=2
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=31
+EXTRA_VERSION=32
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 23362597c64fc163d935eb2dba42536b3ddcb66c..711d4dfde8c620abe2ebc36c6dfaae98dfc102a7 100644 (file)
@@ -1799,18 +1799,19 @@ static void folder_item_process_open (FolderItem *item,
        }
        
        /* Processing */
-       buf = g_strdup_printf(_("Processing (%s)...\n"), 
+       if (item->prefs->enable_processing_when_opening) {
+               buf = g_strdup_printf(_("Processing (%s)...\n"), 
                              item->path ? item->path : item->name);
-       g_free(buf);
+               g_free(buf);
 
-       if (before_proc_func)
-               before_proc_func(data);
+               if (before_proc_func)
+                       before_proc_func(data);
 
-       folder_item_apply_processing(item);
-
-       if (after_proc_func)
-               after_proc_func(data);
+               folder_item_apply_processing(item);
 
+               if (after_proc_func)
+                       after_proc_func(data);
+       }
        item->processing_pending = FALSE;
        return; 
 }
index 7e223b6646af6ec88dab563933581771e97c47d0..a6c0726ca67258e8e25edc397d299d49be05b429 100644 (file)
@@ -70,6 +70,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"enable_processing", "FALSE", &tmp_prefs.enable_processing, P_BOOL,
         NULL, NULL, NULL},
+       {"enable_processing_when_opening", "TRUE", &tmp_prefs.enable_processing_when_opening, P_BOOL,
+        NULL, NULL, NULL},
        {"newmailcheck", "TRUE", &tmp_prefs.newmailcheck, P_BOOL,
         NULL, NULL, NULL},
        {"offlinesync", "FALSE", &tmp_prefs.offlinesync, P_BOOL,
@@ -164,6 +166,7 @@ static FolderItemPrefs *folder_item_prefs_clear(FolderItemPrefs *prefs)
        prefs->color = 0;
 
         prefs->enable_processing = TRUE;
+        prefs->enable_processing_when_opening = TRUE;
        prefs->processing = NULL;
 
        prefs->newmailcheck = TRUE;
@@ -216,6 +219,7 @@ void folder_item_prefs_copy_prefs(FolderItem * src, FolderItem * dest)
 
        tmp_prefs.directory                     = g_strdup(src->prefs->directory);
         tmp_prefs.enable_processing             = src->prefs->enable_processing;
+        tmp_prefs.enable_processing_when_opening = src->prefs->enable_processing_when_opening;
        tmp_prefs.newmailcheck                  = src->prefs->newmailcheck;
        tmp_prefs.offlinesync                   = src->prefs->offlinesync;
        tmp_prefs.offlinesync_days              = src->prefs->offlinesync_days;
index 523924526bac12b460d906cbb31329a111ffdfa8..73b3ecd8dd1e385fe1b8d7783d99f05c38a825d2 100644 (file)
@@ -30,7 +30,8 @@ typedef struct _FolderItemPrefs FolderItemPrefs;
 struct _FolderItemPrefs {
        gchar * directory;
 
-        int enable_processing;
+        int enable_processing; /* at start-up */
+        int enable_processing_when_opening;
        GSList * processing;
 
        int newmailcheck;
index 20effe940f9d43707f2171bf0dccb93a3db9b3a5..4d1205277d2f7020e9a590bdd94529eb9be2d659 100644 (file)
@@ -85,6 +85,7 @@ struct _FolderItemGeneralPage
        GtkWidget *entry_folder_chmod;
        GtkWidget *folder_color_btn;
        GtkWidget *checkbtn_enable_processing;
+       GtkWidget *checkbtn_enable_processing_when_opening;
        GtkWidget *checkbtn_newmailcheck;
        GtkWidget *checkbtn_offlinesync;
        GtkWidget *label_offlinesync;
@@ -97,6 +98,7 @@ struct _FolderItemGeneralPage
        GtkWidget *folder_chmod_rec_checkbtn;
        GtkWidget *folder_color_rec_checkbtn;
        GtkWidget *enable_processing_rec_checkbtn;
+       GtkWidget *enable_processing_when_opening_rec_checkbtn;
        GtkWidget *newmailcheck_rec_checkbtn;
        GtkWidget *offlinesync_rec_checkbtn;
 
@@ -214,6 +216,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        GtkWidget *folder_color;
        GtkWidget *folder_color_btn;
        GtkWidget *checkbtn_enable_processing;
+       GtkWidget *checkbtn_enable_processing_when_opening;
        GtkWidget *checkbtn_newmailcheck;
        GtkWidget *checkbtn_offlinesync;
        GtkWidget *label_offlinesync;
@@ -225,6 +228,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        GtkWidget *folder_chmod_rec_checkbtn;
        GtkWidget *folder_color_rec_checkbtn;
        GtkWidget *enable_processing_rec_checkbtn;
+       GtkWidget *enable_processing_when_opening_rec_checkbtn;
        GtkWidget *newmailcheck_rec_checkbtn;
        GtkWidget *offlinesync_rec_checkbtn;
        GtkTooltips *tooltips;
@@ -233,7 +237,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        page->item         = item;
 
        /* Table */
-       table = gtk_table_new(10, 4, FALSE);
+       table = gtk_table_new(11, 4, FALSE);
        gtk_container_set_border_width (GTK_CONTAINER (table), VBOX_BORDER);
        gtk_table_set_row_spacings(GTK_TABLE(table), 4);
        gtk_table_set_col_spacings(GTK_TABLE(table), 4);
@@ -435,6 +439,20 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        
        rowcount++;
 
+       /* Enable processing rules when opening folder */
+       checkbtn_enable_processing_when_opening = gtk_check_button_new_with_label(_("Process when opening"));
+       gtk_table_attach(GTK_TABLE(table), checkbtn_enable_processing_when_opening, 0, 2, 
+                        rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
+
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_processing_when_opening), 
+                                    item->prefs->enable_processing_when_opening);
+
+       enable_processing_when_opening_rec_checkbtn = gtk_check_button_new();
+       gtk_table_attach(GTK_TABLE(table), enable_processing_when_opening_rec_checkbtn, 3, 4, 
+                        rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
+       
+       rowcount++;
+
        /* Check folder for new mail */
        checkbtn_newmailcheck = gtk_check_button_new_with_label(_("Scan for new mail"));
        gtk_tooltips_set_tip(tooltips, checkbtn_newmailcheck,
@@ -550,6 +568,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        page->entry_folder_chmod = entry_folder_chmod;
        page->folder_color_btn = folder_color_btn;
        page->checkbtn_enable_processing = checkbtn_enable_processing;
+       page->checkbtn_enable_processing_when_opening = checkbtn_enable_processing_when_opening;
        page->checkbtn_newmailcheck = checkbtn_newmailcheck;
        page->checkbtn_offlinesync = checkbtn_offlinesync;
        page->label_offlinesync = label_offlinesync;
@@ -561,6 +580,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        page->folder_chmod_rec_checkbtn      = folder_chmod_rec_checkbtn;
        page->folder_color_rec_checkbtn      = folder_color_rec_checkbtn;
        page->enable_processing_rec_checkbtn = enable_processing_rec_checkbtn;
+       page->enable_processing_when_opening_rec_checkbtn = enable_processing_when_opening_rec_checkbtn;
        page->newmailcheck_rec_checkbtn      = newmailcheck_rec_checkbtn;
        page->offlinesync_rec_checkbtn       = offlinesync_rec_checkbtn;
 
@@ -628,6 +648,11 @@ static void general_save_folder_prefs(FolderItem *folder, FolderItemGeneralPage
                        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_enable_processing));
        }
 
+       if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->enable_processing_when_opening_rec_checkbtn))) {
+               prefs->enable_processing_when_opening = 
+                       gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_enable_processing_when_opening));
+       }
+
        if (all ||  gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->newmailcheck_rec_checkbtn))) {
                prefs->newmailcheck = 
                        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_newmailcheck));
@@ -663,6 +688,7 @@ static gboolean general_save_recurse_func(GNode *node, gpointer data)
              gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->folder_chmod_rec_checkbtn)) ||
              gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->folder_color_rec_checkbtn)) ||
              gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->enable_processing_rec_checkbtn)) ||
+             gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->enable_processing_when_opening_rec_checkbtn)) ||
              gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->newmailcheck_rec_checkbtn)) ||
              gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->offlinesync_rec_checkbtn))))
                return TRUE;