aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-24 09:59:58 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:19 +0800
commit3cd0ca95df5c6c1cb4b4433a0de35ff6377560ee (patch)
treeea3ac507f1964299156b435d1537c9edfcc97eb8 /shell
parent7050475f84247fb15e24aa1bb31502106c18815d (diff)
downloadgsoc2013-evolution-3cd0ca95df5c6c1cb4b4433a0de35ff6377560ee.tar
gsoc2013-evolution-3cd0ca95df5c6c1cb4b4433a0de35ff6377560ee.tar.gz
gsoc2013-evolution-3cd0ca95df5c6c1cb4b4433a0de35ff6377560ee.tar.bz2
gsoc2013-evolution-3cd0ca95df5c6c1cb4b4433a0de35ff6377560ee.tar.lz
gsoc2013-evolution-3cd0ca95df5c6c1cb4b4433a0de35ff6377560ee.tar.xz
gsoc2013-evolution-3cd0ca95df5c6c1cb4b4433a0de35ff6377560ee.tar.zst
gsoc2013-evolution-3cd0ca95df5c6c1cb4b4433a0de35ff6377560ee.zip
Bug 649993 - Change behavior of --component option
This is primarily for the GNOME Shell calendar. If, for example, "evolution --component calendar" is invoked and there is already an Evolution window opened to the calendar view, present that window. Otherwise open a new Evolution window to the requested view. Same behavior applies to all requested views.
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c
index eb3cb8e407..60f145e7d0 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -229,9 +229,31 @@ shell_action_new_window_cb (GSimpleAction *action,
GVariant *parameter,
EShell *shell)
{
+ GList *watched_windows;
const gchar *view_name;
view_name = g_variant_get_string (parameter, NULL);
+ watched_windows = e_shell_get_watched_windows (shell);
+
+ /* Present the first EShellWindow showing 'view_name'. */
+ while (watched_windows != NULL) {
+ GtkWindow *window = GTK_WINDOW (watched_windows->data);
+
+ if (E_IS_SHELL_WINDOW (window)) {
+ const gchar *active_view;
+
+ active_view = e_shell_window_get_active_view (
+ E_SHELL_WINDOW (window));
+ if (g_strcmp0 (active_view, view_name) == 0) {
+ gtk_window_present (window);
+ return;
+ }
+ }
+
+ watched_windows = g_list_next (watched_windows);
+ }
+
+ /* No suitable EShellWindow found, so create one. */
e_shell_create_shell_window (shell, view_name);
}