aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-02-19 14:22:32 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-02-19 14:22:32 +0800
commit1a40acf554290883d6cf2a491dc36685842fd26b (patch)
treea920466e9b41ee104dd13d1335820770a17904a2 /shell
parent0110c94c6abdbb25b4fea6a21f20f00b82a0fdd8 (diff)
downloadgsoc2013-evolution-1a40acf554290883d6cf2a491dc36685842fd26b.tar.gz
gsoc2013-evolution-1a40acf554290883d6cf2a491dc36685842fd26b.tar.zst
gsoc2013-evolution-1a40acf554290883d6cf2a491dc36685842fd26b.zip
Documentation tweaks.
Have e_shell_get_preferences_window() take an EShell argument. svn path=/branches/kill-bonobo/; revision=37294
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-window-actions.c5
-rw-r--r--shell/e-shell-window.c5
-rw-r--r--shell/e-shell.c26
-rw-r--r--shell/e-shell.h2
4 files changed, 26 insertions, 12 deletions
diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c
index 2364a69e4b..30d171e759 100644
--- a/shell/e-shell-window-actions.c
+++ b/shell/e-shell-window-actions.c
@@ -888,9 +888,12 @@ static void
action_preferences_cb (GtkAction *action,
EShellWindow *shell_window)
{
+ EShell *shell;
GtkWidget *preferences_window;
- preferences_window = e_shell_get_preferences_window ();
+ shell = e_shell_window_get_shell (shell_window);
+ preferences_window = e_shell_get_preferences_window (shell);
+
gtk_window_set_transient_for (
GTK_WINDOW (preferences_window),
GTK_WINDOW (shell_window));
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index d6d49cfe3c..2de5349ecf 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -490,9 +490,8 @@ e_shell_window_get_shell_view (EShellWindow *shell_window,
*
* An #EShellWindow creates a #GtkRadioAction for each registered subclass
* of #EShellView. This action gets passed to the #EShellSwitcher, which
- * displays a button that proxies the action. The icon at the top of the
- * sidebar also proxies the action. When the #EShellView named @view_name
- * is active, the action's icon becomes the @shell_window icon.
+ * displays a button that proxies the action. When the #EShellView named
+ * @view_name is active, the action's icon becomes the @shell_window icon.
*
* Returns: the switcher action for the #EShellView named @view_name,
* or %NULL if no such shell view exists
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 3b5c78393d..fa25edd463 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -41,6 +41,7 @@ struct _EShellPrivate {
GList *watched_windows;
EShellSettings *settings;
GConfClient *gconf_client;
+ GtkWidget *preferences_window;
/* Shell Modules */
GList *loaded_modules;
@@ -465,6 +466,11 @@ shell_dispose (GObject *object)
priv->gconf_client = NULL;
}
+ if (priv->preferences_window != NULL) {
+ g_object_unref (priv->preferences_window);
+ priv->preferences_window = NULL;
+ }
+
g_list_foreach (
priv->loaded_modules,
(GFunc) g_type_module_unuse, NULL);
@@ -771,7 +777,7 @@ shell_class_init (EShellClass *class)
* EShell::window-destroyed
* @shell: the #EShell which emitted the signal
*
- * Emitted when an #EShellWindow is destroyed.
+ * Emitted when a watched is destroyed.
**/
signals[WINDOW_DESTROYED] = g_signal_new (
"window-destroyed",
@@ -837,6 +843,7 @@ shell_init (EShell *shell)
shell->priv->settings = g_object_new (E_TYPE_SHELL_SETTINGS, NULL);
shell->priv->gconf_client = gconf_client_get_default ();
+ shell->priv->preferences_window = e_preferences_window_new ();
shell->priv->modules_by_name = modules_by_name;
shell->priv->modules_by_scheme = modules_by_scheme;
shell->priv->safe_mode = e_file_lock_exists ();
@@ -1333,15 +1340,20 @@ e_shell_set_online (EShell *shell,
shell_prepare_for_offline (shell);
}
+/**
+ * e_shell_get_preferences_window:
+ * @shell: an #EShell
+ *
+ * Returns the Evolution Preferences window.
+ *
+ * Returns: the preferences window
+ **/
GtkWidget *
-e_shell_get_preferences_window (void)
+e_shell_get_preferences_window (EShell *shell)
{
- static GtkWidget *preferences_window = NULL;
-
- if (G_UNLIKELY (preferences_window == NULL))
- preferences_window = e_preferences_window_new ();
+ g_return_val_if_fail (E_IS_SHELL (shell), NULL);
- return preferences_window;
+ return shell->priv->preferences_window;
}
/**
diff --git a/shell/e-shell.h b/shell/e-shell.h
index 91ff459a65..16b26adce8 100644
--- a/shell/e-shell.h
+++ b/shell/e-shell.h
@@ -102,7 +102,7 @@ void e_shell_set_network_available (EShell *shell,
gboolean e_shell_get_online (EShell *shell);
void e_shell_set_online (EShell *shell,
gboolean online);
-GtkWidget * e_shell_get_preferences_window (void);
+GtkWidget * e_shell_get_preferences_window (EShell *shell);
void e_shell_event (EShell *shell,
const gchar *event_name,
gpointer event_data);