From 22c6cebf6b5e10754c209e6052173967d4092142 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Tue, 24 Sep 2002 07:01:02 +0000 Subject: New api to set the search column on a tree without having to set a sort 2002-09-24 Mike Kestner * e-tree.c (e_tree_set_search_column): New api to set the search column on a tree without having to set a sort column. svn path=/trunk/; revision=18193 --- widgets/table/e-tree.c | 21 +++++++++++++++++++++ widgets/table/e-tree.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index f3b21fff50..e1073e5b01 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -1107,6 +1107,27 @@ e_tree_setup_table (ETree *e_tree) et_build_item(e_tree); } +/** + * e_tree_set_search_column: + * @e_tree: #ETree object that will be modified + * @col: Column index to use for searches + * + * This routine sets the current search column to be used for keypress + * searches of the #ETree. If -1 is passed in for column, the current + * search column is cleared. + */ +void +e_tree_set_search_column (ETree *e_tree, gint col) +{ + if (col == -1) { + clear_current_search_col (e_tree); + return; + } + + e_tree->priv->search_col_set = TRUE; + e_tree->priv->current_search_col = e_table_header_get_column (e_tree->priv->full_header, col); +} + void e_tree_set_state_object(ETree *e_tree, ETableState *state) { diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h index 32c3d0689d..b877b00d1f 100644 --- a/widgets/table/e-tree.h +++ b/widgets/table/e-tree.h @@ -167,6 +167,8 @@ ETableState *e_tree_get_state_object (ETree *e_tree) ETableSpecification *e_tree_get_spec (ETree *e_tree); /* note that it is more efficient to provide the state at creation time */ +void e_tree_set_search_column (ETree *e_tree, + gint col); void e_tree_set_state (ETree *e_tree, const gchar *state); void e_tree_set_state_object (ETree *e_tree, -- cgit v1.2.3