Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius/propwidgets.py
diff options
context:
space:
mode:
authorSimon Poirier <simpoir@gmail.com>2009-12-07 05:56:49 (GMT)
committer Simon Poirier <simpoir@gmail.com>2009-12-07 05:56:49 (GMT)
commit342f15e9e9170af02ed332cefd095b51fa0ed759 (patch)
treecdfeeabe1d7a62e7f3c056a7ac63a973660c4f02 /tutorius/propwidgets.py
parent8fe99e6e9157d29dce14500705fb914f9c74184d (diff)
run_dialog in activity context to permit full activity introspection and benefit from nonblocking mandatory property selection
Diffstat (limited to 'tutorius/propwidgets.py')
-rw-r--r--tutorius/propwidgets.py34
1 files changed, 13 insertions, 21 deletions
diff --git a/tutorius/propwidgets.py b/tutorius/propwidgets.py
index eb756fe..dfc6ac0 100644
--- a/tutorius/propwidgets.py
+++ b/tutorius/propwidgets.py
@@ -258,14 +258,13 @@ class PropWidget(object):
return widget
@classmethod
- def run_dialog(cls, parent, obj_prop, propname, probe_mgr=None):
+ def run_dialog(cls, parent, obj_prop, propname):
"""
Class Method.
Prompts the user for changing an object's property
@param parent widget
@param obj_prop TPropContainer to edit
@param propname name of property to edit
- @param probe_mgr a ProbeMgr instance for activity inspection
"""
raise NotImplementedError()
@@ -323,14 +322,13 @@ class StringPropWidget(PropWidget):
self.widget.get_buffer().set_text(str(self.obj_prop)) #unicode() ?
@classmethod
- def run_dialog(cls, parent, obj_prop, propname, probe_mgr=None):
+ def run_dialog(cls, parent, obj_prop, propname):
"""
Class Method.
Prompts the user for changing an object's property
@param parent widget
@param obj_prop TPropContainer to edit
@param propname name of property to edit
- @param probe_mgr a ProbeMgr instance for activity inspection
"""
dlg = TextInputDialog(parent,
text="Mandatory property",
@@ -404,27 +402,23 @@ class UAMPropWidget(PropWidget):
"""
Force the widget to update it's value in case the property has changed
"""
- self.widget.set_label(self.obj_prop)
+ if self.obj_prop:
+ self.widget.set_label(self.obj_prop)
+ else:
+ self.widget.set_label("")
@classmethod
- def run_dialog(cls, parent, obj_prop, propname, probe_mgr=None):
+ def run_dialog(cls, parent, obj_prop, propname):
"""
Class Method.
Prompts the user for changing an object's property
@param parent widget
@param obj_prop TPropContainer to edit
@param propname name of property to edit
- @param probe_mgr a ProbeMgr instance for activity inspection
- """
- if probe_mgr:
- evt = probe_mgr.create_event('FetchWidget')
- setattr(obj_prop, propname, evt.widaddr)
- elif parent:
- selector = WidgetSelector(parent)
- value = selector.select()
- setattr(obj_prop, propname, selector.select())
- else:
- raise RuntimeError('No parent or probe_mgr passed for inspection.')
+ """
+ selector = WidgetSelector(parent)
+ value = selector.select()
+ setattr(obj_prop, propname, selector.select())
class EventTypePropWidget(PropWidget):
"""Allows editing an EventType property"""
@@ -435,14 +429,13 @@ class EventTypePropWidget(PropWidget):
self.widget.set_text(str(self.obj_prop))
@classmethod
- def run_dialog(cls, parent, obj_prop, propname, probe_mgr=None):
+ def run_dialog(cls, parent, obj_prop, propname):
"""
Class Method.
Prompts the user for changing an object's property
@param parent widget
@param obj_prop TPropContainer to edit
@param propname name of property to edit
- @param probe_mgr a ProbeMgr instance for activity inspection
"""
try:
dlg = SignalInputDialog(parent,
@@ -492,13 +485,12 @@ class IntArrayPropWidget(PropWidget):
children[i].set_text(str(value[i]))
@classmethod
- def run_dialog(cls, parent, obj_prop, propname, probe_mgr=None):
+ def run_dialog(cls, parent, obj_prop, propname):
"""
Class Method.
Prompts the user for changing an object's property
@param parent widget
@param obj_prop TPropContainer to edit
@param propname name of property to edit
- @param probe_mgr a ProbeMgr instance for activity inspection
"""
pass