aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-sorted.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-04-13 08:40:49 +0800
committerChris Lahey <clahey@src.gnome.org>2001-04-13 08:40:49 +0800
commit0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f (patch)
tree65b0c7756268decded8c5f5341c85aaaf6476d8e /widgets/table/e-tree-sorted.c
parenta4f57fbbde67f1423a741b898d51773310a8c696 (diff)
downloadgsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar.gz
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar.bz2
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar.lz
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar.xz
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar.zst
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.zip
Upped the version number to 0.6.99.0. Upped the so number to 6.
2001-04-12 Christopher James Lahey <clahey@ximian.com> * configure.in: Upped the version number to 0.6.99.0. Upped the so number to 6. * docs/etablexml.txt: Made some updates here. * tests/test-tree-1.c, tests/test-tree-3.c: Added NULL, NULL to the call to e_tree_memory_callbacks_new. From gal/e-table/ChangeLog: 2001-04-12 Christopher James Lahey <clahey@ximian.com> * e-table-item.c (eti_cursor_change): Only move the screen to show the cursor if there are no changes pending. Updated the commented out code for alternating colors a bit. * e-table-model.c, e-table-model.h: Added e_table_model_has_change_pending. * e-tree-memory-callbacks.c, e-tree-memory-callbacks.h: Added has_get_node_by_id and get_node_by_id. * e-tree-model.c, e-tree-model.h: Added e_tree_model_has_get_node_by_id and e_tree_model_get_node_by_id. Added e_tree_model_has_change_pending. * e-tree-selection-model.c: Handle the selection and cursor properly across the tree changing. * e-tree-sorted.c: Implemented has_get_node_by_id and get_node_by_id, and has_changes_pending. * e-tree-table-adapter.c: Implemented has_changes_pending. Fixed an array underflow. svn path=/trunk/; revision=9289
Diffstat (limited to 'widgets/table/e-tree-sorted.c')
-rw-r--r--widgets/table/e-tree-sorted.c47
1 files changed, 43 insertions, 4 deletions
diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c
index b369789609..d74fb46cd5 100644
--- a/widgets/table/e-tree-sorted.c
+++ b/widgets/table/e-tree-sorted.c
@@ -110,6 +110,8 @@ ets_sort_idle(gpointer user_data)
ets->priv->sort_idle_id = 0;
if (ets->priv->root) {
resort_node (ets, ets->priv->root, FALSE, FALSE, TRUE);
+ } else {
+ e_tree_model_node_changed (E_TREE_MODEL(ets), ets->priv->root);
}
return FALSE;
}
@@ -513,15 +515,21 @@ mark_path_needs_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_
static void
schedule_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, gboolean resort_all_children)
{
- mark_path_needs_resort(ets, path, needs_regen, resort_all_children);
- if (ets->priv->sort_idle_id == 0) {
- ets->priv->sort_idle_id = g_idle_add_full(50, (GSourceFunc) ets_sort_idle, ets, NULL);
- }
ets->priv->insert_count = 0;
if (ets->priv->insert_idle_id != 0) {
g_source_remove(ets->priv->insert_idle_id);
ets->priv->insert_idle_id = 0;
}
+
+ if (path == NULL)
+ return;
+ if (path->num_children == 0)
+ return;
+
+ mark_path_needs_resort(ets, path, needs_regen, resort_all_children);
+ if (ets->priv->sort_idle_id == 0) {
+ ets->priv->sort_idle_id = g_idle_add_full(50, (GSourceFunc) ets_sort_idle, ets, NULL);
+ }
}
@@ -832,6 +840,32 @@ ets_get_save_id (ETreeModel *etm, ETreePath node)
return g_strdup_printf("%p", path->corresponding);
}
+static gboolean
+ets_has_get_node_by_id (ETreeModel *etm)
+{
+ ETreeSorted *ets = E_TREE_SORTED(etm);
+ return e_tree_model_has_get_node_by_id(ets->priv->source);
+}
+
+static ETreePath
+ets_get_node_by_id (ETreeModel *etm, gchar *save_id)
+{
+ ETreeSorted *ets = E_TREE_SORTED(etm);
+ ETreePath node;
+
+ node = e_tree_model_get_node_by_id (ets->priv->source, save_id);
+
+ return find_path(ets, node);
+}
+
+static gboolean
+ets_has_change_pending (ETreeModel *etm)
+{
+ ETreeSorted *ets = E_TREE_SORTED(etm);
+
+ return ets->priv->sort_idle_id != 0;
+}
+
static void *
ets_value_at (ETreeModel *etm, ETreePath node, int col)
@@ -1102,6 +1136,11 @@ e_tree_sorted_class_init (GtkObjectClass *klass)
tree_class->has_save_id = ets_has_save_id;
tree_class->get_save_id = ets_get_save_id;
+ tree_class->has_get_node_by_id = ets_has_get_node_by_id;
+ tree_class->get_node_by_id = ets_get_node_by_id;
+
+ tree_class->has_change_pending = ets_has_change_pending;
+