From 75a1cb19cdba3774d8d76ac9bf238254545b018f Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 4 Jun 2002 21:24:19 +0000 Subject: Added this function. 2002-06-04 Christopher James Lahey * 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 --- widgets/table/e-table-header.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'widgets/table/e-table-header.c') 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; +} -- cgit v1.2.3