aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-tree.c8
-rw-r--r--widgets/table/e-tree.h10
2 files changed, 12 insertions, 6 deletions
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index d50eef2b3b..26a6751b75 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -1738,7 +1738,7 @@ e_tree_get_tooltip (ETree *et)
}
gboolean
-e_tree_find_next (ETree *et, gboolean forward_direction, gboolean wrap, ETreePathFunc func, gpointer data)
+e_tree_find_next (ETree *et, ETreeFindNextParams params, ETreePathFunc func, gpointer data)
{
ETreePath cursor;
ETreePath found;
@@ -1746,7 +1746,7 @@ e_tree_find_next (ETree *et, gboolean forward_direction, gboolean wrap, ETreePat
cursor = e_tree_get_cursor (et);
cursor = e_tree_sorted_model_to_view_path (et->priv->sorted, cursor);
- found = e_tree_model_node_find (E_TREE_MODEL (et->priv->sorted), cursor, NULL, forward_direction, func, data);
+ found = e_tree_model_node_find (E_TREE_MODEL (et->priv->sorted), cursor, NULL, params & E_TREE_FIND_NEXT_FORWARD, func, data);
if (found) {
e_tree_table_adapter_show_node (et->priv->etta, found);
@@ -1755,8 +1755,8 @@ e_tree_find_next (ETree *et, gboolean forward_direction, gboolean wrap, ETreePat
return TRUE;
}
- if (wrap) {
- found = e_tree_model_node_find (E_TREE_MODEL (et->priv->sorted), NULL, cursor, forward_direction, func, data);
+ if (params & E_TREE_FIND_NEXT_WRAP) {
+ found = e_tree_model_node_find (E_TREE_MODEL (et->priv->sorted), NULL, cursor, params & E_TREE_FIND_NEXT_FORWARD, func, data);
if (found && found != cursor) {
e_tree_table_adapter_show_node (et->priv->etta, found);
diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h
index f42e22eb87..fea53eb184 100644
--- a/widgets/table/e-tree.h
+++ b/widgets/table/e-tree.h
@@ -281,9 +281,15 @@ void e_tree_load_expanded_state (ETree *et,
char *filename);
int e_tree_row_count (ETree *et);
GtkWidget *e_tree_get_tooltip (ETree *et);
+
+typedef enum {
+ E_TREE_FIND_NEXT_BACKWARD = 0,
+ E_TREE_FIND_NEXT_FORWARD = 1 << 0,
+ E_TREE_FIND_NEXT_WRAP = 1 << 1
+} ETreeFindNextParams;
+
gboolean e_tree_find_next (ETree *et,
- gboolean forward_direction,
- gboolean wrap,
+ ETreeFindNextParams params,
ETreePathFunc func,
gpointer data);