From ad97ddd68a45ec03a36b25d99ff957a472a1e588 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 30 Oct 2001 00:53:36 +0000 Subject: Launch the alarm daemon as soon as the calendar component is started. 2001-10-29 Federico Mena Quintero * gui/main.c (launch_alarm_daemon): Launch the alarm daemon as soon as the calendar component is started. Fixes bug #13867; we can't really do much better than this. svn path=/trunk/; revision=14389 --- calendar/gui/main.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'calendar/gui/main.c') diff --git a/calendar/gui/main.c b/calendar/gui/main.c index e49aa3272b..768d6fddcc 100644 --- a/calendar/gui/main.c +++ b/calendar/gui/main.c @@ -91,6 +91,35 @@ component_editor_factory_init (void) g_error (_("Could not create the component editor factory")); } +/* Does a simple activation and unreffing of the alarm notification service so + * that the daemon will be launched if it is not running yet. + */ +static void +launch_alarm_daemon (void) +{ + CORBA_Environment ev; + GNOME_Evolution_Calendar_AlarmNotify an; + + CORBA_exception_init (&ev); + an = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify", 0, NULL, &ev); + + if (ev._major != CORBA_NO_EXCEPTION) { + g_message ("add_alarms(): Could not activate the alarm notification service"); + CORBA_exception_free (&ev); + return; + } + CORBA_exception_free (&ev); + + /* Just get rid of it; what we are interested in is that it gets launched */ + + CORBA_exception_init (&ev); + bonobo_object_release_unref (an, &ev); + if (ev._major != CORBA_NO_EXCEPTION) + g_message ("add_alarms(): Could not unref the alarm notification service"); + + CORBA_exception_free (&ev); +} + int main (int argc, char **argv) { @@ -122,6 +151,8 @@ main (int argc, char **argv) tasks_control_factory_init (); component_editor_factory_init (); + launch_alarm_daemon (); + bonobo_main (); alarm_done (); -- cgit v1.2.3