summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2001-04-03 22:31:50 +0000
committerDarin Adler <darin@src.gnome.org>2001-04-03 22:31:50 +0000
commit9f9bfe2e5ff03c6829b4b8730b65cdc00051331d (patch)
tree6d31a088a03f66b30a71e7466e75cbaaa44be0ea
parent36d6126e3ca8ebaebef96dfb977bba1aa86fa9e6 (diff)
downloadnautilus-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.
-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);
+}