aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog4
-rw-r--r--calendar/gui/main.c25
2 files changed, 25 insertions, 4 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 591831bbdf..fa7e540c70 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,9 @@
2002-09-23 Rodrigo Moya <rodrigo@ximian.com>
+ * gui/main.c (launch_alarm_daemon): install an idle callback that will
+ start the alarm daemon.
+ (launch_alarm_daemon_cb): actually activate the alarm daemon here.
+
* pcs/query.c (start_cached_query_cb): remove timeout function always
and re-add it if the query is in progress.
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
index 1f0eed02aa..5d9bdf30c5 100644
--- a/calendar/gui/main.c
+++ b/calendar/gui/main.c
@@ -102,19 +102,25 @@ component_editor_factory_init (void)
/* 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)
+static gboolean
+launch_alarm_daemon_cb (gpointer data)
{
CORBA_Environment ev;
GNOME_Evolution_Calendar_AlarmNotify an;
+ guint *idle_id = (guint *) data;
+
+ /* remove the idle function */
+ g_source_remove (*idle_id);
+ g_free (idle_id);
+ /* activate the alarm daemon */
CORBA_exception_init (&ev);
an = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify", 0, NULL, &ev);
if (BONOBO_EX (&ev)) {
- g_message ("add_alarms(): Could not activate the alarm notification service");
+ g_message ("launch_alarm_daemon_cb(): Could not activate the alarm notification service");
CORBA_exception_free (&ev);
- return;
+ return FALSE;
}
CORBA_exception_free (&ev);
@@ -126,6 +132,17 @@ launch_alarm_daemon (void)
g_message ("add_alarms(): Could not unref the alarm notification service");
CORBA_exception_free (&ev);
+
+ return FALSE;
+}
+
+static void
+launch_alarm_daemon (void)
+{
+ guint *idle_id;
+
+ idle_id = g_new0 (guint, 1);
+ *idle_id = g_idle_add ((GSourceFunc) launch_alarm_daemon_cb, idle_id);
}
int