From 342f15e9e9170af02ed332cefd095b51fa0ed759 Mon Sep 17 00:00:00 2001 From: Simon Poirier Date: Mon, 07 Dec 2009 05:56:49 +0000 Subject: run_dialog in activity context to permit full activity introspection and benefit from nonblocking mandatory property selection --- (limited to 'tutorius/propwidgets.py') 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 -- cgit v0.9.1