diff options
author | Richard Hestilow <hestilow@ximian.com> | 2002-02-23 04:42:10 +0000 |
---|---|---|
committer | Rachel Hestilow <hestgray@src.gnome.org> | 2002-02-23 04:42:10 +0000 |
commit | bc353d83350ccb8c01d26b2b4601e231e813749f (patch) | |
tree | ce4ab5c75d2f56cf9aaef265316d108853cb5953 /libbackground | |
parent | ca36de699e9bdfb6c8023c2013a8908fb20d82f9 (diff) | |
download | gnome-control-center-bc353d83350ccb8c01d26b2b4601e231e813749f.tar.gz |
Add function bg_preferences_save.NAUTILUS_1_1_6NAUTILUS_1_1_5
2002-02-22 Richard Hestilow <hestilow@ximian.com>
* preferences.[ch]: Add function bg_preferences_save.
Diffstat (limited to 'libbackground')
-rw-r--r-- | libbackground/ChangeLog | 4 | ||||
-rw-r--r-- | libbackground/preferences.c | 38 | ||||
-rw-r--r-- | libbackground/preferences.h | 2 |
3 files changed, 44 insertions, 0 deletions
diff --git a/libbackground/ChangeLog b/libbackground/ChangeLog index d191761da..40dedd594 100644 --- a/libbackground/ChangeLog +++ b/libbackground/ChangeLog @@ -1,3 +1,7 @@ +2002-02-22 Richard Hestilow <hestilow@ximian.com> + + * preferences.[ch]: Add function bg_preferences_save. + 2002-02-17 Bradford Hovinen <hovinen@ximian.com> * applier.c (need_root_pixmap_p): We don't need a root pixmap if diff --git a/libbackground/preferences.c b/libbackground/preferences.c index be56ffd78..0edb2e4d6 100644 --- a/libbackground/preferences.c +++ b/libbackground/preferences.c @@ -277,3 +277,41 @@ read_color_from_string (const gchar *string) return color; } + +#define DGB "/desktop/gnome/background/" + +void +bg_preferences_save (BGPreferences *prefs) +{ + GConfChangeSet *cs; + gchar *tmp; + + g_return_if_fail (prefs != NULL); + g_return_if_fail (IS_BG_PREFERENCES (prefs)); + + cs = gconf_change_set_new (); + gconf_change_set_set_bool (cs, DGB "enabled", prefs->enabled); + gconf_change_set_set_int (cs, DGB "wallpaper-type", prefs->wallpaper_type); + gconf_change_set_set_string (cs, DGB "wallpaper-filename", prefs->wallpaper_filename); + + tmp = g_strdup_printf ("#%02x%02x%02x", + prefs->color1->red >> 8, + prefs->color1->green >> 8, + prefs->color1->blue >> 8); + gconf_change_set_set_string (cs, DGB "color1", tmp); + g_free (tmp); + + tmp = g_strdup_printf ("#%02x%02x%02x", + prefs->color2->red >> 8, + prefs->color2->green >> 8, + prefs->color2->blue >> 8); + gconf_change_set_set_string (cs, DGB "color2", tmp); + g_free (tmp); + + gconf_change_set_set_int (cs, DGB "orientation", prefs->orientation); + gconf_client_commit_change_set (gconf_client_get_default (), cs, TRUE, NULL); + gconf_change_set_unref (cs); +} + +#undef DGB + diff --git a/libbackground/preferences.h b/libbackground/preferences.h index dcb73df80..ff41c2866 100644 --- a/libbackground/preferences.h +++ b/libbackground/preferences.h @@ -85,4 +85,6 @@ void bg_preferences_load (BGPreferences *prefs); void bg_preferences_merge_entry (BGPreferences *prefs, const GConfEntry *entry); +void bg_preferences_save (BGPreferences *prefs); + #endif /* __PREFERENCES_H */ |