diff options
Diffstat (limited to 'capplets')
-rw-r--r-- | capplets/appearance/appearance-desktop.c | 34 | ||||
-rw-r--r-- | capplets/appearance/appearance.h | 1 | ||||
-rw-r--r-- | capplets/appearance/mate-wp-item.c | 7 |
3 files changed, 13 insertions, 29 deletions
diff --git a/capplets/appearance/appearance-desktop.c b/capplets/appearance/appearance-desktop.c index 09826e1e..86bf75ce 100644 --- a/capplets/appearance/appearance-desktop.c +++ b/capplets/appearance/appearance-desktop.c @@ -316,7 +316,11 @@ wp_scale_type_changed (GtkComboBox *combobox, g_object_unref (pixbuf); if (g_settings_is_writable (data->wp_settings, WP_OPTIONS_KEY)) + { + g_settings_delay (data->wp_settings); g_settings_set_enum (data->wp_settings, WP_OPTIONS_KEY, item->options); + g_settings_apply (data->wp_settings); + } } static void @@ -342,7 +346,11 @@ wp_shade_type_changed (GtkWidget *combobox, g_object_unref (pixbuf); if (g_settings_is_writable (data->wp_settings, WP_SHADING_KEY)) + { + g_settings_delay (data->wp_settings); g_settings_set_enum (data->wp_settings, WP_SHADING_KEY, item->shade_type); + g_settings_apply (data->wp_settings); + } } static void @@ -365,8 +373,10 @@ wp_color_changed (AppearanceData *data, pcolor = gdk_color_to_string (item->pcolor); scolor = gdk_color_to_string (item->scolor); + g_settings_delay (data->wp_settings); g_settings_set_string (data->wp_settings, WP_PCOLOR_KEY, pcolor); g_settings_set_string (data->wp_settings, WP_SCOLOR_KEY, scolor); + g_settings_apply (data->wp_settings); g_free (pcolor); g_free (scolor); } @@ -452,22 +462,6 @@ wp_options_changed (GSettings *settings, AppearanceData *data) { MateWPItem *item; - gchar *option; - - option = g_settings_get_string (settings, key); - - /* "none" means we don't use a background image */ - if (option == NULL || !strcmp (option, "none")) - { - /* temporarily disconnect so we don't override settings when - * updating the selection */ - data->wp_update_settings = FALSE; - wp_uri_changed ("(none)", data); - data->wp_update_settings = TRUE; - if (option) - g_free (option); - return; - } item = get_selected_item (data, NULL); @@ -476,7 +470,6 @@ wp_options_changed (GSettings *settings, item->options = g_settings_get_enum (settings, key); wp_option_menu_set (data, item->options, FALSE); } - g_free (option); } static void @@ -546,7 +539,7 @@ wp_props_wp_set (AppearanceData *data, MateWPItem *item) if (!strcmp (item->filename, "(none)")) { - g_settings_set_string (data->wp_settings, WP_OPTIONS_KEY, "none"); + g_settings_set_enum (data->wp_settings, WP_OPTIONS_KEY, 0); g_settings_set_string (data->wp_settings, WP_FILE_KEY, ""); } else @@ -604,8 +597,7 @@ wp_props_wp_selected (GtkTreeSelection *selection, gtk_color_button_set_color (GTK_COLOR_BUTTON (data->wp_scpicker), item->scolor); - if (data->wp_update_settings) - wp_props_wp_set (data, item); + wp_props_wp_set (data, item); } else { @@ -1219,8 +1211,6 @@ desktop_init (AppearanceData *data, GtkCellRenderer *cr; char *url; - data->wp_update_settings = TRUE; - data->wp_uris = NULL; if (uris != NULL) { while (*uris != NULL) { diff --git a/capplets/appearance/appearance.h b/capplets/appearance/appearance.h index b2e34d30..3e69a109 100644 --- a/capplets/appearance/appearance.h +++ b/capplets/appearance/appearance.h @@ -90,7 +90,6 @@ typedef struct { /* desktop */ GHashTable* wp_hash; - gboolean wp_update_settings; GtkIconView* wp_view; GtkTreeModel* wp_model; GtkWidget* wp_scpicker; diff --git a/capplets/appearance/mate-wp-item.c b/capplets/appearance/mate-wp-item.c index abc1b334..d11fa896 100644 --- a/capplets/appearance/mate-wp-item.c +++ b/capplets/appearance/mate-wp-item.c @@ -23,14 +23,9 @@ #include <glib/gi18n.h> #include <gio/gio.h> #include <string.h> +#include "appearance.h" #include "mate-wp-item.h" -#define WP_SCHEMA "org.mate.background" -#define WP_OPTIONS_KEY "picture-options" -#define WP_SHADING_KEY "color-shading-type" -#define WP_PCOLOR_KEY "primary-color" -#define WP_SCOLOR_KEY "secondary-color" - const gchar *wp_item_option_to_string (MateBGPlacement type) { switch (type) |