aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-09-18 06:53:40 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-09-18 06:53:40 +0800
commit431cf62eb65a6b7e470bde0034b61fa018fe2049 (patch)
treefb323d848bc721528284a57a21cec61289e0cbfb
parented0347eacebd893fc25221d55fa3040b4248ce2e (diff)
downloadgsoc2013-evolution-431cf62eb65a6b7e470bde0034b61fa018fe2049.tar
gsoc2013-evolution-431cf62eb65a6b7e470bde0034b61fa018fe2049.tar.gz
gsoc2013-evolution-431cf62eb65a6b7e470bde0034b61fa018fe2049.tar.bz2
gsoc2013-evolution-431cf62eb65a6b7e470bde0034b61fa018fe2049.tar.lz
gsoc2013-evolution-431cf62eb65a6b7e470bde0034b61fa018fe2049.tar.xz
gsoc2013-evolution-431cf62eb65a6b7e470bde0034b61fa018fe2049.tar.zst
gsoc2013-evolution-431cf62eb65a6b7e470bde0034b61fa018fe2049.zip
New. (quit_box_destroyed_callback): New. (no_views_left_cb): Use these two
* main.c (quit_box_new): New. (quit_box_destroyed_callback): New. (no_views_left_cb): Use these two functions to display a warning message when Evolution is quitting. svn path=/trunk/; revision=12917
-rw-r--r--shell/ChangeLog7
-rw-r--r--shell/main.c55
2 files changed, 61 insertions, 1 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 97d964b872..c8e0ee5130 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,12 @@
2001-09-17 Ettore Perazzoli <ettore@ximian.com>
+ * main.c (quit_box_new): New.
+ (quit_box_destroyed_callback): New.
+ (no_views_left_cb): Use these two functions to display a warning
+ message when Evolution is quitting.
+
+2001-09-17 Ettore Perazzoli <ettore@ximian.com>
+
* e-shell.c (impl_Shell_getLocalStorage): Only raise NotReady if
the local storage pointer is actually NULL. This way it is
possible for the components to access the local storage during
diff --git a/shell/main.c b/shell/main.c
index 95f0cb3454..b39ae83cba 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -24,9 +24,13 @@
#include <config.h>
#include <fcntl.h>
#include <glib.h>
-#include <gtk/gtkmain.h>
+
+#include <gtk/gtkframe.h>
#include <gtk/gtklabel.h>
+#include <gtk/gtkmain.h>
#include <gtk/gtksignal.h>
+#include <gtk/gtkwindow.h>
+
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
@@ -54,9 +58,55 @@ static gboolean no_splash = FALSE;
extern char *evolution_debug_log;
+static GtkWidget *
+quit_box_new (void)
+{
+ GtkWidget *window;
+ GtkWidget *label;
+ GtkWidget *frame;
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
+
+ gtk_window_set_title (GTK_WINDOW (window), _("Evolution"));
+
+ frame = gtk_frame_new (NULL);
+ gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
+ gtk_container_add (GTK_CONTAINER (window), frame);
+
+ label = gtk_label_new (_("Evolution is now exiting ..."));
+ gtk_misc_set_padding (GTK_MISC (label), 30, 25);
+
+ gtk_container_add (GTK_CONTAINER (frame), label);
+
+ gtk_widget_show (frame);
+ gtk_widget_show (label);
+ gtk_widget_show (window);
+
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
+
+ return window;
+}
+
+static void
+quit_box_destroyed_callback (GtkObject *object,
+ void *data)
+{
+ GtkWidget **p;
+
+ p = (GtkWidget **) data;
+ *p = NULL;
+}
+
static void
no_views_left_cb (EShell *shell, gpointer data)
{
+ GtkWidget *quit_box;
+
+ quit_box = quit_box_new ();
+ gtk_signal_connect (GTK_OBJECT (quit_box), "destroy", quit_box_destroyed_callback, &quit_box);
+
/* FIXME: This is wrong. We should exit only when the shell is
destroyed. But refcounting is broken at present, so this is a
reasonable workaround for now. */
@@ -65,6 +115,9 @@ no_views_left_cb (EShell *shell, gpointer data)
bonobo_object_unref (BONOBO_OBJECT (shell));
+ if (quit_box != NULL)
+ gtk_widget_destroy (quit_box);
+
gtk_main_quit ();
}