aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-05-21 23:32:57 +0800
committerMilan Crha <mcrha@redhat.com>2010-05-21 23:32:57 +0800
commit8e3af3094e48e026cf52c584da50e8b600c4a216 (patch)
tree8cb941a7e4294e266c2ecbebd17ad622b07ed9bf /composer/e-msg-composer.c
parenta5d79e9f915dc49ef0259ce7681c1f552c335a4c (diff)
downloadgsoc2013-evolution-8e3af3094e48e026cf52c584da50e8b600c4a216.tar.gz
gsoc2013-evolution-8e3af3094e48e026cf52c584da50e8b600c4a216.tar.zst
gsoc2013-evolution-8e3af3094e48e026cf52c584da50e8b600c4a216.zip
Bug #617557 - Quits without asking user to save unfinished messages
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index b588fd0977..36100621fe 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1629,6 +1629,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)
{
@@ -1667,6 +1678,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 */
@@ -1821,18 +1835,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)
@@ -2114,7 +2116,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;