aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-header.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-06-05 05:24:19 +0800
committerChris Lahey <clahey@src.gnome.org>2002-06-05 05:24:19 +0800
commit75a1cb19cdba3774d8d76ac9bf238254545b018f (patch)
treedd6759d82276a075db3d0dae04232b27ee9de330 /widgets/table/e-table-header.c
parentc1dadee81ade19d8524cd5d8466f76ffd4f5f289 (diff)
downloadgsoc2013-evolution-75a1cb19cdba3774d8d76ac9bf238254545b018f.tar
gsoc2013-evolution-75a1cb19cdba3774d8d76ac9bf238254545b018f.tar.gz
gsoc2013-evolution-75a1cb19cdba3774d8d76ac9bf238254545b018f.tar.bz2
gsoc2013-evolution-75a1cb19cdba3774d8d76ac9bf238254545b018f.tar.lz
gsoc2013-evolution-75a1cb19cdba3774d8d76ac9bf238254545b018f.tar.xz
gsoc2013-evolution-75a1cb19cdba3774d8d76ac9bf238254545b018f.tar.zst
gsoc2013-evolution-75a1cb19cdba3774d8d76ac9bf238254545b018f.zip
Added this function.
2002-06-04 Christopher James Lahey <clahey@ximian.com> * e-table-header.c, e-table-header.h (e_table_header_prioritized_column_selected): Added this function. * e-table-utils.c, e-table-utils.h (e_table_util_calculate_current_search_col): Added this function. * e-table.c, e-table.h, e-tree.c: Added a "always_search" argument. If this is off, then searches only occur if there's sort. If it's on, sort takes precendence in doing searches, followed by the highest priority column shown. svn path=/trunk/; revision=17109
Diffstat (limited to 'widgets/table/e-table-header.c')
-rw-r--r--widgets/table/e-table-header.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c
index aa4b4ffb75..70d9b5583e 100644
--- a/widgets/table/e-table-header.c
+++ b/widgets/table/e-table-header.c
@@ -929,3 +929,26 @@ e_table_header_prioritized_column (ETableHeader *eth)
}
return best_model_col;
}
+
+ETableCol *
+e_table_header_prioritized_column_selected (ETableHeader *eth, ETableColCheckFunc check_func, gpointer user_data)
+{
+ ETableCol *best_col = NULL;
+ int best_priority = G_MININT;
+ int i;
+ int count;
+
+ count = e_table_header_count (eth);
+ if (count == 0)
+ return NULL;
+ for (i = 1; i < count; i++) {
+ ETableCol *col = e_table_header_get_column (eth, i);
+ if (col) {
+ if ((best_col == NULL || col->priority > best_priority) && check_func (col, user_data)) {
+ best_priority = col->priority;
+ best_col = col;
+ }
+ }
+ }
+ return best_col;
+}