diff options
-rw-r--r-- | calendar/ChangeLog | 5 | ||||
-rw-r--r-- | calendar/gui/alarm-notify/notify-main.c | 37 |
2 files changed, 20 insertions, 22 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 5bd6c1c7d8..1e220bd21c 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,10 +1,5 @@ 2004-02-16 Rodrigo Moya <rodrigo@ximian.com> - * gui/itip-utils.c (comp_server_send): pass the user list to - e_cal_send_objects(). - -2004-02-16 Rodrigo Moya <rodrigo@ximian.com> - * gui/alarm-notify/notify-main.c: no need to keep the master client. (init_session): just set the daemon's restart style, not the restart command. Connect to "save_yourself" signal on the session also. diff --git a/calendar/gui/alarm-notify/notify-main.c b/calendar/gui/alarm-notify/notify-main.c index 0fcee80d1c..18f9f264ea 100644 --- a/calendar/gui/alarm-notify/notify-main.c +++ b/calendar/gui/alarm-notify/notify-main.c @@ -46,8 +46,6 @@ -static GnomeClient *master_client = NULL; - static BonoboGenericFactory *factory; static AlarmNotify *alarm_notify_service = NULL; @@ -62,35 +60,40 @@ client_die_cb (GnomeClient *client) bonobo_main_quit (); } +static gint +save_session_cb (GnomeClient *client, GnomeSaveStyle save_style, gint shutdown, + GnomeInteractStyle interact_style, gint fast, gpointer user_data) +{ + char *args[2]; + + args[0] = EVOLUTION_LIBEXECDIR "/evolution-alarm-notify"; + args[1] = NULL; + gnome_client_set_restart_command (client, 1, args); + + return TRUE; +} + /* Sees if a session manager is present. If so, it tells the SM how to restart * the daemon when the session starts. It also sets the die callback so that * the daemon can terminate properly when the session ends. */ static void -set_session_parameters (char **argv) +init_session (void) { - int flags; - char *args[2]; + GnomeClient *master_client; master_client = gnome_master_client (); - flags = gnome_client_get_flags (master_client); - if (!(flags & GNOME_CLIENT_IS_CONNECTED)) - return; + g_signal_connect (G_OBJECT (master_client), "die", + G_CALLBACK (client_die_cb), NULL); + g_signal_connect (G_OBJECT (master_client), "save_yourself", + G_CALLBACK (save_session_cb), NULL); /* The daemon should always be started up by the session manager when * the session starts. The daemon will take care of loading whatever * calendars it was told to load. */ gnome_client_set_restart_style (master_client, GNOME_RESTART_ANYWAY); - - args[0] = argv[0]; - args[1] = NULL; - - gnome_client_set_restart_command (master_client, 1, args); - - g_signal_connect (G_OBJECT (master_client), "die", - G_CALLBACK (client_die_cb), NULL); } /* Factory function for the alarm notify service; just creates and references a @@ -172,7 +175,7 @@ main (int argc, char **argv) g_error (_("Could not create the alarm notify service factory")); g_object_set (G_OBJECT (factory), "poa", bonobo_poa_get_threaded (ORBIT_THREAD_HINT_PER_REQUEST, NULL), NULL); - set_session_parameters (argv); + init_session (); g_idle_add ((GSourceFunc) load_calendars, NULL); |