diff options
author | Chris Toshok <toshok@helixcode.com> | 2000-09-26 03:02:44 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2000-09-26 03:02:44 +0800 |
commit | 1084ed7340617c3476cf33694256dd06f07d86ec (patch) | |
tree | 7722ba20ba70bc455448a9b4b7cd28953cd38e9d /widgets/table/e-tree-model.h | |
parent | 2e854aa41563a9a1506f36f7cc3f8a2ddf9ffa67 (diff) | |
download | gsoc2013-evolution-1084ed7340617c3476cf33694256dd06f07d86ec.tar gsoc2013-evolution-1084ed7340617c3476cf33694256dd06f07d86ec.tar.gz gsoc2013-evolution-1084ed7340617c3476cf33694256dd06f07d86ec.tar.bz2 gsoc2013-evolution-1084ed7340617c3476cf33694256dd06f07d86ec.tar.lz gsoc2013-evolution-1084ed7340617c3476cf33694256dd06f07d86ec.tar.xz gsoc2013-evolution-1084ed7340617c3476cf33694256dd06f07d86ec.tar.zst gsoc2013-evolution-1084ed7340617c3476cf33694256dd06f07d86ec.zip |
add save_state stuff to ETreeModel, and prototypes for the public methods.
2000-09-25 Chris Toshok <toshok@helixcode.com>
* gal/e-table/e-tree-model.h: add save_state stuff to ETreeModel, and
prototypes for the public methods.
* gal/e-table/e-tree-model.c: add save_id to the ENode.
(expanded_remove_func): new function, iterator to delete the save
id's.
(etree_destroy): iterate over expanded_state.
(etree_set_expanded): if the node has a save id, make sure to
update both the collapsed and expanded counts.
(e_tree_model_node_insert_id): convenience function that inserts a
node and sets its id.
(e_tree_model_node_sort): remove extra spew.
(save_expanded_state_func): new function, iterator for saving
expanded state.
(e_tree_model_save_expanded_state): new function.
(get_string_value): helper function for loading.
(e_tree_model_load_expanded_state): new function.
(e_tree_model_node_set_save_id): sets the save id for a node,
adding it to the hashtable if it's not already there. if the id
was there previously, set the expanded flag of the node
accordingly.
svn path=/trunk/; revision=5573
Diffstat (limited to 'widgets/table/e-tree-model.h')
-rw-r--r-- | widgets/table/e-tree-model.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/widgets/table/e-tree-model.h b/widgets/table/e-tree-model.h index 318faaa0a4..b00101ca8e 100644 --- a/widgets/table/e-tree-model.h +++ b/widgets/table/e-tree-model.h @@ -18,6 +18,9 @@ typedef struct { GNode *root; gboolean root_visible; GArray *row_array; /* used in the mapping between ETable and our tree */ + guint32 num_expanded_to_save; + guint32 num_collapsed_to_save; + GHashTable *expanded_state; /* used for loading/saving expanded state */ } ETreeModel; typedef struct { @@ -108,4 +111,11 @@ void e_tree_model_node_removed (ETreeModel *tree_model, ETreePath *parent_node void e_tree_model_node_collapsed (ETreeModel *tree_model, ETreePath *node); void e_tree_model_node_expanded (ETreeModel *tree_model, ETreePath *node, gboolean *allow_expand); +/* expanded state saving stuff */ +gboolean e_tree_model_save_expanded_state (ETreeModel *etm, const char *filename); +gboolean e_tree_model_load_expanded_state (ETreeModel *etm, const char *filename); +void e_tree_model_node_set_save_id (ETreeModel *etm, ETreePath *node, const char *id); +ETreePath* e_tree_model_node_insert_id (ETreeModel *tree_model, ETreePath *parent_path, + int position, gpointer node_data, const char *save_id); + #endif /* _E_TREE_MODEL_H */ |