From 5fbcc4828efb084344e9c5fd42ebccb288ee492f Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 2 Aug 2000 16:56:26 +0000 Subject: Add a handler for "model_pre_change" and properly stop editing. 2000-08-02 Christopher James Lahey * e-table-item.c, e-table-item.h: Add a handler for "model_pre_change" and properly stop editing. * e-table-model.c, e-table-model.h: Added a "model_pre_change" signal that gets sent before any row numbers are changed. * e-table-sorted-variable.c, e-table-subset-variable.c: Emit "model_pre_change" signals as appropriate. * e-table-subset.c, e-table-subset.h: Proxy "model_pre_changed" signals. svn path=/trunk/; revision=4472 --- widgets/table/e-table-subset.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'widgets/table/e-table-subset.c') diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c index 8ba5ed03e3..1cac0f88ea 100644 --- a/widgets/table/e-table-subset.c +++ b/widgets/table/e-table-subset.c @@ -25,6 +25,8 @@ etss_destroy (GtkObject *object) if (etss->source) gtk_object_unref (GTK_OBJECT (etss->source)); + gtk_signal_disconnect (GTK_OBJECT (etss->source), + etss->table_model_pre_change_id); gtk_signal_disconnect (GTK_OBJECT (etss->source), etss->table_model_changed_id); gtk_signal_disconnect (GTK_OBJECT (etss->source), @@ -32,6 +34,7 @@ etss_destroy (GtkObject *object) gtk_signal_disconnect (GTK_OBJECT (etss->source), etss->table_model_cell_changed_id); + etss->table_model_pre_change_id = 0; etss->table_model_changed_id = 0; etss->table_model_row_changed_id = 0; etss->table_model_cell_changed_id = 0; @@ -152,6 +155,12 @@ etss_class_init (GtkObjectClass *klass) E_MAKE_TYPE(e_table_subset, "ETableSubset", ETableSubset, etss_class_init, NULL, PARENT_TYPE); +static void +etss_proxy_model_pre_change (ETableModel *etm, ETableSubset *etss) +{ + e_table_model_pre_change (E_TABLE_MODEL (etss)); +} + static void etss_proxy_model_changed (ETableModel *etm, ETableSubset *etss) { @@ -206,6 +215,8 @@ e_table_subset_construct (ETableSubset *etss, ETableModel *source, int nvals) for (i = 0; i < nvals; i++) etss->map_table [i] = i; + etss->table_model_pre_change_id = gtk_signal_connect (GTK_OBJECT (source), "model_pre_change", + GTK_SIGNAL_FUNC (etss_proxy_model_pre_change), etss); etss->table_model_changed_id = gtk_signal_connect (GTK_OBJECT (source), "model_changed", GTK_SIGNAL_FUNC (etss_proxy_model_changed), etss); etss->table_model_row_changed_id = gtk_signal_connect (GTK_OBJECT (source), "model_row_changed", -- cgit