aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-sort-info.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-table-sort-info.c
parentacdfbcd161c23f9b5b043e3dd6829e5dbd48a2f0 (diff)
downloadgsoc2013-evolution-1580b0527cab9b93c15a899dd83031ee65fc64d2.tar
gsoc2013-evolution-1580b0527cab9b93c15a899dd83031ee65fc64d2.tar.gz
gsoc2013-evolution-1580b0527cab9b93c15a899dd83031ee65fc64d2.tar.bz2
gsoc2013-evolution-1580b0527cab9b93c15a899dd83031ee65fc64d2.tar.lz
gsoc2013-evolution-1580b0527cab9b93c15a899dd83031ee65fc64d2.tar.xz
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-table-sort-info.c')
-rw-r--r--widgets/table/e-table-sort-info.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c
index 32477cbf4b..ed10e6c73b 100644
--- a/widgets/table/e-table-sort-info.c
+++ b/widgets/table/e-table-sort-info.c
@@ -59,6 +59,7 @@ e_table_sort_info_init (ETableSortInfo *info)
info->frozen = 0;
info->sort_info_changed = 0;
info->group_info_changed = 0;
+ info->can_group = 1;
}
static void
@@ -179,7 +180,10 @@ e_table_sort_info_thaw (ETableSortInfo *info)
guint
e_table_sort_info_grouping_get_count (ETableSortInfo *info)
{
- return info->group_count;
+ if (info->can_group)
+ return info->group_count;
+ else
+ return 0;
}
static void
@@ -219,7 +223,7 @@ e_table_sort_info_grouping_truncate (ETableSortInfo *info, int length)
ETableSortColumn
e_table_sort_info_grouping_get_nth (ETableSortInfo *info, int n)
{
- if (n < info->group_count) {
+ if (info->can_group && n < info->group_count) {
return info->groupings[n];
} else {
ETableSortColumn fake = {0, 0};
@@ -450,5 +454,22 @@ e_table_sort_info_duplicate (ETableSortInfo *info)
new_info->sortings = g_new(ETableSortColumn, new_info->sort_count);
memmove(new_info->sortings, info->sortings, sizeof (ETableSortColumn) * new_info->sort_count);
+ new_info->can_group = info->can_group;
+
return new_info;
}
+
+void
+e_table_sort_info_set_can_group (ETableSortInfo *info,
+ gboolean can_group)
+{
+ info->can_group = can_group;
+}
+
+gboolean
+e_table_sort_info_get_can_group (ETableSortInfo *info)
+{
+ return info->can_group;
+}
+
+