diff options
author | Milan Crha <mcrha@redhat.com> | 2010-05-21 23:33:59 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2010-05-21 23:33:59 +0800 |
commit | 6139fb4d0b5e8f820df338be61d307b5c2782a57 (patch) | |
tree | ee1e7528a40c72525cfe237ecdd27e7f4317ecb8 | |
parent | 20fe637c8becfb356f682c1bcaf40f3790b1a9bf (diff) | |
download | gsoc2013-evolution-6139fb4d0b5e8f820df338be61d307b5c2782a57.tar.gz gsoc2013-evolution-6139fb4d0b5e8f820df338be61d307b5c2782a57.tar.zst gsoc2013-evolution-6139fb4d0b5e8f820df338be61d307b5c2782a57.zip |
Bug #617557 - Quits without asking user to save unfinished messages
-rw-r--r-- | composer/e-msg-composer.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index dc50fad5ad..cf10578af0 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1605,6 +1605,17 @@ msg_composer_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); } +static gboolean +msg_composer_delete_event_cb (GtkWidget *widget, gpointer user_data) +{ + /* This is needed for the ACTION macro. */ + EMsgComposer *composer = E_MSG_COMPOSER (widget); + + gtk_action_activate (ACTION (CLOSE)); + + return FALSE; +} + static void msg_composer_constructed (GObject *object) { @@ -1643,6 +1654,9 @@ msg_composer_constructed (GObject *object) gtk_window_set_title (GTK_WINDOW (composer), _("Compose Message")); gtk_window_set_icon_name (GTK_WINDOW (composer), "mail-message-new"); + g_signal_connect (object, "delete-event", + G_CALLBACK (msg_composer_delete_event_cb), NULL); + e_shell_watch_window (shell, GTK_WINDOW (object)); /* Restore Persistent State */ @@ -1801,18 +1815,6 @@ msg_composer_map (GtkWidget *widget) gtkhtml_editor_run_command (GTKHTML_EDITOR (widget), "grab-focus"); } -static gint -msg_composer_delete_event (GtkWidget *widget, - GdkEventAny *event) -{ - /* This is needed for the ACTION macro. */ - EMsgComposer *composer = E_MSG_COMPOSER (widget); - - gtk_action_activate (ACTION (CLOSE)); - - return TRUE; -} - static gboolean msg_composer_key_press_event (GtkWidget *widget, GdkEventKey *event) @@ -2094,7 +2096,6 @@ msg_composer_class_init (EMsgComposerClass *class) widget_class = GTK_WIDGET_CLASS (class); widget_class->map = msg_composer_map; - widget_class->delete_event = msg_composer_delete_event; widget_class->key_press_event = msg_composer_key_press_event; widget_class->drag_motion = msg_composer_drag_motion; widget_class->drag_data_received = msg_composer_drag_data_received; |