aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-startup-wizard.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2003-02-27 02:11:49 +0800
committerDan Winship <danw@src.gnome.org>2003-02-27 02:11:49 +0800
commit66b36e63deeda84d042340293fc6c047df297c9d (patch)
tree0a852a799e16c0078c22dd85e484dedf98812cfd /shell/e-shell-startup-wizard.c
parent36e3f76a6784b5ab0905043c0d184d09b4d358b1 (diff)
downloadgsoc2013-evolution-66b36e63deeda84d042340293fc6c047df297c9d.tar.gz
gsoc2013-evolution-66b36e63deeda84d042340293fc6c047df297c9d.tar.zst
gsoc2013-evolution-66b36e63deeda84d042340293fc6c047df297c9d.zip
New routine to attempt to start each available startup wizard in priority
* e-shell-startup-wizard.c (start_wizard): New routine to attempt to start each available startup wizard in priority order, and return once it has successfully started one. (Allows Connector, etc, to override the mailer startup wizard.) (make_corba_dialog_pages): Use it. svn path=/trunk/; revision=20072
Diffstat (limited to 'shell/e-shell-startup-wizard.c')
-rw-r--r--shell/e-shell-startup-wizard.c45
1 files changed, 38 insertions, 7 deletions
diff --git a/shell/e-shell-startup-wizard.c b/shell/e-shell-startup-wizard.c
index 6041634ace..76caadc82f 100644
--- a/shell/e-shell-startup-wizard.c
+++ b/shell/e-shell-startup-wizard.c
@@ -133,6 +133,42 @@ druid_event_notify_cb (BonoboListener *listener,
}
}
+static GNOME_Evolution_Wizard
+start_wizard (void)
+{
+ char *const selection_order[] = { "0-evolution:startup_wizard:priority", NULL };
+ Bonobo_ServerInfoList *info;
+ CORBA_Environment ev;
+ GNOME_Evolution_Wizard wizard;
+ int i;
+
+ CORBA_exception_init (&ev);
+ info = bonobo_activation_query ("repo_ids.has ('IDL:GNOME/Evolution/StartupWizard:1.0')", selection_order, &ev);
+ if (BONOBO_EX (&ev) || info == CORBA_OBJECT_NIL) {
+ g_warning ("Cannot find startup wizard -- %s", BONOBO_EX_REPOID (&ev));
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+ CORBA_exception_free (&ev);
+
+ for (i = 0; i < info->_length; i++) {
+ CORBA_exception_init (&ev);
+ wizard = bonobo_activation_activate_from_id (info->_buffer[i].iid, 0, NULL, &ev);
+ if (!BONOBO_EX (&ev)) {
+ CORBA_free (info);
+ return wizard;
+ }
+ CORBA_exception_free (&ev);
+ }
+
+ if (info->_length)
+ g_warning ("Could not start any startup wizard!");
+ else
+ g_warning ("No startup wizard available!");
+ CORBA_free (info);
+ return NULL;
+}
+
static void
make_corba_dialog_pages (SWData *data)
{
@@ -140,14 +176,9 @@ make_corba_dialog_pages (SWData *data)
CORBA_Object object;
Bonobo_EventSource event_source;
- CORBA_exception_init (&ev);
- data->corba_wizard = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Mail_Wizard", 0, NULL, &ev);
- if (BONOBO_EX (&ev)) {
- g_warning ("Could not start CORBA wizard (%s)", CORBA_exception_id (&ev));
- CORBA_exception_free (&ev);
- data->corba_wizard = CORBA_OBJECT_NIL;
+ data->corba_wizard = start_wizard ();
+ if (!data->corba_wizard)
return;
- }
CORBA_exception_init (&ev);
data->pagelist = GNOME_Evolution_Wizard__get_pages (data->corba_wizard, &ev);