Support using names/nicks for the gdk_settings values for enum valued

Wed Dec 12 15:11:49 2001  Owen Taylor  <otaylor@redhat.com>
        * gtk/gtksettings.c (gtk_settings_get_property): Support
        using names/nicks for the gdk_settings values for enum valued
        types. (#57678, reported by Anders Carlsson)
This commit is contained in:
Owen Taylor 2001-12-12 20:26:50 +00:00 committed by Owen Taylor
parent 59bdb19b0e
commit a906e7c6a9
8 changed files with 50 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Wed Dec 12 15:11:49 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksettings.c (gtk_settings_get_property): Support
using names/nicks for the gdk_settings values for enum valued
types. (#57678, reported by Anders Carlsson)
Wed Dec 12 15:01:33 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_tab_label): keep in sync

View File

@ -1,3 +1,9 @@
Wed Dec 12 15:11:49 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksettings.c (gtk_settings_get_property): Support
using names/nicks for the gdk_settings values for enum valued
types. (#57678, reported by Anders Carlsson)
Wed Dec 12 15:01:33 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_tab_label): keep in sync

View File

@ -1,3 +1,9 @@
Wed Dec 12 15:11:49 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksettings.c (gtk_settings_get_property): Support
using names/nicks for the gdk_settings values for enum valued
types. (#57678, reported by Anders Carlsson)
Wed Dec 12 15:01:33 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_tab_label): keep in sync

View File

@ -1,3 +1,9 @@
Wed Dec 12 15:11:49 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksettings.c (gtk_settings_get_property): Support
using names/nicks for the gdk_settings values for enum valued
types. (#57678, reported by Anders Carlsson)
Wed Dec 12 15:01:33 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_tab_label): keep in sync

View File

@ -1,3 +1,9 @@
Wed Dec 12 15:11:49 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksettings.c (gtk_settings_get_property): Support
using names/nicks for the gdk_settings values for enum valued
types. (#57678, reported by Anders Carlsson)
Wed Dec 12 15:01:33 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_tab_label): keep in sync

View File

@ -1,3 +1,9 @@
Wed Dec 12 15:11:49 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksettings.c (gtk_settings_get_property): Support
using names/nicks for the gdk_settings values for enum valued
types. (#57678, reported by Anders Carlsson)
Wed Dec 12 15:01:33 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_tab_label): keep in sync

View File

@ -1,3 +1,9 @@
Wed Dec 12 15:11:49 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksettings.c (gtk_settings_get_property): Support
using names/nicks for the gdk_settings values for enum valued
types. (#57678, reported by Anders Carlsson)
Wed Dec 12 15:01:33 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_tab_label): keep in sync

View File

@ -276,8 +276,15 @@ gtk_settings_get_property (GObject *object,
GParamSpec *pspec)
{
GtkSettings *settings = GTK_SETTINGS (object);
GType value_type = G_VALUE_TYPE (value);
GType fundamental_type = G_TYPE_FUNDAMENTAL (value_type);
if (g_value_type_transformable (G_TYPE_INT, G_VALUE_TYPE (value)) ||
/* For enums and strings, we need to get the value as a string,
* not as an int, since we support using names/nicks as the setting
* value.
*/
if ((g_value_type_transformable (G_TYPE_INT, value_type) &&
!(fundamental_type == G_TYPE_ENUM || fundamental_type == G_TYPE_FLAGS)) ||
g_value_type_transformable (G_TYPE_STRING, G_VALUE_TYPE (value)) ||
g_value_type_transformable (GDK_TYPE_COLOR, G_VALUE_TYPE (value)))
{