diff options
author | JP Rosevear <jpr@novell.com> | 2005-01-29 05:00:06 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2005-01-29 05:00:06 +0800 |
commit | 06960a27395fd84ca3b3455a9da19e66da1fdc76 (patch) | |
tree | b605472a5e5e632fecc30f4365122a8e2bc38053 /calendar | |
parent | 2af8159df56550e60a46f58e8d84eb528f015c22 (diff) | |
download | gsoc2013-evolution-06960a27395fd84ca3b3455a9da19e66da1fdc76.tar.gz gsoc2013-evolution-06960a27395fd84ca3b3455a9da19e66da1fdc76.tar.zst gsoc2013-evolution-06960a27395fd84ca3b3455a9da19e66da1fdc76.zip |
Fixes #71452
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
svn path=/trunk/; revision=28605
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); |