From d5e7b4d380dfa9b979071b862e67d29ec127c542 Mon Sep 17 00:00:00 2001 From: Simon Poirier Date: Tue, 27 Oct 2009 22:40:07 +0000 Subject: uam selector in properties box. --- diff --git a/tutorius/creator.py b/tutorius/creator.py index 0e2e836..c477056 100644 --- a/tutorius/creator.py +++ b/tutorius/creator.py @@ -444,6 +444,9 @@ class ToolBox(object): if isinstance(prop, properties.TStringProperty): propwdg = row.get_children()[1] propwdg.get_buffer().set_text(propval) + elif isinstance(prop, properties.TUAMProperty): + propwdg = row.get_children()[1] + propwdg.set_label(propval) elif isinstance(prop, properties.TIntProperty): propwdg = row.get_children()[1] propwdg.set_value(propval) @@ -477,6 +480,10 @@ class ToolBox(object): propwdg.get_buffer().set_text(propval) propwdg.connect_after("focus-out-event", \ self._str_prop_changed, action, propname) + elif isinstance(prop, properties.TUAMProperty): + propwdg = gtk.Button(propval) + propwdg.connect_after("clicked", \ + self._uam_prop_changed, action, propname) elif isinstance(prop, properties.TIntProperty): adjustment = gtk.Adjustment(value=propval, lower=prop.lower_limit.limit, @@ -515,6 +522,11 @@ class ToolBox(object): except ValueError: widget.set_text(str(getattr(action, propname)[idx])) self.__parent._creator._action_refresh_cb(None, None, action) + def _uam_prop_changed(self, widget, action, propname): + selector = WidgetSelector(self.__parent) + selection = selector.select() + setattr(action, propname, selection) + self.__parent._creator._action_refresh_cb(None, None, action) def _str_prop_changed(self, widget, evt, action, propname): buf = widget.get_buffer() setattr(action, propname, buf.get_text(buf.get_start_iter(), buf.get_end_iter())) diff --git a/tutorius/properties.py b/tutorius/properties.py index b7d0301..a675ba9 100644 --- a/tutorius/properties.py +++ b/tutorius/properties.py @@ -310,6 +310,8 @@ class TUAMProperty(TutoriusProperty): self.type = "uam" + self.default = self.validate(value) + class TAddonProperty(TutoriusProperty): """ Reprensents an embedded tutorius Addon Component (action, trigger, etc.) -- cgit v0.9.1