diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-09-04 21:48:24 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-10-06 20:16:21 +0800 |
commit | 224f26b84d9c12b0dd1d337f51c14b6ebb901007 (patch) | |
tree | c88109d0fe00df4b14dcf1ce641cd5ed91013f0f /shell/e-shell-window.c | |
parent | da3e201c064f877c884befc0a0b434619b056e09 (diff) | |
download | gsoc2013-evolution-224f26b84d9c12b0dd1d337f51c14b6ebb901007.tar.gz gsoc2013-evolution-224f26b84d9c12b0dd1d337f51c14b6ebb901007.tar.zst gsoc2013-evolution-224f26b84d9c12b0dd1d337f51c14b6ebb901007.zip |
GtkApplication has some new EShell-like features.
I pushed a few EShell features up to GtkApplication for GTK+ 3.2,
so we can now trim off the redundancies in EShell.
1) GtkApplication has a new "window-added" signal which replaces
EShell's own "window-created" signal.
2) GtkApplication has a new "window-removed" signal which replaces
EShell's own "window-destroyed" signal.
3) gtk_application_get_windows() now returns a list of windows sorted
by most recently focused, replacing e_shell_get_watched_windows().
4) GtkApplication now provides enough hooks to subclasses that we can
remove e_shell_watch_window() and call gtk_application_add_window()
directly.
Diffstat (limited to 'shell/e-shell-window.c')
-rw-r--r-- | shell/e-shell-window.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 8e9f39c5ce..1a969de8c9 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -125,17 +125,20 @@ static void shell_window_update_close_action_cb (EShellWindow *shell_window) { EShell *shell; - GList *watched_windows; + GtkApplication *application; + GList *list; gint n_shell_windows = 0; shell = e_shell_window_get_shell (shell_window); - watched_windows = e_shell_get_watched_windows (shell); + + application = GTK_APPLICATION (shell); + list = gtk_application_get_windows (application); /* Count the shell windows. */ - while (watched_windows != NULL) { - if (E_IS_SHELL_WINDOW (watched_windows->data)) + while (list != NULL) { + if (E_IS_SHELL_WINDOW (list->data)) n_shell_windows++; - watched_windows = g_list_next (watched_windows); + list = g_list_next (list); } /* Disable Close Window if there's only one shell window. @@ -171,14 +174,14 @@ shell_window_set_shell (EShellWindow *shell_window, array = shell_window->priv->signal_handler_ids; handler_id = g_signal_connect_swapped ( - shell, "window-created", + shell, "window-added", G_CALLBACK (shell_window_update_close_action_cb), shell_window); g_array_append_val (array, handler_id); handler_id = g_signal_connect_swapped ( - shell, "window-destroyed", + shell, "window-removed", G_CALLBACK (shell_window_update_close_action_cb), shell_window); @@ -1510,9 +1513,9 @@ e_shell_window_set_toolbar_visible (EShellWindow *shell_window, * Registers a list of #GtkAction<!-- -->s to appear in * @shell_window<!-- -->'s "New" menu and toolbar button. This * function should be called from an #EShell<!-- -->'s - * #EShell::window-created signal handler. The #EShellBackend calling - * this function should pass its own name for the @backend_name argument - * (i.e. the <structfield>name</structfield> field from its own + * #GtkApplication::window-added signal handler. The #EShellBackend + * calling this function should pass its own name for the @backend_name + * argument (i.e. the <structfield>name</structfield> field from its own * #EShellBackendInfo). * * The registered #GtkAction<!-- -->s should be for creating individual @@ -1597,9 +1600,9 @@ e_shell_window_register_new_item_actions (EShellWindow *shell_window, * Registers a list of #GtkAction<!-- -->s to appear in * @shell_window<!-- -->'s "New" menu and toolbar button. This * function should be called from an #EShell<!-- -->'s - * #EShell::window-created signal handler. The #EShellBackend calling - * this function should pass its own name for the @backend_name argument - * (i.e. the <structfield>name</structfield> field from its own + * #GtkApplication::window-added signal handler. The #EShellBackend + * calling this function should pass its own name for the @backend_name + * argument (i.e. the <structfield>name</structfield> field from its own * #EShellBackendInfo). * * The registered #GtkAction<!-- -->s should be for creating item |