diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2003-10-23 18:48:12 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2003-10-23 18:48:12 +0800 |
commit | 2c1e34fa853d10da883be5923ec207fc85dcd8b0 (patch) | |
tree | cb6219661392a9f7b298beb6dafaaf166a961507 | |
parent | ccef3fc1c71d520ee8c14cff5ee3bf1f0ba74401 (diff) | |
download | gsoc2013-evolution-2c1e34fa853d10da883be5923ec207fc85dcd8b0.tar gsoc2013-evolution-2c1e34fa853d10da883be5923ec207fc85dcd8b0.tar.gz gsoc2013-evolution-2c1e34fa853d10da883be5923ec207fc85dcd8b0.tar.bz2 gsoc2013-evolution-2c1e34fa853d10da883be5923ec207fc85dcd8b0.tar.lz gsoc2013-evolution-2c1e34fa853d10da883be5923ec207fc85dcd8b0.tar.xz gsoc2013-evolution-2c1e34fa853d10da883be5923ec207fc85dcd8b0.tar.zst gsoc2013-evolution-2c1e34fa853d10da883be5923ec207fc85dcd8b0.zip |
connect also to ETableModel's "model_cell_changed" signal.
2003-10-23 Rodrigo Moya <rodrigo@ximian.com>
* gui/e-cal-view.c (e_cal_view_init): connect also to ETableModel's
"model_cell_changed" signal.
(e_cal_view_set_model): likewise.
(model_cell_changed_cb): callback for "model_cell_changed".
(e_cal_view_destroy): use g_signal_handlers_disconnect_matched instead
of g_signal_handlers_disconnect_by_func, so that all handlers are
disconnected.
svn path=/trunk/; revision=23029
-rw-r--r-- | calendar/ChangeLog | 10 | ||||
-rw-r--r-- | calendar/gui/e-cal-view.c | 15 | ||||
-rw-r--r-- | calendar/gui/e-calendar-view.c | 15 |
3 files changed, 38 insertions, 2 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 37aebb7644..fed0011a6d 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,13 @@ +2003-10-23 Rodrigo Moya <rodrigo@ximian.com> + + * gui/e-cal-view.c (e_cal_view_init): connect also to ETableModel's + "model_cell_changed" signal. + (e_cal_view_set_model): likewise. + (model_cell_changed_cb): callback for "model_cell_changed". + (e_cal_view_destroy): use g_signal_handlers_disconnect_matched instead + of g_signal_handlers_disconnect_by_func, so that all handlers are + disconnected. + 2003-10-22 Rodrigo Moya <rodrigo@ximian.com> * gui/gnome-cal.[ch] (gnome_calendar_remove_event_uri): new diff --git a/calendar/gui/e-cal-view.c b/calendar/gui/e-cal-view.c index 869c8001a3..a95f976d21 100644 --- a/calendar/gui/e-cal-view.c +++ b/calendar/gui/e-cal-view.c @@ -234,6 +234,14 @@ model_row_changed_cb (ETableModel *etm, int row, gpointer user_data) } static void +model_cell_changed_cb (ETableModel *etm, int col, int row, gpointer user_data) +{ + ECalView *cal_view = E_CAL_VIEW (user_data); + + e_cal_view_update_query (cal_view); +} + +static void model_rows_changed_cb (ETableModel *etm, int row, int count, gpointer user_data) { ECalView *cal_view = E_CAL_VIEW (user_data); @@ -391,6 +399,8 @@ e_cal_view_init (ECalView *cal_view, ECalViewClass *klass) G_CALLBACK (model_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_row_changed", G_CALLBACK (model_row_changed_cb), cal_view); + g_signal_connect (G_OBJECT (cal_view->priv->model), "model_cell_changed", + G_CALLBACK (model_cell_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_inserted", G_CALLBACK (model_rows_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_deleted", @@ -421,7 +431,9 @@ e_cal_view_destroy (GtkObject *object) if (cal_view->priv) { if (cal_view->priv->model) { - g_signal_handlers_disconnect_by_func (cal_view->priv->model, model_changed_cb, cal_view); + g_signal_handlers_disconnect_matched (cal_view->priv->model, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, cal_view); g_object_unref (cal_view->priv->model); cal_view->priv->model = NULL; } @@ -497,6 +509,7 @@ e_cal_view_set_model (ECalView *cal_view, ECalModel *model) g_object_ref (cal_view->priv->model); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_changed", G_CALLBACK (model_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_row_changed", G_CALLBACK (model_row_changed_cb), cal_view); + g_signal_connect (G_OBJECT (cal_view->priv->model), "model_cell_changed", G_CALLBACK (model_cell_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_inserted", G_CALLBACK (model_rows_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_deleted", G_CALLBACK (model_rows_changed_cb), cal_view); diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 869c8001a3..a95f976d21 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -234,6 +234,14 @@ model_row_changed_cb (ETableModel *etm, int row, gpointer user_data) } static void +model_cell_changed_cb (ETableModel *etm, int col, int row, gpointer user_data) +{ + ECalView *cal_view = E_CAL_VIEW (user_data); + + e_cal_view_update_query (cal_view); +} + +static void model_rows_changed_cb (ETableModel *etm, int row, int count, gpointer user_data) { ECalView *cal_view = E_CAL_VIEW (user_data); @@ -391,6 +399,8 @@ e_cal_view_init (ECalView *cal_view, ECalViewClass *klass) G_CALLBACK (model_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_row_changed", G_CALLBACK (model_row_changed_cb), cal_view); + g_signal_connect (G_OBJECT (cal_view->priv->model), "model_cell_changed", + G_CALLBACK (model_cell_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_inserted", G_CALLBACK (model_rows_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_deleted", @@ -421,7 +431,9 @@ e_cal_view_destroy (GtkObject *object) if (cal_view->priv) { if (cal_view->priv->model) { - g_signal_handlers_disconnect_by_func (cal_view->priv->model, model_changed_cb, cal_view); + g_signal_handlers_disconnect_matched (cal_view->priv->model, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, cal_view); g_object_unref (cal_view->priv->model); cal_view->priv->model = NULL; } @@ -497,6 +509,7 @@ e_cal_view_set_model (ECalView *cal_view, ECalModel *model) g_object_ref (cal_view->priv->model); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_changed", G_CALLBACK (model_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_row_changed", G_CALLBACK (model_row_changed_cb), cal_view); + g_signal_connect (G_OBJECT (cal_view->priv->model), "model_cell_changed", G_CALLBACK (model_cell_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_inserted", G_CALLBACK (model_rows_changed_cb), cal_view); g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_deleted", G_CALLBACK (model_rows_changed_cb), cal_view); |