aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-window.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-01-29 06:28:57 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-01-29 06:28:57 +0800
commit70fce0bbb0712dc70a15c481c0b65d68a98a4ff7 (patch)
tree51b39245f74e32ac2878e4f65492e895a1ad0eb8 /shell/e-shell-window.c
parent533d59e2cd30ba79a99a71907ffdda65505e633a (diff)
downloadgsoc2013-evolution-70fce0bbb0712dc70a15c481c0b65d68a98a4ff7.tar
gsoc2013-evolution-70fce0bbb0712dc70a15c481c0b65d68a98a4ff7.tar.gz
gsoc2013-evolution-70fce0bbb0712dc70a15c481c0b65d68a98a4ff7.tar.bz2
gsoc2013-evolution-70fce0bbb0712dc70a15c481c0b65d68a98a4ff7.tar.lz
gsoc2013-evolution-70fce0bbb0712dc70a15c481c0b65d68a98a4ff7.tar.xz
gsoc2013-evolution-70fce0bbb0712dc70a15c481c0b65d68a98a4ff7.tar.zst
gsoc2013-evolution-70fce0bbb0712dc70a15c481c0b65d68a98a4ff7.zip
When invoking Evolution with URIs on the command-line (e.g. mailto:),
terminate after all the windows for those URIs have been closed. svn path=/branches/kill-bonobo/; revision=37157
Diffstat (limited to 'shell/e-shell-window.c')
-rw-r--r--shell/e-shell-window.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 82727fecdd..ecc30cb9b5 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -132,17 +132,22 @@ static void
shell_window_update_close_action_cb (EShellWindow *shell_window)
{
EShell *shell;
- GList *shell_windows;
- gboolean sensitive;
+ GList *watched_windows;
+ gint n_shell_windows = 0;
shell = e_shell_window_get_shell (shell_window);
- shell_windows = e_shell_get_shell_windows (shell);
- g_return_if_fail (shell_windows != NULL);
+ watched_windows = e_shell_get_watched_windows (shell);
- /* Disable Close Window if there's only one window.
+ /* Count the shell windows. */
+ while (watched_windows != NULL) {
+ if (E_IS_SHELL_WINDOW (watched_windows->data))
+ n_shell_windows++;
+ watched_windows = g_list_next (watched_windows);
+ }
+
+ /* Disable Close Window if there's only one shell window.
* Helps prevent users from accidentally quitting. */
- sensitive = (g_list_length (shell_windows) > 1);
- gtk_action_set_sensitive (ACTION (CLOSE), sensitive);
+ gtk_action_set_sensitive (ACTION (CLOSE), n_shell_windows > 1);
}
static void