[evolution] Bug #617557 - Quits without asking user to save unfinished messages



commit 8e3af3094e48e026cf52c584da50e8b600c4a216
Author: Milan Crha <mcrha redhat com>
Date:   Fri May 21 17:32:57 2010 +0200

    Bug #617557 - Quits without asking user to save unfinished messages

 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 b588fd0..3610062 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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]