diff options
-rw-r--r-- | shell/ChangeLog | 9 | ||||
-rw-r--r-- | shell/e-shell-view.c | 39 | ||||
-rw-r--r-- | shell/main.c | 21 |
3 files changed, 44 insertions, 25 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 7e5931705e..956827b95f 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,14 @@ 2003-01-10 Ettore Perazzoli <ettore@ximian.com> + * main.c (main): Generate the URI list from the popt context + fetched from the GnomeProgram object. + + * e-shell-view.c (setup_defaults): Removed @setup_default_uri arg. + Don't load any URI here. + (e_shell_view_construct): Open the URI here instead. + +2003-01-10 Ettore Perazzoli <ettore@ximian.com> + * e-shell.c (parse_default_uri): Remove bogus is_default check. 2003-01-10 Ettore Perazzoli <ettore@ximian.com> diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 275fa285ff..e0c2d1f206 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -381,16 +381,13 @@ remove_uri_from_history (EShellView *shell_view, static void -setup_defaults (EShellView *shell_view, - gboolean setup_default_uri) +setup_defaults (EShellView *shell_view) { EShellViewPrivate *priv; EShortcutBar *shortcut_bar; GConfClient *client; GSList *icon_types_list; GSList *p; - char *path; - char *uri; int shortcut_group; int width; int i; @@ -425,19 +422,6 @@ setup_defaults (EShellView *shell_view, e_paned_set_position (E_PANED (priv->view_hpaned), width); priv->view_hpaned_position = width; - if (setup_default_uri) { - path = gconf_client_get_string (client, "/apps/evolution/shell/view_defaults/folder_path", NULL); - uri = g_strconcat (E_SHELL_URI_PREFIX, path, NULL); - - if (! e_shell_view_display_uri (shell_view, uri, FALSE)) { - e_shell_view_display_uri (shell_view, E_SHELL_VIEW_DEFAULT_URI, FALSE); - e_shell_view_display_uri (shell_view, uri, TRUE); - } - - g_free (path); - g_free (uri); - } - icon_types_list = gconf_client_get_list (client, "/apps/evolution/shell/view_defaults/shortcut_bar/icon_types", GCONF_VALUE_INT, NULL); for (p = icon_types_list, i = 0; p != NULL; p = p->next, i++) @@ -1765,6 +1749,7 @@ e_shell_view_construct (EShellView *shell_view, { EShellViewPrivate *priv; EShellView *view; + char *uri_to_load; g_return_val_if_fail (shell != NULL, NULL); g_return_val_if_fail (shell_view != NULL, NULL); @@ -1824,7 +1809,25 @@ e_shell_view_construct (EShellView *shell_view, e_shell_user_creatable_items_handler_attach_menus (e_shell_get_user_creatable_items_handler (priv->shell), shell_view); - setup_defaults (view, uri != NULL); + setup_defaults (view); + + if (uri != NULL) { + uri_to_load = g_strdup (uri); + } else { + GConfClient *client = gconf_client_get_default (); + char *path = gconf_client_get_string (client, "/apps/evolution/shell/view_defaults/folder_path", NULL); + + uri_to_load = g_strconcat (E_SHELL_URI_PREFIX, path, NULL); + g_free (path); + g_object_unref (client); + } + + if (! e_shell_view_display_uri (shell_view, uri_to_load, FALSE)) { + e_shell_view_display_uri (shell_view, E_SHELL_VIEW_DEFAULT_URI, FALSE); + e_shell_view_display_uri (shell_view, uri_to_load, TRUE); + } + + g_free (uri_to_load); return view; } diff --git a/shell/main.c b/shell/main.c index 10de4e9be3..de11af7b8b 100644 --- a/shell/main.c +++ b/shell/main.c @@ -456,6 +456,10 @@ main (int argc, char **argv) { NULL, '\0', 0, NULL, 0, NULL, NULL } }; GSList *uri_list; + GValue popt_context_value = { 0, }; + GnomeProgram *program; + poptContext popt_context; + const char **args; /* Make ElectricFence work. */ free (malloc (10)); @@ -464,11 +468,11 @@ main (int argc, char **argv) bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); - gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv, - GNOME_PROGRAM_STANDARD_PROPERTIES, - GNOME_PARAM_POPT_TABLE, options, - GNOME_PARAM_HUMAN_READABLE_NAME, _("Evolution"), - NULL); + program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv, + GNOME_PROGRAM_STANDARD_PROPERTIES, + GNOME_PARAM_POPT_TABLE, options, + GNOME_PARAM_HUMAN_READABLE_NAME, _("Evolution"), + NULL); if (start_online && start_offline) { fprintf (stderr, _("%s: --online and --offline cannot be used together.\n Use %s --help for more information.\n"), @@ -502,7 +506,9 @@ main (int argc, char **argv) uri_list = NULL; -#if 0 + g_value_init (&popt_context_value, G_TYPE_POINTER); + g_object_get_property (G_OBJECT (program), GNOME_PARAM_POPT_CONTEXT, &popt_context_value); + popt_context = g_value_get_pointer (&popt_context_value); args = poptGetArgs (popt_context); if (args != NULL) { const char **p; @@ -510,7 +516,8 @@ main (int argc, char **argv) for (p = args; *p != NULL; p++) uri_list = g_slist_prepend (uri_list, (char *) *p); } -#endif + uri_list = g_slist_reverse (uri_list); + g_value_unset (&popt_context_value); gtk_idle_add (idle_cb, uri_list); |