diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/table/e-tree-selection-model.c | 9 | ||||
-rw-r--r-- | widgets/table/e-tree-selection-model.h | 2 | ||||
-rw-r--r-- | widgets/table/e-tree.c | 63 | ||||
-rw-r--r-- | widgets/table/e-tree.h | 10 |
4 files changed, 50 insertions, 34 deletions
diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index 4c8a45c92d..375003f35d 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -1137,6 +1137,15 @@ e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, ETreePath } void +e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, ETreePath path) +{ + etsm_change_one_path(etsm, path, TRUE); + etsm->priv->selection_start_path = path; + + e_selection_model_selection_changed(E_SELECTION_MODEL(etsm)); +} + +void e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm, ETreePath path) { int row; diff --git a/widgets/table/e-tree-selection-model.h b/widgets/table/e-tree-selection-model.h index ffed337835..ae5fa9bd3e 100644 --- a/widgets/table/e-tree-selection-model.h +++ b/widgets/table/e-tree-selection-model.h @@ -41,6 +41,8 @@ void e_tree_selection_model_foreach (ETreeSelectionModel gpointer closure); void e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, ETreePath path); +void e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, + ETreePath path); void e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm, ETreePath path); diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 49fcc0732f..7291215e0a 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -1199,34 +1199,6 @@ e_tree_selected_path_foreach (ETree *e_tree, } #endif -gint -e_tree_selected_count (ETree *e_tree) -{ - g_return_val_if_fail(e_tree != NULL, -1); - g_return_val_if_fail(E_IS_TREE(e_tree), -1); - - return e_selection_model_selected_count(E_SELECTION_MODEL (e_tree->priv->selection)); -} - -void -e_tree_select_all (ETree *tree) -{ - g_return_if_fail (tree != NULL); - g_return_if_fail (E_IS_TREE (tree)); - - e_selection_model_select_all (E_SELECTION_MODEL (tree->priv->selection)); -} - -void -e_tree_invert_selection (ETree *tree) -{ - g_return_if_fail (tree != NULL); - g_return_if_fail (E_IS_TREE (tree)); - - e_selection_model_invert_selection (E_SELECTION_MODEL (tree->priv->selection)); -} - - EPrintable * e_tree_get_printable (ETree *e_tree) { @@ -1493,6 +1465,41 @@ e_tree_get_tooltip (ETree *et) return E_CANVAS(et->priv->table_canvas)->tooltip_window; } +/** + * e_tree_get_model: + * @et: the ETree + * + * Returns the model upon which this ETree is based. + * + * Returns: the model + **/ +ETreeModel * +e_tree_get_model (ETree *et) +{ + g_return_val_if_fail (et != NULL, NULL); + g_return_val_if_fail (E_IS_TREE (et), NULL); + + return et->priv->model; +} + +/** + * e_tree_get_selection_model: + * @et: the ETree + * + * Returns the selection model of this ETree. + * + * Returns: the selection model + **/ +ESelectionModel * +e_tree_get_selection_model (ETree *et) +{ + g_return_val_if_fail (et != NULL, NULL); + g_return_val_if_fail (E_IS_TREE (et), NULL); + + return et->priv->selection; +} + + struct _ETreeDragSourceSite { GdkModifierType start_button_mask; diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h index 7ad9873d8b..8034d43c95 100644 --- a/widgets/table/e-tree.h +++ b/widgets/table/e-tree.h @@ -181,6 +181,9 @@ void e_tree_get_cell_geometry (ETree *tree, int *width_return, int *height_return); +/* Useful accessors */ +ETreeModel * e_tree_get_model (ETree *et); +ESelectionModel *e_tree_get_selection_model (ETree *et); /* Drag & drop stuff. */ /* Target */ @@ -226,12 +229,7 @@ GdkDragContext *e_tree_drag_begin (ETree *tree, GtkTargetList *targets, GdkDragAction actions, gint button, - GdkEvent *event); - -/* selection stuff */ -void e_tree_select_all (ETree *tree); -void e_tree_invert_selection (ETree *tree); - + GdkEvent *event); /* Adapter functions */ gboolean e_tree_node_is_expanded (ETree *et, |