aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-05-16 22:54:55 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-05-16 22:54:55 +0800
commitaad3ac6ddd62d5cd1b3421f5bf45ccdcf1b0ed35 (patch)
tree022b30eaf1dad44f44efac106296c6a7ea7955fb
parent9b864ecd40139b61c89c459e4feb093c5b49d14b (diff)
downloadgsoc2013-evolution-aad3ac6ddd62d5cd1b3421f5bf45ccdcf1b0ed35.tar.gz
gsoc2013-evolution-aad3ac6ddd62d5cd1b3421f5bf45ccdcf1b0ed35.tar.zst
gsoc2013-evolution-aad3ac6ddd62d5cd1b3421f5bf45ccdcf1b0ed35.zip
Ask e_shell_prepare_for_quit() before destroying the view if it's the last
* e-shell.c (view_delete_event_cb): Ask e_shell_prepare_for_quit() before destroying the view if it's the last one. * e-shell-view-menu.c (command_close): Synthesize a delete_event on the view instead of directly destroying it. svn path=/trunk/; revision=16931
-rw-r--r--shell/ChangeLog8
-rw-r--r--shell/e-shell-view-menu.c9
-rw-r--r--shell/e-shell.c13
3 files changed, 27 insertions, 3 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 421bd64a6b..ed436547f3 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,11 @@
+2002-05-16 Ettore Perazzoli <ettore@ximian.com>
+
+ * e-shell.c (view_delete_event_cb): Ask e_shell_prepare_for_quit()
+ before destroying the view if it's the last one.
+
+ * e-shell-view-menu.c (command_close): Synthesize a delete_event
+ on the view instead of directly destroying it.
+
2002-05-15 Ettore Perazzoli <ettore@ximian.com>
* e-shell-view-menu.c (command_quit): Check with
diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c
index efbb5898a5..52261abc1f 100644
--- a/shell/e-shell-view-menu.c
+++ b/shell/e-shell-view-menu.c
@@ -130,10 +130,17 @@ command_close (BonoboUIComponent *uih,
const char *path)
{
EShellView *shell_view;
+ GdkEvent delete_event;
shell_view = E_SHELL_VIEW (data);
- gtk_object_destroy (GTK_OBJECT (shell_view));
+ /* Send a delete_event to the window. This way we make sure that the
+ behaviors for delete_event and the menu item are the same. */
+
+ delete_event.any.type = GDK_DELETE;
+ delete_event.any.window = GTK_WIDGET (shell_view)->window;
+ delete_event.any.send_event = 0;
+ gtk_widget_event (GTK_WIDGET (shell_view), &delete_event);
}
static void
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 6353a45f55..3799a2b513 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -953,8 +953,17 @@ view_delete_event_cb (GtkWidget *widget,
shell = E_SHELL (data);
e_shell_save_settings (shell);
- /* Destroy it */
- return FALSE;
+ if (g_list_length (shell->priv->views) != 1) {
+ /* If it's not the last view, just destroy it. */
+ return FALSE;
+ }
+
+ /* If it's the last view, ask for confirm before actually destroying
+ this view. */
+ if (e_shell_prepare_for_quit (shell))
+ return FALSE;
+ else
+ return TRUE;
}
static void