make sure the color scheme has changed before writing to GConf and
2007-08-07 Jens Granseuer <jensgr@gmx.net> * appearance-style.c: (color_button_clicked_cb): make sure the color scheme has changed before writing to GConf and enabling the reset button svn path=/trunk/; revision=7969
This commit is contained in:
parent
197bc958af
commit
8cba2c1e8e
2 changed files with 20 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2007-08-07 Jens Granseuer <jensgr@gmx.net>
|
||||||
|
|
||||||
|
* appearance-style.c: (color_button_clicked_cb): make sure the color
|
||||||
|
scheme has changed before writing to GConf and enabling the reset button
|
||||||
|
|
||||||
2007-08-07 Jens Granseuer <jensgr@gmx.net>
|
2007-08-07 Jens Granseuer <jensgr@gmx.net>
|
||||||
|
|
||||||
* appearance-style.c: (update_color_buttons_from_string): simplify
|
* appearance-style.c: (update_color_buttons_from_string): simplify
|
||||||
|
|
|
@ -252,6 +252,7 @@ color_button_clicked_cb (GtkWidget *colorbutton, AppearanceData *data)
|
||||||
GdkColor color;
|
GdkColor color;
|
||||||
GString *scheme = g_string_new (NULL);
|
GString *scheme = g_string_new (NULL);
|
||||||
gchar *colstr;
|
gchar *colstr;
|
||||||
|
gchar *old_scheme = NULL;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) {
|
for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) {
|
||||||
|
@ -265,12 +266,26 @@ color_button_clicked_cb (GtkWidget *colorbutton, AppearanceData *data)
|
||||||
/* remove the last newline */
|
/* remove the last newline */
|
||||||
g_string_truncate (scheme, scheme->len - 1);
|
g_string_truncate (scheme, scheme->len - 1);
|
||||||
|
|
||||||
|
/* verify that the scheme really has changed */
|
||||||
|
g_object_get (gtk_settings_get_default (), "gtk-color-scheme", &old_scheme, NULL);
|
||||||
|
|
||||||
|
if (old_scheme == NULL ||
|
||||||
|
!gnome_theme_color_scheme_equal (old_scheme, scheme->str)) {
|
||||||
|
gconf_client_set_string (data->client, COLOR_SCHEME_KEY, scheme->str, NULL);
|
||||||
|
|
||||||
|
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "color_scheme_defaults_button"), TRUE);
|
||||||
|
}
|
||||||
|
g_free (old_scheme);
|
||||||
|
g_string_free (scheme, TRUE);
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* Currently we assume this has only been called when one of the colors has
|
/* Currently we assume this has only been called when one of the colors has
|
||||||
* actually changed, so we don't check the original key first */
|
* actually changed, so we don't check the original key first */
|
||||||
gconf_client_set_string (data->client, COLOR_SCHEME_KEY, scheme->str, NULL);
|
gconf_client_set_string (data->client, COLOR_SCHEME_KEY, scheme->str, NULL);
|
||||||
g_string_free (scheme, TRUE);
|
g_string_free (scheme, TRUE);
|
||||||
|
|
||||||
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "color_scheme_defaults_button"), TRUE);
|
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "color_scheme_defaults_button"), TRUE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue