diff options
author | Srinivasa Ragavan <sragavan@gnome.org> | 2010-04-22 19:57:20 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@gnome.org> | 2010-04-22 19:57:20 +0800 |
commit | a650f15f0090d68a503b5b11561bfb3cdb4663dc (patch) | |
tree | 9485cefe48dbc82b8e2fe0b6aa0d2b5069481923 | |
parent | ae650132caebf75728020f95fd48c7cb9c32c047 (diff) | |
download | gsoc2013-evolution-a650f15f0090d68a503b5b11561bfb3cdb4663dc.tar.gz gsoc2013-evolution-a650f15f0090d68a503b5b11561bfb3cdb4663dc.tar.zst gsoc2013-evolution-a650f15f0090d68a503b5b11561bfb3cdb4663dc.zip |
Store the initial view request and use that to decide whether to show
startup wizard or not. Show only for mail and not calendar.
-rw-r--r-- | plugins/startup-wizard/startup-wizard.c | 8 | ||||
-rw-r--r-- | shell/e-shell.c | 23 | ||||
-rw-r--r-- | shell/e-shell.h | 3 | ||||
-rw-r--r-- | shell/main.c | 5 |
4 files changed, 39 insertions, 0 deletions
diff --git a/plugins/startup-wizard/startup-wizard.c b/plugins/startup-wizard/startup-wizard.c index a38b2d9e9a..97d2297480 100644 --- a/plugins/startup-wizard/startup-wizard.c +++ b/plugins/startup-wizard/startup-wizard.c @@ -66,7 +66,15 @@ startup_wizard (EPlugin *ep, ESEventTargetUpgrade *target) GSList *accounts; EConfig *config; EMAccountEditor *emae; + char *req_view; + req_view = e_shell_get_startup_view(e_shell_get_default()); + + if (req_view && strcmp (req_view, "mail") && e_shell_get_express_mode(e_shell_get_default())) { + return; + } + + client = gconf_client_get_default (); accounts = gconf_client_get_list (client, "/apps/evolution/mail/accounts", GCONF_VALUE_STRING, NULL); g_object_unref (client); diff --git a/shell/e-shell.c b/shell/e-shell.c index 7f291745e3..d238f22e3b 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -61,6 +61,8 @@ struct _EShellPrivate { gchar *geometry; gchar *module_directory; + + gchar *startup_view; guint auto_reconnect : 1; guint network_available : 1; @@ -617,6 +619,11 @@ shell_dispose (GObject *object) priv = E_SHELL_GET_PRIVATE (object); + if (priv->startup_view != NULL) { + g_free (priv->startup_view); + priv->startup_view = NULL; + } + if (priv->settings != NULL) { g_object_unref (priv->settings); priv->settings = NULL; @@ -1153,6 +1160,8 @@ e_shell_init (EShell *shell) shell->priv->backends_by_scheme = backends_by_scheme; shell->priv->safe_mode = e_file_lock_exists (); + shell->priv->startup_view = NULL; + g_object_ref_sink (shell->priv->preferences_window); /* Add our icon directory to the theme's search path @@ -1936,3 +1945,17 @@ e_shell_adapt_window_size (EShell *shell, gtk_window_set_decorated (window, FALSE); gtk_window_maximize (window); } + +void +e_shell_set_startup_view (EShell *shell, + const char *view) +{ + shell->priv->startup_view = g_strdup(view); +} + + +const char * +e_shell_get_startup_view (EShell *shell) +{ + return shell->priv->startup_view; +} diff --git a/shell/e-shell.h b/shell/e-shell.h index 1b191e4efb..0b8c3336c8 100644 --- a/shell/e-shell.h +++ b/shell/e-shell.h @@ -127,6 +127,9 @@ void e_shell_cancel_quit (EShell *shell); void e_shell_adapt_window_size (EShell *shell, GtkWindow *window); +void e_shell_set_startup_view (EShell *shell, + const char *view); +const char * e_shell_get_startup_view (EShell *shell); G_END_DECLS diff --git a/shell/main.c b/shell/main.c index 5a9855b402..e327065f43 100644 --- a/shell/main.c +++ b/shell/main.c @@ -576,6 +576,11 @@ main (gint argc, gchar **argv) e_plugin_load_plugins (); } + if (requested_view) + e_shell_set_startup_view(shell, requested_view); + else if (express_mode) + e_shell_set_startup_view(shell, "mail"); + /* Attempt migration -after- loading all modules and plugins, * as both shell backends and certain plugins hook into this. */ e_shell_migrate_attempt (shell); |