aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-header-item.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-09-01 16:03:44 +0800
committerChris Lahey <clahey@src.gnome.org>2001-09-01 16:03:44 +0800
commit06eb6e23fb44335ffd747d1257dce6deb9a1d756 (patch)
treee4c025d189c07513c9f93bac25cd9a187e608acd /widgets/table/e-table-header-item.c
parentb529ceb8fe7886c93633295097ab36500d4e8ba1 (diff)
downloadgsoc2013-evolution-06eb6e23fb44335ffd747d1257dce6deb9a1d756.tar.gz
gsoc2013-evolution-06eb6e23fb44335ffd747d1257dce6deb9a1d756.tar.zst
gsoc2013-evolution-06eb6e23fb44335ffd747d1257dce6deb9a1d756.zip
Rename these functions from ecn_get_text and ecn_free_text.
2001-09-01 Christopher James Lahey <clahey@ximian.com> * e-cell-float.c (ecf_get_text, ecf_free_text): Rename these functions from ecn_get_text and ecn_free_text. * e-cell-tree.c (ect_height): Make sure the height is a multiple of two here. * e-table-header-item.c, e-table-header-item.h: Added a "tree" argument so that the sorting can be set by right clicking on the header item. * e-table-item.c (eti_table_model_rows_deleted): Added some assertions here. * e-tree-selection-model.c (etsm_find_node_unless_equals): Fixed indentation. * e-tree-table-adapter.c (etta_proxy_node_changed): Rewrote this to be more readable. (e_tree_table_adapter_node_set_expanded): Added an assertion. * e-tree.c, e-tree.h (e_tree_get_spec): Added this function. (e_tree_setup_header): Set the tree argument on the ETableHeaderItem here. svn path=/trunk/; revision=12553
Diffstat (limited to 'widgets/table/e-table-header-item.c')
-rw-r--r--widgets/table/e-table-header-item.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index 8326087f9d..f2bf4a2928 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -81,6 +81,7 @@ enum {
ARG_TABLE_FONTSET,
ARG_SORT_INFO,
ARG_TABLE,
+ ARG_TREE,
};
static void
@@ -155,7 +156,6 @@ ethi_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags
if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->update)
(*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->update)(item, affine, clip_path, flags);
-
if (ethi->sort_info)
ethi->group_indent_width = e_table_sort_info_grouping_get_count(ethi->sort_info) * GROUP_INDENT;
else
@@ -326,6 +326,12 @@ ethi_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
else
ethi->table = NULL;
break;
+ case ARG_TREE:
+ if (GTK_VALUE_OBJECT(*arg))
+ ethi->tree = E_TREE(GTK_VALUE_OBJECT(*arg));
+ else
+ ethi->tree = NULL;
+ break;
}
gnome_canvas_item_request_update(item);
}
@@ -1242,7 +1248,10 @@ apply_changes (ETableConfig *config, ETableHeaderItem *ethi)
{
char *state = e_table_state_save_to_string (config->state);
- e_table_set_state (ethi->table, state);
+ if (ethi->table)
+ e_table_set_state (ethi->table, state);
+ if (ethi->tree)
+ e_tree_set_state (ethi->tree, state);
g_free (state);
}
@@ -1251,15 +1260,23 @@ ethi_popup_customize_view(GtkWidget *widget, EthiHeaderInfo *info)
{
ETableHeaderItem *ethi = info->ethi;
ETableState *state;
+ ETableSpecification *spec;
if (ethi->config)
e_table_config_raise (E_TABLE_CONFIG (ethi->config));
else {
- state = e_table_get_state_object(ethi->table);
+ if (ethi->table) {
+ state = e_table_get_state_object(ethi->table);
+ spec = ethi->table->spec;
+ } else if (ethi->tree) {
+ state = e_tree_get_state_object(ethi->tree);
+ spec = e_tree_get_spec (ethi->tree);
+ } else
+ return;
ethi->config = e_table_config_new (
- _("Configuring view: FIXME"),
- ethi->table->spec, state);
+ _("Configuring view: FIXME"),
+ spec, state);
gtk_signal_connect (
GTK_OBJECT (ethi->config), "destroy",
GTK_SIGNAL_FUNC (config_destroyed), ethi);
@@ -1302,7 +1319,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event)
e_popup_menu_run (ethi_context_menu, (GdkEvent *) event,
1 +
(col->sortable ? 0 : 2) +
- (ethi->table ? 0 : 4) +
+ ((ethi->table || ethi->tree) ? 0 : 4) +
((e_table_header_count (ethi->eth) > 1) ? 0 : 8),
((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) +
128, info);
@@ -1543,6 +1560,8 @@ ethi_class_init (GtkObjectClass *object_class)
GTK_ARG_WRITABLE, ARG_SORT_INFO);
gtk_object_add_arg_type ("ETableHeaderItem::table", GTK_TYPE_OBJECT,
GTK_ARG_WRITABLE, ARG_TABLE);
+ gtk_object_add_arg_type ("ETableHeaderItem::tree", E_TREE_TYPE,
+ GTK_ARG_WRITABLE, ARG_TREE);
/*
* Create our pixmaps for DnD
@@ -1589,6 +1608,7 @@ ethi_init (GnomeCanvasItem *item)
ethi->group_indent_width = 0;
ethi->table = NULL;
+ ethi->tree = NULL;
}
GtkType