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
GtkWidget *action_entry;
GtkWidget *cond_list_view;
+
+ GtkTreeViewColumn *account_name_column;
};
typedef struct _Filtering Filtering;
static gint prefs_filtering_list_view_insert_rule (GtkListStore *list_store,
gint row,
gboolean enabled,
- const gchar *name,
+ const gchar *name,
gint account_id,
+ const gchar *account_name,
const gchar *rule,
gboolean prop);
static gchar *prefs_filtering_list_view_get_rule (GtkWidget *list,
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);
accounts = account_get_list();
- g_return_val_if_fail(accounts != NULL, NULL);
+ g_return_if_fail(accounts != NULL);
COMBOBOX_ADD(filtering.account_combobox_list, Q_("Filtering Account Menu|All"), 0);
for (; accounts != NULL; accounts = accounts->next) {
gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2);
table = gtk_table_new(3, 4, FALSE);
+ gtk_table_set_row_spacings (GTK_TABLE (table), VSPACING_NARROW_2);
+ gtk_table_set_col_spacings (GTK_TABLE (table), 4);
+ gtk_table_set_col_spacing (GTK_TABLE (table), 2, 0);
gtk_widget_show(table);
gtk_box_pack_start (GTK_BOX (vbox1), table, TRUE, TRUE, 0);
-
- name_label = gtk_label_new (_("Name: "));
+ name_label = gtk_label_new (_("Name"));
gtk_widget_show (name_label);
gtk_misc_set_alignment (GTK_MISC (name_label), 1, 0.5);
gtk_table_attach (GTK_TABLE (table), name_label, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- account_label = gtk_label_new (_("Account:"));
+ account_label = gtk_label_new (_("Account"));
gtk_widget_show (account_label);
gtk_misc_set_alignment (GTK_MISC (account_label), 1, 0.5);
gtk_table_attach (GTK_TABLE (table), account_label, 0, 1, 1, 2,
(GtkAttachOptions) (0), 0, 0);
combobox_select_by_data(GTK_COMBO_BOX(filtering.account_combobox), 0);
- cond_label = gtk_label_new (_("Condition: "));
+ cond_label = gtk_label_new (_("Condition"));
gtk_widget_show (cond_label);
gtk_misc_set_alignment (GTK_MISC (cond_label), 1, 0.5);
gtk_table_attach (GTK_TABLE (table), cond_label, 0, 1, 2, 3,
G_CALLBACK(prefs_filtering_condition_define),
NULL);
- action_label = gtk_label_new (_("Action: "));
+ action_label = gtk_label_new (_("Action"));
gtk_widget_show (action_label);
gtk_misc_set_alignment (GTK_MISC (action_label), 1, 0.5);
gtk_table_attach (GTK_TABLE (table), action_label, 0, 1, 3, 4,
_("(New)"),
0,
_("(New)"),
+ _("(New)"),
FALSE);
prefs_filtering = *p_processing_list;
for(cur = prefs_filtering ; cur != NULL ; cur = g_slist_next(cur)) {
FilteringProp * prop = (FilteringProp *) cur->data;
+ gchar *account_name = NULL;
+
+ if (prop->account_id > 0) {
+ PrefsAccount *ac_prefs = account_find_from_id(prop->account_id);
+
+ if (ac_prefs)
+ account_name = ac_prefs->account_name;
+ }
+ if (account_name == NULL)
+ account_name = (gchar *)Q_("Filtering Account Menu|All");
cond_str = filteringprop_to_string(prop);
subst_char(cond_str, '\t', ':');
prop->enabled,
prop->name,
prop->account_id,
+ account_name,
cond_str, TRUE);
g_free(cond_str);
GtkListStore *list_store;
gchar *name = NULL;
gint account_id = 0;
+ gchar *account_name = (gchar *)Q_("Filtering Account Menu|All");
gboolean enabled = TRUE;
str = filteringprop_to_string(prop);
if (prop->name)
name = prop->name;
account_id = prop->account_id;
+ if (account_id > 0)
+ account_name = account_find_from_id(account_id)->account_name;
enabled = prop->enabled;
}
enabled,
name,
account_id,
+ account_name,
str,
prop != NULL);
G_TYPE_STRING,
G_TYPE_INT,
G_TYPE_STRING,
+ G_TYPE_STRING,
G_TYPE_BOOLEAN,
-1);
}
*\param enabled TRUE if rule is enabled
*\param name The Name of rule
*\param account_id The account ID
+ *\param account_name The account name or All or (New)
*\param rule String representation of rule
*\param prop TRUE if valid filtering rule; if FALSE it's the first
* entry in the store ("(New)").
gboolean enabled,
const gchar *name,
gint account_id,
+ const gchar *account_name,
const gchar *rule,
gboolean prop)
{
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);
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;
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);
}
}
list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(GTK_TREE_MODEL
(prefs_filtering_create_data_store())));
- gtk_tree_view_set_rules_hint(list_view, prefs_common.enable_rules_hint);
+ gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere);
gtk_tree_view_set_reorderable(list_view, TRUE);
selector = gtk_tree_view_get_selection(list_view);
renderer,
"active", PREFS_FILTERING_ENABLED,
NULL);
+ gtk_tree_view_column_set_alignment (column, 0.5);
gtk_tree_view_append_column(GTK_TREE_VIEW(list_view), column);
g_signal_connect(G_OBJECT(renderer), "toggled",
G_CALLBACK(prefs_filtering_enable_toggled),
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
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);