aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-selection-model.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-31 18:33:51 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-31 18:33:51 +0800
commit23587bebe83c772d08ab2ae7faa31dffa45b0987 (patch)
tree610958e3503f902d708b7facdbc381315b62f317 /widgets/table/e-tree-selection-model.c
parenta06c0a0d1265e81e0672c859742474c623f3d2d8 (diff)
downloadgsoc2013-evolution-23587bebe83c772d08ab2ae7faa31dffa45b0987.tar
gsoc2013-evolution-23587bebe83c772d08ab2ae7faa31dffa45b0987.tar.gz
gsoc2013-evolution-23587bebe83c772d08ab2ae7faa31dffa45b0987.tar.bz2
gsoc2013-evolution-23587bebe83c772d08ab2ae7faa31dffa45b0987.tar.lz
gsoc2013-evolution-23587bebe83c772d08ab2ae7faa31dffa45b0987.tar.xz
gsoc2013-evolution-23587bebe83c772d08ab2ae7faa31dffa45b0987.tar.zst
gsoc2013-evolution-23587bebe83c772d08ab2ae7faa31dffa45b0987.zip
Added frozen_count variable to know not to show the cursor while a change
2001-10-31 Christopher James Lahey <clahey@ximian.com> * e-table-item.c, e-table-item.h: Added frozen_count variable to know not to show the cursor while a change is going on. * e-table-model.c, e-table-model.h, e-tree-model.c, e-tree-model.h: Added a model_no_change signal to pair with a pre_change if there's no change. * e-table-selection-model.h: Removed an unused frozen field here. * e-table-sorted.c, e-table-subset.c, e-table-subset.h, e-table-without.c, e-tree-memory.c, e-tree-sorted.c, e-tree-table-adapter.c: Made sure pre_changes were all matched by some change. Proxy no_change signal where appropriate. * e-tree-selection-model.c: Keep track of the frozen_count variable to know whether a change is going on. svn path=/trunk/; revision=14523
Diffstat (limited to 'widgets/table/e-tree-selection-model.c')
-rw-r--r--widgets/table/e-tree-selection-model.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c
index a4efddf2b8..7914cb022a 100644
--- a/widgets/table/e-tree-selection-model.c
+++ b/widgets/table/e-tree-selection-model.c
@@ -70,7 +70,10 @@ struct ETreeSelectionModelPriv {
char *cursor_save_id;
+ int frozen_count;
+
int tree_model_pre_change_id;
+ int tree_model_no_change_id;
int tree_model_node_changed_id;
int tree_model_node_data_changed_id;
int tree_model_node_col_changed_id;
@@ -342,6 +345,18 @@ update_parents (ETreeSelectionModel *etsm, ETreePath path)
/* Signal handlers */
static void
+etsm_freeze (ETreeSelectionModel *etsm)
+{
+ etsm->priv->frozen_count ++;
+}
+
+static void
+etsm_unfreeze (ETreeSelectionModel *etsm)
+{
+ etsm->priv->frozen_count --;
+}
+
+static void
etsm_pre_change (ETreeModel *etm, ETreeSelectionModel *etsm)
{
g_free (etsm->priv->cursor_save_id);
@@ -352,6 +367,14 @@ etsm_pre_change (ETreeModel *etm, ETreeSelectionModel *etsm)
etsm->priv->cursor_path) {
etsm->priv->cursor_save_id = e_tree_model_get_save_id (etm, etsm->priv->cursor_path);
}
+
+ etsm_freeze (etsm);
+}
+
+static void
+etsm_no_change (ETreeModel *etm, ETreeSelectionModel *etsm)
+{
+ etsm_unfreeze (etsm);
}
static void
@@ -384,6 +407,7 @@ etsm_node_changed (ETreeModel *etm, ETreePath node, ETreeSelectionModel *etsm)
g_free (etsm->priv->cursor_save_id);
etsm->priv->cursor_save_id = NULL;
+ etsm_unfreeze (etsm);
}
static void
@@ -391,6 +415,7 @@ etsm_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSelectionModel *et
{
g_free (etsm->priv->cursor_save_id);
etsm->priv->cursor_save_id = NULL;
+ etsm_unfreeze (etsm);
}
static void
@@ -398,6 +423,7 @@ etsm_node_col_changed (ETreeModel *etm, ETreePath node, int col, ETreeSelectionM
{
g_free (etsm->priv->cursor_save_id);
etsm->priv->cursor_save_id = NULL;
+ etsm_unfreeze (etsm);
}
static void
@@ -454,6 +480,8 @@ add_model(ETreeSelectionModel *etsm, ETreeModel *model)
gtk_object_ref(GTK_OBJECT(priv->model));
priv->tree_model_pre_change_id = gtk_signal_connect_after (GTK_OBJECT (priv->model), "pre_change",
GTK_SIGNAL_FUNC (etsm_pre_change), etsm);
+ priv->tree_model_no_change_id = gtk_signal_connect_after (GTK_OBJECT (priv->model), "no_change",
+ GTK_SIGNAL_FUNC (etsm_no_change), etsm);
priv->tree_model_node_changed_id = gtk_signal_connect_after (GTK_OBJECT (priv->model), "node_changed",
GTK_SIGNAL_FUNC (etsm_node_changed), etsm);
priv->tree_model_node_data_changed_id = gtk_signal_connect_after (GTK_OBJECT (priv->model), "node_data_changed",
@@ -477,6 +505,8 @@ drop_model(ETreeSelectionModel *etsm)
gtk_signal_disconnect (GTK_OBJECT (priv->model),
priv->tree_model_pre_change_id);
gtk_signal_disconnect (GTK_OBJECT (priv->model),
+ priv->tree_model_no_change_id);
+ gtk_signal_disconnect (GTK_OBJECT (priv->model),
priv->tree_model_node_changed_id);
gtk_signal_disconnect (GTK_OBJECT (priv->model),
priv->tree_model_node_data_changed_id);
@@ -491,6 +521,7 @@ drop_model(ETreeSelectionModel *etsm)
priv->model = NULL;
priv->tree_model_pre_change_id = 0;
+ priv->tree_model_no_change_id = 0;
priv->tree_model_node_changed_id = 0;
priv->tree_model_node_data_changed_id = 0;
priv->tree_model_node_col_changed_id = 0;
@@ -1194,6 +1225,7 @@ e_tree_selection_model_init (ETreeSelectionModel *etsm)
priv->tree_model_pre_change_id = 0;
+ priv->tree_model_no_change_id = 0;
priv->tree_model_node_changed_id = 0;
priv->tree_model_node_data_changed_id = 0;
priv->tree_model_node_col_changed_id = 0;