2006-09-09 [wwp] 2.4.0cvs167
authorTristan Chabredier <wwp@claws-mail.org>
Sat, 9 Sep 2006 18:01:22 +0000 (18:01 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Sat, 9 Sep 2006 18:01:22 +0000 (18:01 +0000)
* src/prefs_filtering.c
fix a minor bug when the enabled status of a filtering/processing
rule always got set to TRUE when replacing this rule. That still
make sense when adding a new rule, but now when replacing, we
don't override the value of 'enabled'.
Also renamed the func prefs_filtering_list_view_get_rule_name()
to prefs_filtering_list_view_get_info() as this function not only
returns the name, but also the account_id and the enabled status.

ChangeLog
PATCHSETS
configure.ac
src/prefs_filtering.c

index 395013800da2f0a5ccb429a39f8bdb4028126497..e1433f1c143f81c2c78810ea6c3dd4e88090bec7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-09-09 [wwp]       2.4.0cvs167
+
+       * src/prefs_filtering.c
+               fix a minor bug when the enabled status of a filtering/processing
+               rule always got set to TRUE when replacing this rule. That still
+               make sense when adding a new rule, but now when replacing, we
+               don't override the value of 'enabled'.
+               Also renamed the func prefs_filtering_list_view_get_rule_name()
+               to prefs_filtering_list_view_get_info() as this function not only
+               returns the name, but also the account_id and the enabled status.
+
 2006-09-09 [mones]     2.4.0cvs166
 
        * manual/glossary.xml
index bb03b414f3869aaf0b5635a7f6b7ce571ea7ca6c..c0dfba2a515ba6e87dee8f534701eda5bb3668d5 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.213.2.113 -r 1.213.2.114 src/folder.c;  cvs diff -u -r 1.1.4.28 -r 1.1.4.29 src/gtk/gtksctree.c;  ) > 2.4.0cvs164.patchset
 ( cvs diff -u -r 1.59.2.45 -r 1.59.2.46 src/prefs_filtering.c;  ) > 2.4.0cvs165.patchset
 ( cvs diff -u -r 1.1.2.13 -r 1.1.2.14 manual/glossary.xml;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/gpl.xml;  cvs diff -u -r 1.1.2.15 -r 1.1.2.16 manual/plugins.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/es/ack.xml;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 manual/es/advanced.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/es/faq.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/es/glossary.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/es/gpl.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/es/handling.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/es/plugins.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/es/starting.xml;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 manual/fr/ack.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/pl/ack.xml;  cvs diff -u -r 1.60.2.33 -r 1.60.2.34 po/es.po;  ) > 2.4.0cvs166.patchset
+( cvs diff -u -r 1.59.2.46 -r 1.59.2.47 src/prefs_filtering.c;  ) > 2.4.0cvs167.patchset
index eb41ea7528d142b109ea7d11e7e50ab6695f0f26..7ad63bd9acda01a5b8a4dab2723b43786f0543b9 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=166
+EXTRA_VERSION=167
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index bfb78f72dcad87419bed6588f572ecb6523624dd..9b1769f6589fb46aa66feff1a0a5bb55d587e229 100644 (file)
@@ -135,7 +135,7 @@ static gint prefs_filtering_list_view_insert_rule   (GtkListStore *list_store,
                                                         gboolean prop);
 static gchar *prefs_filtering_list_view_get_rule       (GtkWidget *list, 
                                                         gint row);
-static void prefs_filtering_list_view_get_rule_name    (GtkWidget *list, 
+static void prefs_filtering_list_view_get_rule_info    (GtkWidget *list, 
                                                         gint row,
                                                         gboolean *enabled,
                                                         gchar **name,
@@ -843,7 +843,7 @@ static void prefs_filtering_set_list(void)
                        gchar *name;
                        gint account_id = 0;
 
-                       prefs_filtering_list_view_get_rule_name(
+                       prefs_filtering_list_view_get_rule_info(
                                        filtering.cond_list_view, row,
                                        &enabled, &name, &account_id);
                        prop = matcher_parser_get_filtering(filtering_str);
@@ -1052,11 +1052,22 @@ static void prefs_filtering_substitute_cb(void)
        gint selected_row = prefs_filtering_get_selected_row
                (filtering.cond_list_view);
        FilteringProp *prop;
+       gboolean enabled;
+       gchar *name;
+       gint account_id;
        
        if (selected_row <= 0)
                return;
 
        prop = prefs_filtering_dialog_to_filtering(TRUE);
+
+       /* prop->emabled is always TRUE here, re-use the value from the selected row 
+          as we don't substitute this value from dialog */
+       prefs_filtering_list_view_get_rule_info(
+                       filtering.cond_list_view, selected_row,
+                       &enabled, &name, &account_id);
+       prop->enabled = enabled;
+
        if (prop == NULL) 
                return;
        prefs_filtering_list_view_set_row(selected_row, prop);
@@ -1380,7 +1391,7 @@ static gchar *prefs_filtering_list_view_get_rule(GtkWidget *list, gint row)
        return result;
 }
 
-static void prefs_filtering_list_view_get_rule_name(GtkWidget *list, gint row,
+static void prefs_filtering_list_view_get_rule_info(GtkWidget *list, gint row,
                                gboolean *enabled, gchar **name, gint *account_id)
 {      
        GtkTreeView *list_view = GTK_TREE_VIEW(list);
@@ -1598,7 +1609,7 @@ static gboolean prefs_filtering_selected(GtkTreeSelection *selector,
                                           -1);
 
                        prop = matcher_parser_get_filtering(filtering_str);
-                       if (prop) { 
+                       if (prop) {
                                prop->name = g_strdup(name);
                                prop->account_id = account_id;
                                prefs_filtering_select_set(prop);