From 9b55bb20e3bcc229ce74a46dbda942c7c0f9dd14 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 11 Feb 2011 12:39:51 +0000 Subject: [PATCH] background: Load initial state from GSettings gnome_wp_item_update() used to do that for us. --- panels/background/cc-background-panel.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c index 871f0140a..47a553280 100644 --- a/panels/background/cc-background-panel.c +++ b/panels/background/cc-background-panel.c @@ -825,17 +825,21 @@ cc_background_panel_init (CcBackgroundPanel *self) /* initalise the current background information from settings */ filename = g_settings_get_string (priv->settings, WP_FILE_KEY); priv->current_background = cc_background_item_new (filename); - g_object_set (G_OBJECT (priv->current_background), "name", _("Current background"), NULL); - //FIXME load other properties + /* FIXME Set flags too: + * - if we have a gradient and no filename, set PCOLOR, etc. + * + * Move into cc-background-item.c like the old cc_background_item_update()? + */ + g_object_set (G_OBJECT (priv->current_background), + "name", _("Current background"), + "placement", g_settings_get_enum (priv->settings, WP_OPTIONS_KEY), + "shading", g_settings_get_enum (priv->settings, WP_SHADING_KEY), + "primary-color", g_settings_get_string (priv->settings, WP_PCOLOR_KEY), + "secondary-color", g_settings_get_string (priv->settings, WP_SCOLOR_KEY), + NULL); cc_background_item_load (priv->current_background, NULL); - //FIXME call load? -#if 0 - cc_background_item_update (priv->current_background); - cc_background_item_ensure_gnome_bg (priv->current_background); - cc_background_item_update_size (priv->current_background, priv->thumb_factory); -#endif update_preview (priv, NULL, TRUE);