2006-09-02 [wwp] 2.4.0cvs131
authorTristan Chabredier <wwp@claws-mail.org>
Sat, 2 Sep 2006 14:35:55 +0000 (14:35 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Sat, 2 Sep 2006 14:35:55 +0000 (14:35 +0000)
* src/prefs_filtering.c

ChangeLog
PATCHSETS
configure.ac
src/prefs_filtering.c

index fdc0022..494948f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-09-02 [wwp]       2.4.0cvs131
+
+       * src/prefs_filtering.c
+
 2006-09-02 [colin]     2.4.0cvs130
 
        * src/gtk/logwindow.c
index bc50e78..090c0e4 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.179.2.130 -r 1.179.2.131 src/imap.c;  cvs diff -u -r 1.13.2.17 -r 1.13.2.18 src/import.c;  cvs diff -u -r 1.149.2.57 -r 1.149.2.58 src/inc.c;  cvs diff -u -r 1.274.2.143 -r 1.274.2.144 src/mainwindow.c;  cvs diff -u -r 1.39.2.22 -r 1.39.2.23 src/mainwindow.h;  cvs diff -u -r 1.28.2.25 -r 1.28.2.26 src/mbox.c;  cvs diff -u -r 1.3.2.6 -r 1.3.2.7 src/mbox.h;  ) > 2.4.0cvs128.patchset
 ( cvs diff -u -r 1.213.2.112 -r 1.213.2.113 src/folder.c;  cvs diff -u -r 1.274.2.144 -r 1.274.2.145 src/mainwindow.c;  cvs diff -u -r 1.1.4.18 -r 1.1.4.19 src/gtk/logwindow.c;  cvs diff -u -r 1.1.4.5 -r 1.1.4.6 src/gtk/logwindow.h;  ) > 2.4.0cvs129.patchset
 ( cvs diff -u -r 1.1.4.19 -r 1.1.4.20 src/gtk/logwindow.c;  cvs diff -u -r 1.1.4.6 -r 1.1.4.7 src/gtk/logwindow.h;  ) > 2.4.0cvs130.patchset
+( cvs diff -u -r 1.59.2.40 -r 1.59.2.41 src/prefs_filtering.c;  ) > 2.4.0cvs131.patchset
index d15c86a..dd692b3 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=130
+EXTRA_VERSION=131
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 2e437a6..710d01d 100644 (file)
@@ -59,7 +59,8 @@
 enum {
        PREFS_FILTERING_ENABLED,
        PREFS_FILTERING_NAME,
-       PREFS_FILTERING_ACCOUNT,
+       PREFS_FILTERING_ACCOUNT_ID,
+       PREFS_FILTERING_ACCOUNT_NAME,
        PREFS_FILTERING_RULE,
        PREFS_FILTERING_PROP,
        N_PREFS_FILTERING_COLUMNS
@@ -78,6 +79,8 @@ struct _Filtering {
        GtkWidget *action_entry;
 
        GtkWidget *cond_list_view;
+
+       GtkTreeViewColumn *account_name_column;
 };
 
 typedef struct _Filtering Filtering;
@@ -171,6 +174,9 @@ void prefs_filtering_open(GSList ** p_processing,
                prefs_filtering_account_option_menu_populate();
        }
 
+       gtk_tree_view_column_set_visible(filtering.account_name_column,
+                                                                        per_account_filtering);
+
        manage_window_set_transient(GTK_WINDOW(filtering.window));
        gtk_widget_grab_focus(filtering.ok_btn);
        
@@ -1268,6 +1274,7 @@ static GtkListStore* prefs_filtering_create_data_store(void)
                                  G_TYPE_STRING,
                                  G_TYPE_INT,
                                  G_TYPE_STRING,
+                                 G_TYPE_STRING,
                                  G_TYPE_BOOLEAN,
                                 -1);
 }
@@ -1298,6 +1305,7 @@ static gint prefs_filtering_list_view_insert_rule(GtkListStore *list_store,
                                                  gboolean prop) 
 {
        GtkTreeIter iter;
+       gchar *account_name;
 
        /* check if valid row at all */
        if (row >= 0) {
@@ -1306,13 +1314,20 @@ static gint prefs_filtering_list_view_insert_rule(GtkListStore *list_store,
                        row = -1;                                                  
        }
 
+       if (account_id > 0) {
+               account_name = account_find_from_id(account_id)->account_name;
+       } else {
+               account_name = (gchar *)Q_("Filtering Account Menu|All");
+       }
+
        if (row < 0) {
                /* append new */
                gtk_list_store_append(list_store, &iter);
                gtk_list_store_set(list_store, &iter, 
                                   PREFS_FILTERING_ENABLED, enabled,
                                   PREFS_FILTERING_NAME, name,
-                                  PREFS_FILTERING_ACCOUNT, account_id,
+                                  PREFS_FILTERING_ACCOUNT_ID, account_id,
+                                  PREFS_FILTERING_ACCOUNT_NAME, account_name,
                                   PREFS_FILTERING_RULE, rule,
                                   PREFS_FILTERING_PROP, prop,
                                   -1);
@@ -1323,7 +1338,8 @@ static gint prefs_filtering_list_view_insert_rule(GtkListStore *list_store,
                gtk_list_store_set(list_store, &iter, 
                                   PREFS_FILTERING_ENABLED, enabled,
                                   PREFS_FILTERING_NAME, name,
-                                  PREFS_FILTERING_ACCOUNT, account_id,
+                                  PREFS_FILTERING_ACCOUNT_ID, account_id,
+                                  PREFS_FILTERING_ACCOUNT_NAME, account_name,
                                   PREFS_FILTERING_RULE, rule,
                                   -1);
                return row;                                
@@ -1364,7 +1380,7 @@ static void prefs_filtering_list_view_get_rule_name(GtkWidget *list, gint row,
                gtk_tree_model_get(model, &iter, 
                                   PREFS_FILTERING_ENABLED, enabled,
                                   PREFS_FILTERING_NAME, name,
-                                  PREFS_FILTERING_ACCOUNT, account_id,
+                                  PREFS_FILTERING_ACCOUNT_ID, account_id,
                                   -1);
        }
 }
@@ -1442,6 +1458,17 @@ static void prefs_filtering_create_list_view_columns(GtkWidget *list_view)
                 NULL);
        gtk_tree_view_append_column(GTK_TREE_VIEW(list_view), column);
        gtk_tree_view_column_set_resizable(column, TRUE);
+
+       renderer = gtk_cell_renderer_text_new();
+       column = gtk_tree_view_column_new_with_attributes
+               (_("Account"),
+                renderer,
+                "text", PREFS_FILTERING_ACCOUNT_NAME,
+                NULL);
+       gtk_tree_view_append_column(GTK_TREE_VIEW(list_view), column);
+       gtk_tree_view_column_set_resizable(column, TRUE);
+
+       filtering.account_name_column = column;
                
        renderer = gtk_cell_renderer_text_new();
        column = gtk_tree_view_column_new_with_attributes
@@ -1552,10 +1579,7 @@ static gboolean prefs_filtering_selected(GtkTreeSelection *selector,
                                           PREFS_FILTERING_NAME, &name,
                                           -1);
                        gtk_tree_model_get(model, &iter,
-                                          PREFS_FILTERING_ACCOUNT, &account_id,
-                                          -1);
-                       gtk_tree_model_get(model, &iter,
-                                          PREFS_FILTERING_ACCOUNT, &account_id,
+                                          PREFS_FILTERING_ACCOUNT_ID, &account_id,
                                           -1);
 
                        prop = matcher_parser_get_filtering(filtering_str);