aboutsummaryrefslogtreecommitdiffstats
path: root/shell/main.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-01-03 18:20:36 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-01-03 18:20:36 +0800
commit6cf9a97579df7e95363088485a2e6f2b833ba975 (patch)
treebbe2a0fbb7caa4e0130faf2b4929673e2fa0b7b9 /shell/main.c
parent7e71a8819e5a7bddc0046d9f1e995f248ee428df (diff)
downloadgsoc2013-evolution-6cf9a97579df7e95363088485a2e6f2b833ba975.tar.gz
gsoc2013-evolution-6cf9a97579df7e95363088485a2e6f2b833ba975.tar.zst
gsoc2013-evolution-6cf9a97579df7e95363088485a2e6f2b833ba975.zip
** Fix for bug #219197
2008-01-03 Milan Crha <mcrha@redhat.com> ** Fix for bug #219197 * e-shell.h: * e-shell.c: (e_shell_can_quit), (e_shell_do_quit), (e_shell_quit): Call of e_shell_quit divided into two functions, one to check if quit is acceptable by all components and second to do quit. * main.c: (gnome_master_client_save_yourself_cb), (gnome_master_client_die_cb), (main): Quit application when session dies. svn path=/trunk/; revision=34754
Diffstat (limited to 'shell/main.c')
-rw-r--r--shell/main.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/shell/main.c b/shell/main.c
index bbbd27d62c..8041c73043 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -61,6 +61,7 @@
#include <libgnome/gnome-util.h>
#include <libgnome/gnome-sound.h>
#include <libgnomeui/gnome-ui-init.h>
+#include <libgnomeui/gnome-client.h>
#include <bonobo/bonobo-main.h>
#include <bonobo/bonobo-moniker-util.h>
@@ -549,6 +550,18 @@ setup_segv_redirect (void)
#define setup_segv_redirect() 0
#endif
+static gint
+gnome_master_client_save_yourself_cb (GnomeClient *client, GnomeSaveStyle save_style, gint shutdown, GnomeInteractStyle interact_style, gint fast, gpointer user_data)
+{
+ return !shell || e_shell_can_quit (shell);
+}
+
+static void
+gnome_master_client_die_cb (GnomeClient *client)
+{
+ e_shell_do_quit (shell);
+}
+
static const GOptionEntry options[] = {
{ "component", 'c', 0, G_OPTION_ARG_STRING, &default_component_id,
N_("Start Evolution activating the specified component"), NULL },
@@ -588,6 +601,7 @@ main (int argc, char **argv)
gboolean skip_warning_dialog;
#endif
GnomeProgram *program;
+ GnomeClient *master_client;
GOptionContext *context;
char *filename;
@@ -657,6 +671,11 @@ main (int argc, char **argv)
g_warning ("Could not set up debugging output file.");
}
+ master_client = gnome_master_client ();
+
+ g_signal_connect (G_OBJECT (master_client), "save_yourself", G_CALLBACK (gnome_master_client_save_yourself_cb), NULL);
+ g_signal_connect (G_OBJECT (master_client), "die", G_CALLBACK (gnome_master_client_die_cb), NULL);
+
glade_init ();
e_cursors_init ();
e_icon_factory_init ();