fix "use default background"



Hi,

This makes "use default background" do something sane.

Havoc

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.5494
diff -u -p -u -r1.5494 ChangeLog
--- ChangeLog   23 Aug 2002 14:23:12 -0000      1.5494
+++ ChangeLog   25 Aug 2002 21:55:32 -0000
@@ -1,3 +1,10 @@
+2002-08-25  Havoc Pennington  <hp pobox com>
+
+       * src/file-manager/fm-desktop-icon-view.c
+       (reset_background_callback): Just unset the gconf keys for the
+       background in order to "use default background", instead of
+       getting background from nautilus theme.
+
 2002-08-23  Alexander Larsson  <alexl redhat com>
 
        * libnautilus-private/apps_nautilus_preferences.schemas:
Index: src/file-manager/fm-desktop-icon-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-desktop-icon-view.c,v
retrieving revision 1.189
diff -u -p -u -r1.189 fm-desktop-icon-view.c
--- src/file-manager/fm-desktop-icon-view.c     20 Aug 2002 10:35:45 -0000      1.189
+++ src/file-manager/fm-desktop-icon-view.c     25 Aug 2002 21:55:33 -0000
@@ -767,8 +767,33 @@ reset_background_callback (BonoboUICompo
                           gpointer data, 
                           const char *verb)
 {
-       eel_background_reset 
-               (fm_directory_view_get_background (FM_DIRECTORY_VIEW (data)));
+       /* We just unset all the gconf keys so they go back to
+        * defaults
+        */
+       GConfClient *client;
+       GConfChangeSet *set;
+
+       client = gconf_client_get_default ();
+       set = gconf_change_set_new ();
+
+       /* the list of keys here has to be kept in sync with libgnome
+        * schemas, which isn't the most maintainable thing ever.
+        */
+       gconf_change_set_unset (set, "/desktop/gnome/background/picture_options");
+       gconf_change_set_unset (set, "/desktop/gnome/background/picture_filename");
+       gconf_change_set_unset (set, "/desktop/gnome/background/picture_opacity");
+       gconf_change_set_unset (set, "/desktop/gnome/background/primary_color");
+       gconf_change_set_unset (set, "/desktop/gnome/background/secondary_color");
+       gconf_change_set_unset (set, "/desktop/gnome/background/color_shading_type");
+
+       /* this isn't atomic yet so it'll be a bit inefficient, but
+        * someday it might be atomic.
+        */
+       gconf_client_commit_change_set (client, set, FALSE, NULL);
+
+       gconf_change_set_unref (set);
+       
+       g_object_unref (G_OBJECT (client));     
 }
 
 static gboolean



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]