diff options
author | Milan Crha <mcrha@redhat.com> | 2008-01-03 18:20:36 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-01-03 18:20:36 +0800 |
commit | 6cf9a97579df7e95363088485a2e6f2b833ba975 (patch) | |
tree | bbe2a0fbb7caa4e0130faf2b4929673e2fa0b7b9 /shell/e-shell.c | |
parent | 7e71a8819e5a7bddc0046d9f1e995f248ee428df (diff) | |
download | gsoc2013-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/e-shell.c')
-rw-r--r-- | shell/e-shell.c | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c index 51ab69c8c1..cd34d2e03d 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -1334,7 +1334,7 @@ es_run_quit(EShell *shell) } gboolean -e_shell_quit(EShell *shell) +e_shell_can_quit (EShell *shell) { EShellPrivate *priv; GSList *component_infos; @@ -1368,23 +1368,44 @@ e_shell_quit(EShell *shell) break; } - if (can_quit) { - GList *p = shell->priv->windows; + return can_quit; +} - for (; p != NULL; p = p->next) { - gtk_widget_set_sensitive (GTK_WIDGET (p->data), FALSE); - if (p == shell->priv->windows) - e_shell_window_save_defaults (p->data); - } - can_quit = !es_run_quit(shell); +gboolean +e_shell_do_quit (EShell *shell) +{ + EShellPrivate *priv; + GList *p; + gboolean can_quit; + + g_return_val_if_fail (E_IS_SHELL (shell), FALSE); + + priv = shell->priv; - /* Mark a safe quit by destroying the lock. */ - e_file_lock_destroy (); + if (priv->preparing_to_quit) + return FALSE; + + for (p = shell->priv->windows; p != NULL; p = p->next) { + gtk_widget_set_sensitive (GTK_WIDGET (p->data), FALSE); + + if (p == shell->priv->windows) + e_shell_window_save_defaults (p->data); } + can_quit = !es_run_quit (shell); + + /* Mark a safe quit by destroying the lock. */ + e_file_lock_destroy (); + return can_quit; } +gboolean +e_shell_quit (EShell *shell) +{ + return e_shell_can_quit (shell) && e_shell_do_quit (shell); +} + /** * gboolean (*EMainShellFunc) (EShell *shell, EShellWindow *window, gpointer user_data); * Function used in @ref e_shell_foreach_shell_window. |