aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-08-11 04:49:24 +0800
committerChris Lahey <clahey@src.gnome.org>2001-08-11 04:49:24 +0800
commit1580b0527cab9b93c15a899dd83031ee65fc64d2 (patch)
treeff9f876c3028b9d18e0ef916bb561550c7767b86 /widgets/table/e-tree.c
parentacdfbcd161c23f9b5b043e3dd6829e5dbd48a2f0 (diff)
downloadgsoc2013-evolution-1580b0527cab9b93c15a899dd83031ee65fc64d2.tar.gz
gsoc2013-evolution-1580b0527cab9b93c15a899dd83031ee65fc64d2.tar.zst
gsoc2013-evolution-1580b0527cab9b93c15a899dd83031ee65fc64d2.zip
If the sort_info can't group, hide the grouping button and label.
2001-08-10 Christopher James Lahey <clahey@ximian.com> * e-table-config.c (setup_gui): If the sort_info can't group, hide the grouping button and label. * e-table-header-item.c (ethi_header_context_menu): Removed the Group By This Field menu item if the sort_info doesn't support grouping. * e-table-sort-info.c, e-table-sort-info.h (e_table_sort_info_get_can_group, e_table_sort_info_set_can_group): Added these functions. * e-tree.c (e_tree_set_state_object, et_real_construct): Set can_group to FALSE for all our sort infos. (e_tree_get_state_object): Fixed a potential gtk_object_ref (NULL) here. svn path=/trunk/; revision=11896
Diffstat (limited to 'widgets/table/e-tree.c')
-rw-r--r--widgets/table/e-tree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index 97153b95be..753188a831 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -751,9 +751,10 @@ e_tree_set_state_object(ETree *e_tree, ETableState *state)
if (e_tree->priv->sort_info)
gtk_object_unref(GTK_OBJECT(e_tree->priv->sort_info));
- if (state->sort_info)
+ if (state->sort_info) {
e_tree->priv->sort_info = e_table_sort_info_duplicate(state->sort_info);
- else
+ e_table_sort_info_set_can_group (e_tree->priv->sort_info, FALSE);
+ } else
e_tree->priv->sort_info = NULL;
if (e_tree->priv->header_item)
@@ -843,7 +844,8 @@ e_tree_get_state_object (ETree *e_tree)
state = e_table_state_new();
state->sort_info = e_tree->priv->sort_info;
- gtk_object_ref(GTK_OBJECT(state->sort_info));
+ if (state->sort_info)
+ gtk_object_ref(GTK_OBJECT(state->sort_info));
state->col_count = e_table_header_count (e_tree->priv->header);
full_col_count = e_table_header_count (e_tree->priv->full_header);
@@ -969,6 +971,8 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete,
e_tree->priv->sort_info = state->sort_info;
gtk_object_ref (GTK_OBJECT (e_tree->priv->sort_info));
+ e_table_sort_info_set_can_group (e_tree->priv->sort_info, FALSE);
+
gtk_object_set(GTK_OBJECT(e_tree->priv->header),
"sort_info", e_tree->priv->sort_info,
NULL);