From 7a0455fc2b247575cb6fe7199a7494fa812503c4 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Thu, 4 Mar 2004 17:23:01 +0000 Subject: Fixes #50294 2004-03-04 Rodrigo Moya Fixes #50294 * gui/e-tasks.c (setup_widgets): connect to "model_rows_deleted" signal on the ETable's model. (model_rows_deleted_cb): callback for clearing the preview widget when the currently selected task is removed. svn path=/trunk/; revision=24969 --- calendar/ChangeLog | 9 +++++++++ calendar/gui/e-tasks.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index ed8c651f4c..1a364e8912 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2004-03-04 Rodrigo Moya + + Fixes #50294 + + * gui/e-tasks.c (setup_widgets): connect to "model_rows_deleted" signal + on the ETable's model. + (model_rows_deleted_cb): callback for clearing the preview widget when + the currently selected task is removed. + 2004-03-04 Rodrigo Moya * gui/calendar-commands.c (calendar_control_sensitize_calendar_commands): diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 5a0b4b56c3..ea3e9dd12e 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -485,6 +485,37 @@ model_row_changed_cb (ETableModel *etm, int row, gpointer data) } } +static void +model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer data) +{ + ETasks *tasks; + ETasksPrivate *priv; + ECalModelComponent *comp_data; + + tasks = E_TASKS (data); + priv = tasks->priv; + + if (priv->current_uid) { + const char *uid; + int i; + + for (i = row; i < row + count; i++) { + comp_data = e_cal_model_get_component_at (E_CAL_MODEL (etm), i); + if (comp_data) { + uid = icalcomponent_get_uid (comp_data->icalcomp); + if (!strcmp (uid ? uid : "", priv->current_uid)) { + ETable *etable; + + etable = e_table_scrolled_get_table ( + E_TABLE_SCROLLED (E_CALENDAR_TABLE (priv->tasks_view)->etable)); + table_cursor_change_cb (etable, 0, tasks); + break; + } + } + } + } +} + static void setup_config (ETasks *tasks) { @@ -577,6 +608,8 @@ setup_widgets (ETasks *tasks) model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view)); g_signal_connect (G_OBJECT (model), "model_row_changed", G_CALLBACK (model_row_changed_cb), tasks); + g_signal_connect (G_OBJECT (model), "model_rows_deleted", + G_CALLBACK (model_rows_deleted_cb), tasks); } /* Class initialization function for the gnome calendar */ -- cgit