diff options
author | Darin Adler <darin@src.gnome.org> | 2001-04-03 22:31:50 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2001-04-03 22:31:50 +0000 |
commit | 9f9bfe2e5ff03c6829b4b8730b65cdc00051331d (patch) | |
tree | 6d31a088a03f66b30a71e7466e75cbaaa44be0ea /src | |
parent | 36d6126e3ca8ebaebef96dfb977bba1aa86fa9e6 (diff) | |
download | nautilus-9f9bfe2e5ff03c6829b4b8730b65cdc00051331d.tar.gz |
reviewed by: John Harper <jsh@eazel.com>
* src/nautilus-application.c: (update_session): New function,
reads preferences and updates the session based on whether the
Nautilus needs to be kept running to manage the desktop.
(init_session): Use the new functions and register to update the
session when the preferences change.
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-application.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/nautilus-application.c b/src/nautilus-application.c index b6252f5c0..39873a841 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -821,6 +821,14 @@ set_session_restart (GnomeClient *client, gboolean restart) } static void +update_session (gpointer callback_data) +{ + set_session_restart (callback_data, + nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_ADD_TO_SESSION) + && nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_SHOW_DESKTOP)); +} + +static void init_session (void) { GnomeClient *client; @@ -828,13 +836,20 @@ init_session (void) client = gnome_master_client (); gtk_signal_connect (GTK_OBJECT (client), "save_yourself", - (GtkSignalFunc) save_session, + (GtkSignalFunc) save_session, NULL); - + gtk_signal_connect (GTK_OBJECT (client), "die", (GtkSignalFunc) removed_from_session, NULL); - - set_session_restart (client, nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_ADD_TO_SESSION)); -} + + nautilus_preferences_add_callback + (NAUTILUS_PREFERENCES_ADD_TO_SESSION, + update_session, client); + nautilus_preferences_add_callback + (NAUTILUS_PREFERENCES_SHOW_DESKTOP, + update_session, client); + + update_session (client); +} |