diff options
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 24 |
2 files changed, 30 insertions, 2 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index b63ceb9a40..7a5b3dcafc 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2005-01-28 JP Rosevear <jpr@novell.com> + + Fixes #71452 + + * gui/dialogs/comp-editor.c (setup_widgets): listen for + delete_event signal and handle it outside of the response signal + so that cancel works properly + 2005-01-28 Rodrigo Moya <rodrigo@novell.com> * gui/e-tasks.c (setup_widgets): diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 012ccecd35..3658500e7f 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -373,7 +373,7 @@ response_cb (GtkWidget *widget, int response, gpointer data) ECalComponentText text; priv = editor->priv; - + switch (response) { case GTK_RESPONSE_OK: commit_all_fields (editor); @@ -395,15 +395,34 @@ response_cb (GtkWidget *widget, int response, gpointer data) break; case GTK_RESPONSE_CANCEL: - case GTK_RESPONSE_DELETE_EVENT: commit_all_fields (editor); if (prompt_to_save_changes (editor, TRUE)) close_dialog (editor); break; + default: + /* We handle delete event below */ + break; } } +static int +delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) +{ + CompEditor *editor = COMP_EDITOR (data); + CompEditorPrivate *priv; + ECalComponentText text; + + priv = editor->priv; + + commit_all_fields (editor); + + if (prompt_to_save_changes (editor, TRUE)) + close_dialog (editor); + + return TRUE; +} + static void attachment_bar_changed_cb (CalAttachmentBar *bar, void *data) @@ -496,6 +515,7 @@ setup_widgets (CompEditor *editor) gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), GTK_RESPONSE_OK, FALSE); g_signal_connect (editor, "response", G_CALLBACK (response_cb), editor); + g_signal_connect (editor, "delete_event", G_CALLBACK (delete_event_cb), editor); /*Attachments */ priv->attachment_scrolled_window = gtk_scrolled_window_new (NULL, NULL); |