aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-window.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-11-11 09:01:11 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-11-11 09:01:11 +0800
commita99f0c42908ca1d5e923164c624f34cc770bef4f (patch)
tree133ea3ae8f73acf6649ee8c1f2aeda120206144d /shell/e-shell-window.c
parentb1c26ce2bde7fffcd39cc185cc8670e767d190ba (diff)
downloadgsoc2013-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/e-shell-window.c')
-rw-r--r--shell/e-shell-window.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 0e8dea989e..158ef3b485 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -389,13 +389,12 @@ init (EShellWindow *shell_window)
/* Instantiation. */
GtkWidget *
-e_shell_window_new (EShell *shell)
+e_shell_window_new (EShell *shell,
+ const char *component_id)
{
EShellWindow *window = g_object_new (e_shell_window_get_type (), NULL);
EShellWindowPrivate *priv = window->priv;
BonoboUIContainer *ui_container;
- GConfClient *gconf_client;
- char *default_component_id;
if (bonobo_window_construct (BONOBO_WINDOW (window),
bonobo_ui_container_new (),
@@ -428,17 +427,24 @@ e_shell_window_new (EShell *shell)
gtk_window_set_default_size (GTK_WINDOW (window), 640, 480);
- gconf_client = gconf_client_get_default ();
- default_component_id = gconf_client_get_string (gconf_client,
- "/apps/evolution/shell/view_defaults/component_id",
- NULL);
- g_object_unref (gconf_client);
-
- if (default_component_id == NULL) {
- e_shell_window_switch_to_component (window, "mail");
+ if (component_id != NULL) {
+ e_shell_window_switch_to_component (window, component_id);
} else {
- e_shell_window_switch_to_component (window, default_component_id);
- g_free (default_component_id);
+ GConfClient *gconf_client;
+ char *default_component_id;
+
+ gconf_client = gconf_client_get_default ();
+ default_component_id = gconf_client_get_string (gconf_client,
+ "/apps/evolution/shell/view_defaults/component_id",
+ NULL);
+ g_object_unref (gconf_client);
+
+ if (default_component_id == NULL) {
+ e_shell_window_switch_to_component (window, "mail");
+ } else {
+ e_shell_window_switch_to_component (window, default_component_id);
+ g_free (default_component_id);
+ }
}
return GTK_WIDGET (window);