aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/gui/component/autocompletion-config.c4
-rw-r--r--calendar/modules/e-cal-shell-module.c4
-rw-r--r--doc/reference/shell/tmpl/e-shell.sgml1
-rw-r--r--mail/e-mail-shell-module.c2
-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
-rw-r--r--smime/gui/certificate-manager.c4
9 files changed, 37 insertions, 16 deletions
diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c
index 018a2fd8f7..a58e1f3195 100644
--- a/addressbook/gui/component/autocompletion-config.c
+++ b/addressbook/gui/component/autocompletion-config.c
@@ -99,6 +99,7 @@ autocompletion_config_init (void)
GtkWidget *scrolled_window;
GtkWidget *source_selector;
GtkWidget *preferences_window;
+ EShell *shell;
source_list = e_source_list_new_for_gconf_default (
"/apps/evolution/addressbook/sources");
@@ -124,7 +125,8 @@ autocompletion_config_init (void)
initialize_selection (E_SOURCE_SELECTOR (source_selector));
- preferences_window = e_shell_get_preferences_window ();
+ shell = e_shell_get_default ();
+ preferences_window = e_shell_get_preferences_window (shell);
e_preferences_window_add_page (
E_PREFERENCES_WINDOW (preferences_window),
diff --git a/calendar/modules/e-cal-shell-module.c b/calendar/modules/e-cal-shell-module.c
index 0fa0336177..740f755e85 100644
--- a/calendar/modules/e-cal-shell-module.c
+++ b/calendar/modules/e-cal-shell-module.c
@@ -431,8 +431,10 @@ static void
cal_module_init_preferences (void)
{
GtkWidget *preferences_window;
+ EShell *shell;
- preferences_window = e_shell_get_preferences_window ();
+ shell = e_shell_get_default ();
+ preferences_window = e_shell_get_preferences_window (shell);
e_preferences_window_add_page (
E_PREFERENCES_WINDOW (preferences_window),
diff --git a/doc/reference/shell/tmpl/e-shell.sgml b/doc/reference/shell/tmpl/e-shell.sgml
index 9e04bbff53..04935e1de6 100644
--- a/doc/reference/shell/tmpl/e-shell.sgml
+++ b/doc/reference/shell/tmpl/e-shell.sgml
@@ -247,6 +247,7 @@ EShell
</para>
+@shell:
@Returns:
diff --git a/mail/e-mail-shell-module.c b/mail/e-mail-shell-module.c
index b65cb2ce31..cdbfeac0f0 100644
--- a/mail/e-mail-shell-module.c
+++ b/mail/e-mail-shell-module.c
@@ -483,7 +483,7 @@ mail_shell_module_init_preferences (EShell *shell)
{
GtkWidget *preferences_window;
- preferences_window = e_shell_get_preferences_window ();
+ preferences_window = e_shell_get_preferences_window (shell);
e_preferences_window_add_page (
E_PREFERENCES_WINDOW (preferences_window),
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);
diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c
index 63604eb67f..c8c45b7070 100644
--- a/smime/gui/certificate-manager.c
+++ b/smime/gui/certificate-manager.c
@@ -982,6 +982,7 @@ certificate_manager_config_init (void)
CertificateManagerData *cfm_data;
GtkWidget *preferences_window;
GtkWidget *widget;
+ EShell *shell;
char *gladefile;
/* We need to peek the db here to make sure it (and NSS) are fully initialized. */
@@ -1030,7 +1031,8 @@ certificate_manager_config_init (void)
gtk_widget_set_sensitive(cfm_data->backup_your_button, FALSE);
gtk_widget_set_sensitive(cfm_data->backup_all_your_button, FALSE);
- preferences_window = e_shell_get_preferences_window ();
+ shell = e_shell_get_default ();
+ preferences_window = e_shell_get_preferences_window (shell);
e_preferences_window_add_page (
E_PREFERENCES_WINDOW (preferences_window),
"certificates",