aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-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-table-model.c
parenta06c0a0d1265e81e0672c859742474c623f3d2d8 (diff)
downloadgsoc2013-evolution-23587bebe83c772d08ab2ae7faa31dffa45b0987.tar.gz
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-table-model.c')
-rw-r--r--widgets/table/e-table-model.c50
1 files changed, 44 insertions, 6 deletions
diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c
index 774eb19c3d..89dce2756c 100644
--- a/widgets/table/e-table-model.c
+++ b/widgets/table/e-table-model.c
@@ -38,6 +38,7 @@ d(static gint depth = 0);
static GtkObjectClass *e_table_model_parent_class;
enum {
+ MODEL_NO_CHANGE,
MODEL_CHANGED,
MODEL_PRE_CHANGE,
MODEL_ROW_CHANGED,
@@ -272,6 +273,15 @@ e_table_model_class_init (GtkObjectClass *object_class)
object_class->destroy = e_table_model_destroy;
+ e_table_model_signals [MODEL_NO_CHANGE] =
+ gtk_signal_new ("model_no_change",
+ GTK_RUN_LAST,
+ E_OBJECT_CLASS_TYPE (object_class),
+ GTK_SIGNAL_OFFSET (ETableModelClass, model_no_change),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+
+
e_table_model_signals [MODEL_CHANGED] =
gtk_signal_new ("model_changed",
GTK_RUN_LAST,
@@ -341,6 +351,7 @@ e_table_model_class_init (GtkObjectClass *object_class)
klass->value_is_empty = NULL;
klass->value_to_string = NULL;
+ klass->model_no_change = NULL;
klass->model_changed = NULL;
klass->model_row_changed = NULL;
klass->model_cell_changed = NULL;
@@ -391,7 +402,7 @@ e_table_model_pre_change (ETableModel *e_table_model)
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
d(print_tabs());
- d(g_print("Emitting pre_change on model 0x%p.\n", e_table_model));
+ d(g_print("Emitting pre_change on model 0x%p, a %s.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type)));
d(depth++);
gtk_signal_emit (GTK_OBJECT (e_table_model),
e_table_model_signals [MODEL_PRE_CHANGE]);
@@ -399,6 +410,33 @@ e_table_model_pre_change (ETableModel *e_table_model)
}
/**
+ * e_table_model_no_change:
+ * @e_table_model: the table model to notify of the lack of a change
+ *
+ * Use this function to notify any views of this table model that
+ * the contents of the table model have changed. This will emit
+ * the signal "model_no_change" on the @e_table_model object.
+ *
+ * It is preferable to use the e_table_model_row_changed() and
+ * the e_table_model_cell_changed() to notify of smaller changes
+ * than to invalidate the entire model, as the views might have
+ * ways of caching the information they render from the model.
+ */
+void
+e_table_model_no_change (ETableModel *e_table_model)
+{
+ g_return_if_fail (e_table_model != NULL);
+ g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
+
+ d(print_tabs());
+ d(g_print("Emitting model_no_change on model 0x%p, a %s.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type)));
+ d(depth++);
+ gtk_signal_emit (GTK_OBJECT (e_table_model),
+ e_table_model_signals [MODEL_NO_CHANGE]);
+ d(depth--);
+}
+
+/**
* e_table_model_changed:
* @e_table_model: the table model to notify of the change
*
@@ -418,7 +456,7 @@ e_table_model_changed (ETableModel *e_table_model)
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
d(print_tabs());
- d(g_print("Emitting model_changed on model 0x%p.\n", e_table_model));
+ d(g_print("Emitting model_changed on model 0x%p, a %s.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type)));
d(depth++);
gtk_signal_emit (GTK_OBJECT (e_table_model),
e_table_model_signals [MODEL_CHANGED]);
@@ -442,7 +480,7 @@ e_table_model_row_changed (ETableModel *e_table_model, int row)
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
d(print_tabs());
- d(g_print("Emitting row_changed on model 0x%p, row %d.\n", e_table_model, row));
+ d(g_print("Emitting row_changed on model 0x%p, a %s, row %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row));
d(depth++);
gtk_signal_emit (GTK_OBJECT (e_table_model),
e_table_model_signals [MODEL_ROW_CHANGED], row);
@@ -467,7 +505,7 @@ e_table_model_cell_changed (ETableModel *e_table_model, int col, int row)
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
d(print_tabs());
- d(g_print("Emitting cell_changed on model 0x%p, row %d, col %d.\n", e_table_model, row, col));
+ d(g_print("Emitting cell_changed on model 0x%p, a %s, row %d, col %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row, col));
d(depth++);
gtk_signal_emit (GTK_OBJECT (e_table_model),
e_table_model_signals [MODEL_CELL_CHANGED], col, row);
@@ -492,7 +530,7 @@ e_table_model_rows_inserted (ETableModel *e_table_model, int row, int count)
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
d(print_tabs());
- d(g_print("Emitting row_inserted on model 0x%p, row %d.\n", e_table_model, row));
+ d(g_print("Emitting row_inserted on model 0x%p, a %s, row %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row));
d(depth++);
gtk_signal_emit (GTK_OBJECT (e_table_model),
e_table_model_signals [MODEL_ROWS_INSERTED], row, count);
@@ -532,7 +570,7 @@ e_table_model_rows_deleted (ETableModel *e_table_model, int row, int count)
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
d(print_tabs());
- d(g_print("Emitting row_deleted on model 0x%p, row %d.\n", e_table_model, row));
+ d(g_print("Emitting row_deleted on model 0x%p, a %s, row %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row));
d(depth++);
gtk_signal_emit (GTK_OBJECT (e_table_model),
e_table_model_signals [MODEL_ROWS_DELETED], row, count);