Objectlist with Column validate
Bruno Gomes
brunopereiragomes at gmail.com
Tue Feb 12 16:09:43 BRST 2008
it's the first idea of implementation it
Index: ui/objectlist.py
===================================================================
--- ui/objectlist.py (revision 7431)
+++ ui/objectlist.py (working copy)
@@ -158,6 +158,7 @@
gproperty('ellipsize', pango.EllipsizeMode, default=pango.ELLIPSIZE_NONE)
gproperty('font-desc', str)
gproperty('column', str)
+ gproperty('validate', object)
#gproperty('title_pixmap', str)
# This can be set in subclasses, to be able to allow custom
@@ -197,7 +198,7 @@
self._objectlist = None
self.compare = None
- self.from_string = None
+ self.from_string = kwargs.get('validate')
kwargs['attribute'] = attribute
kwargs['title'] = title or attribute.capitalize()
@@ -241,7 +242,8 @@
if data is not None:
conv = converter.get_converter(data)
self.compare = conv.get_compare_function()
- self.from_string = conv.from_string
+ if not self.from_string:
+ self.from_string = conv.from_string
return data
def attach(self, objectlist):
--
Bruno Gomes
More information about the Kiwi
mailing list