aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMike Kestner <mkestner@ximian.com>2003-09-12 05:14:00 +0800
committerMike Kestner <mkestner@src.gnome.org>2003-09-12 05:14:00 +0800
commit7fef481a7ac44ebaa98cfb39c106546345b23e43 (patch)
tree7e7b5c674e140180748d82deee6daf4d12c0c82a /widgets
parentf01f363a70ccc3a4f6ad62fd4fb58cca99d16457 (diff)
downloadgsoc2013-evolution-7fef481a7ac44ebaa98cfb39c106546345b23e43.tar
gsoc2013-evolution-7fef481a7ac44ebaa98cfb39c106546345b23e43.tar.gz
gsoc2013-evolution-7fef481a7ac44ebaa98cfb39c106546345b23e43.tar.bz2
gsoc2013-evolution-7fef481a7ac44ebaa98cfb39c106546345b23e43.tar.lz
gsoc2013-evolution-7fef481a7ac44ebaa98cfb39c106546345b23e43.tar.xz
gsoc2013-evolution-7fef481a7ac44ebaa98cfb39c106546345b23e43.tar.zst
gsoc2013-evolution-7fef481a7ac44ebaa98cfb39c106546345b23e43.zip
new method to get the source model column for a specified available_model
2003-09-11 Mike Kestner <mkestner@ximian.com> * e-table-config.c (get_source_model_col_index): new method to get the source model column for a specified available_model idx. (create_global_store): save the source model index in a new col. (config_button_add): use the new index lookup function [48153]. svn path=/trunk/; revision=22536
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/e-table-config.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c
index 4881edb687..825e28a5a4 100644
--- a/widgets/table/e-table-config.c
+++ b/widgets/table/e-table-config.c
@@ -94,10 +94,8 @@ config_finalize (GObject *object)
static void
e_table_config_changed (ETableConfig *config, ETableState *state)
{
- g_return_if_fail (config != NULL);
g_return_if_fail (E_IS_TABLE_CONFIG (config));
-
g_signal_emit(G_OBJECT(config), e_table_config_signals [CHANGED], 0, state);
}
@@ -510,6 +508,7 @@ do_fields_config_dialog (ETableConfig *config)
ETableMemoryStoreColumnInfo store_columns[] = {
E_TABLE_MEMORY_STORE_STRING,
+ E_TABLE_MEMORY_STORE_INTEGER,
E_TABLE_MEMORY_STORE_TERMINATOR
};
@@ -529,7 +528,7 @@ create_global_store (ETableConfig *config)
continue;
text = g_strdup (dgettext (config->domain, config->source_spec->columns[i]->title));
- e_table_memory_store_insert_adopt (E_TABLE_MEMORY_STORE (global_store), -1, NULL, text);
+ e_table_memory_store_insert_adopt (E_TABLE_MEMORY_STORE (global_store), -1, NULL, text, i);
}
}
@@ -640,6 +639,17 @@ connect_button (ETableConfig *config, GladeXML *gui, const char *widget_name, GC
}
}
+static gint
+get_source_model_col_index (ETableConfig *config, gint idx)
+{
+ gint visible_index, result;
+ ETableModel *src_model = E_TABLE_SUBSET (config->available_model)->source;
+
+ visible_index = e_table_subset_view_to_model_row (E_TABLE_SUBSET (config->available_model), idx);
+
+ return GPOINTER_TO_INT (e_table_model_value_at (src_model, 1, visible_index));
+}
+
static void
sort_entry_changed (GtkEntry *entry, ETableConfigSortWidgets *sort)
{
@@ -882,7 +892,7 @@ config_button_add (GtkWidget *widget, ETableConfig *config)
config->temp_state->expansions = g_renew (double, config->temp_state->expansions, config->temp_state->col_count + count);
i = config->temp_state->col_count;
for (column = columns; column; column = column->next) {
- config->temp_state->columns[i] = e_table_subset_view_to_model_row (E_TABLE_SUBSET (config->available_model), GPOINTER_TO_INT (column->data));
+ config->temp_state->columns[i] = get_source_model_col_index (config, GPOINTER_TO_INT (column->data));
config->temp_state->expansions[i] = config->source_spec->columns[config->temp_state->columns[i]]->expansion;
i++;
}