aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-04-09 22:59:26 +0800
committerDan Winship <danw@src.gnome.org>2002-04-09 22:59:26 +0800
commit2a3a53e9cf40ab9a43f7b6106019325990f7ac63 (patch)
treef3c1d989948a78a4b7fdc7220223bf155328a701 /shell/e-shell.c
parent73f6d42fbdab7797f61832db9540c65edb582b59 (diff)
downloadgsoc2013-evolution-2a3a53e9cf40ab9a43f7b6106019325990f7ac63.tar.gz
gsoc2013-evolution-2a3a53e9cf40ab9a43f7b6106019325990f7ac63.tar.zst
gsoc2013-evolution-2a3a53e9cf40ab9a43f7b6106019325990f7ac63.zip
Add a "view_info" argument.
* Evolution-ShellComponent.idl (createView): Add a "view_info" argument. * e-shell-view.c (get_view_for_uri): if the URI contains a '#', split it into a URI and a "view_info" at that point. (Otherwise, pass "" for the view_info to ShellComponent_createView.) This can be used for things like specifying day/month/week view to the calendar. * e-shell.c (create_view): Ignore e_shell_view_display_uri's return code: it's possible/likely that the requested URL is remote and hasn't been filled in yet. (impl_Shell_handleURI): Don't use Shell_createNewView directly, call e_shell_create_view_from_uri_and_settings. (For the above fix and some others.) * evolution-shell-component.c (impl_createView): Add view_info. * evolution-shell-component-client.c (evolution_shell_component_client_create_view): Add view_info. * evolution-test-component.c (create_view_fn): add view_data. * e-corba-storage-registry.c (impl_StorageRegistry_getFolderByUri): kill a warning svn path=/trunk/; revision=16397
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r--shell/e-shell.c53
1 files changed, 45 insertions, 8 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 36fc5f3049..a05e53e665 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -421,6 +421,43 @@ impl_Shell_createNewView (PortableServer_Servant servant,
}
static void
+handle_default_uri (EShell *shell, const char *uri, CORBA_Environment *ev)
+{
+ char *component, *dbpath, *extra_info, *new_uri;
+ gboolean def;
+
+ component = g_strdup (uri + E_SHELL_DEFAULTURI_PREFIX_LEN);
+ extra_info = strchr (component, '#');
+ if (extra_info)
+ *extra_info++ = '\0';
+
+ dbpath = g_strdup_printf ("/DefaultFolder/%s_path", component);
+ new_uri = bonobo_config_get_string_with_default (shell->priv->db,
+ dbpath, NULL, &def);
+ g_free (dbpath);
+
+ if (new_uri == NULL) {
+ CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
+ ex_GNOME_Evolution_Shell_NotFound, NULL);
+ g_free (component);
+ return;
+ }
+
+ if (extra_info) {
+ char *tmp;
+
+ tmp = new_uri;
+ new_uri = g_strdup_printf ("%s#%s", new_uri, extra_info);
+ g_free (tmp);
+ }
+
+ e_shell_create_view_from_uri_and_settings (shell, new_uri, 0);
+ g_free (new_uri);
+ g_free (component);
+ return;
+}
+
+static void
impl_Shell_handleURI (PortableServer_Servant servant,
const CORBA_char *uri,
CORBA_Environment *ev)
@@ -438,7 +475,12 @@ impl_Shell_handleURI (PortableServer_Servant servant,
priv = shell->priv;
if (strncmp (uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) == 0) {
- GNOME_Evolution_Shell_createNewView (bonobo_object_corba_objref (BONOBO_OBJECT (shell)), uri, ev);
+ e_shell_create_view_from_uri_and_settings (shell, uri, 0);
+ return;
+ }
+
+ if (strncmp (uri, E_SHELL_DEFAULTURI_PREFIX, E_SHELL_DEFAULTURI_PREFIX_LEN) == 0) {
+ handle_default_uri (shell, uri, ev);
return;
}
@@ -955,13 +997,8 @@ create_view (EShell *shell,
gtk_signal_connect (GTK_OBJECT (view), "destroy",
GTK_SIGNAL_FUNC (view_destroy_cb), shell);
- if (uri != NULL) {
- if (!e_shell_view_display_uri (E_SHELL_VIEW (view), uri)) {
- /* FIXME: Consider popping a dialog box up about how the provided URI does not
- exist/could not be displayed. */
- e_shell_view_display_uri (E_SHELL_VIEW (view), E_SHELL_VIEW_DEFAULT_URI);
- }
- }
+ if (uri != NULL)
+ e_shell_view_display_uri (E_SHELL_VIEW (view), uri);
shell->priv->views = g_list_prepend (shell->priv->views, view);