diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2003-11-11 09:01:11 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2003-11-11 09:01:11 +0800 |
commit | a99f0c42908ca1d5e923164c624f34cc770bef4f (patch) | |
tree | 133ea3ae8f73acf6649ee8c1f2aeda120206144d /shell/main.c | |
parent | b1c26ce2bde7fffcd39cc185cc8670e767d190ba (diff) | |
download | gsoc2013-evolution-a99f0c42908ca1d5e923164c624f34cc770bef4f.tar.gz gsoc2013-evolution-a99f0c42908ca1d5e923164c624f34cc770bef4f.tar.zst gsoc2013-evolution-a99f0c42908ca1d5e923164c624f34cc770bef4f.zip |
Added a new "-c" command-line arg. (idle_cb): If the arg is specified,
* main.c: Added a new "-c" command-line arg.
(idle_cb): If the arg is specified, open the component with that
id/alias.
* e-shell.c (impl_Shell_createNewView): New, implementation for
the Shell::createNewView() CORBA method.
(e_shell_class_init): Install.
(e_shell_create_window): Get a component_id arg.
* e-shell-window.c (e_shell_window_new): Get a component_id arg
and create the window with that component activated if not NULL.
* Evolution-Shell.idl (createNewView): Remove.
(createNewWindow): New.
svn path=/trunk/; revision=23274
Diffstat (limited to 'shell/main.c')
-rw-r--r-- | shell/main.c | 50 |
1 files changed, 11 insertions, 39 deletions
diff --git a/shell/main.c b/shell/main.c index 8a6d011cb6..3c7e3678ee 100644 --- a/shell/main.c +++ b/shell/main.c @@ -85,6 +85,7 @@ static gboolean start_online = FALSE; static gboolean start_offline = FALSE; static gboolean setup_only = FALSE; static gboolean killev = FALSE; +static char *default_component_id = NULL; extern char *evolution_debug_log; @@ -404,35 +405,15 @@ idle_cb (void *data) } have_evolution_uri = FALSE; - displayed_any = FALSE; - for (p = uri_list; p != NULL; p = p->next) { - const char *uri; - - uri = (const char *) p->data; - if (strncmp (uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) == 0 || - strncmp (uri, E_SHELL_DEFAULTURI_PREFIX, E_SHELL_DEFAULTURI_PREFIX_LEN) == 0) - have_evolution_uri = TRUE; - } + if (uri_list == NULL && shell != NULL) + e_shell_create_window (shell, default_component_id, NULL); + else { + CORBA_Environment ev; - if (shell == NULL) { - /* We're talking to a remote shell. If the user didn't ask us to open any particular - URI, then open another view of the default URI. */ - if (uri_list == NULL) - display_default = TRUE; - else - display_default = FALSE; - } else { - /* We're starting a new shell. If the user didn't specify any evolution: URIs to - view, AND we can't load the user's previous settings, then show the default - URI. */ - if (! have_evolution_uri) { - e_shell_create_window (shell, NULL); - display_default = TRUE; - displayed_any = TRUE; - } else { - display_default = FALSE; - } + CORBA_exception_init (&ev); + GNOME_Evolution_Shell_createNewWindow (corba_shell, default_component_id, &ev); + CORBA_exception_free (&ev); } for (p = uri_list; p != NULL; p = p->next) { @@ -440,9 +421,7 @@ idle_cb (void *data) uri = (const char *) p->data; GNOME_Evolution_Shell_handleURI (corba_shell, uri, &ev); - if (ev._major == CORBA_NO_EXCEPTION) - displayed_any = TRUE; - else { + if (ev._major == CORBA_NO_EXCEPTION) { g_warning ("CORBA exception %s when requesting URI -- %s", BONOBO_EX_REPOID (&ev), uri); CORBA_exception_free (&ev); @@ -451,15 +430,6 @@ idle_cb (void *data) g_slist_free (uri_list); - if (display_default && ! displayed_any) { - const char *uri; - - uri = E_SHELL_VIEW_DEFAULT_URI; - GNOME_Evolution_Shell_handleURI (corba_shell, uri, &ev); - if (ev._major != CORBA_NO_EXCEPTION) - g_warning ("CORBA exception %s when requesting URI -- %s", BONOBO_EX_REPOID (&ev), uri); - } - CORBA_Object_release (corba_shell, &ev); CORBA_exception_free (&ev); @@ -526,6 +496,8 @@ int main (int argc, char **argv) { struct poptOption options[] = { + { "component", 'c', POPT_ARG_STRING, &default_component_id, 0, + N_("Start Evolution activating the specified component"), NULL }, { "offline", '\0', POPT_ARG_NONE, &start_offline, 0, N_("Start in offline mode"), NULL }, { "online", '\0', POPT_ARG_NONE, &start_online, 0, |