summaryrefslogtreecommitdiff
path: root/caribou
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2011-08-04 10:23:16 -0400
committerDan Winship <danw@gnome.org>2011-08-04 10:26:26 -0400
commit4ee4055a9a77e7cf0ebba636f569e3181e8d7697 (patch)
treedcbaf99f07bb8d0139b6921347272ff227dc9d07 /caribou
parent0f31da32fd2556bf73cdc2d1408e6fc7fdcda29f (diff)
downloadcaribou-4ee4055a9a77e7cf0ebba636f569e3181e8d7697.tar.gz
setting_types: avoid using GVariant
pygobject 2.28's GLib.Variant doesn't work with glib master (bug 654859), and pygobject 3.x is not yet ready for general use. So just avoid using variants for now. https://bugzilla.gnome.org/show_bug.cgi?id=655976
Diffstat (limited to 'caribou')
-rw-r--r--caribou/settings/setting_types.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/caribou/settings/setting_types.py b/caribou/settings/setting_types.py
index efa438c..66fb0f0 100644
--- a/caribou/settings/setting_types.py
+++ b/caribou/settings/setting_types.py
@@ -108,8 +108,8 @@ class ValueSetting(Setting):
return bool(self.value)
@property
- def gvariant(self):
- return GLib.Variant(self.variant_type, self.value)
+ def default_value(self):
+ return "%r" % self.value
class BooleanSetting(ValueSetting):
variant_type = 'b'
@@ -118,6 +118,13 @@ class BooleanSetting(ValueSetting):
# Almost anything could be a boolean.
return bool(val)
+ @property
+ def default_value(self):
+ if self.value:
+ return "true"
+ else:
+ return "false"
+
class IntegerSetting(ValueSetting):
variant_type = 'i'
entry_type = ENTRY_SPIN