[POS-commit] r1227 - in kiwi/trunk: . kiwi/ui

Johan Dahlin jdahlin at async.com.br
Thu Sep 15 16:55:57 BRT 2005


Author: jdahlin
Date: Thu Sep 15 16:55:57 2005
New Revision: 1227

Modified:
   kiwi/trunk/ChangeLog
   kiwi/trunk/kiwi/ui/gazpacholoader.py
Log:
    * kiwi/ui/gazpacholoader.py (DataTypeProperty.save): Add support for 
    data-type in KiwiLabel, fixes #2141



Modified: kiwi/trunk/ChangeLog
==============================================================================
--- kiwi/trunk/ChangeLog	(original)
+++ kiwi/trunk/ChangeLog	Thu Sep 15 16:55:57 2005
@@ -1,3 +1,8 @@
+2005-09-15  Johan Dahlin  <jdahlin at async.com.br>
+
+	* kiwi/ui/gazpacholoader.py (DataTypeProperty.save): Add support for 
+	data-type in KiwiLabel, fixes #2141
+
 2005-09-13  Johan Dahlin  <jdahlin at async.com.br>
 
 	* kiwi/utils.py: AMD64 fix ported from gazpachos copy.

Modified: kiwi/trunk/kiwi/ui/gazpacholoader.py
==============================================================================
--- kiwi/trunk/kiwi/ui/gazpacholoader.py	(original)
+++ kiwi/trunk/kiwi/ui/gazpacholoader.py	Thu Sep 15 16:55:57 2005
@@ -186,6 +186,13 @@
                 (_('Float'), float),
                 (_('Object'), object)]
 
+class LabelDataTypeAdaptor(DataTypeAdaptor):
+    def get_data_types(self):
+        return [(_('Boolean'), bool),
+                (_('String'), str),
+                (_('Integer'), int),
+                (_('Float'), float)]
+
 class DataTypeProperty(CustomProperty, StringType):
     translatable = False
     def save(self):
@@ -234,10 +241,9 @@
 class LabelAdapter(PythonWidgetAdapter):
     object_type = Label
 adapter_registry.register_adapter(LabelAdapter)
-# This is disabled until we can figure if we need it
 prop_registry.override_simple(
     'kiwi+ui+widgets+label+Label::data-type', DataTypeProperty,
-    editable=False)
+    editor=LabelDataTypeAdaptor)
 prop_registry.override_simple(
     'kiwi+ui+widgets+label+Label::model-attribute', ModelProperty)
 


More information about the POS-commit mailing list