summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--src/nautilus-application.c25
2 files changed, 30 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 2f080024c..4051cd56c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2001-04-03 Darin Adler <darin@eazel.com>
+
+ 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.
+
2001-04-03 John Harper <jsh@eazel.com>
Fixed part of bug 7823 (Nautilus window hints make it unusable
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);
+}