diff options
author | mike <michael.jmontcalm@gmail.com> | 2009-12-04 05:58:29 (GMT) |
---|---|---|
committer | mike <michael.jmontcalm@gmail.com> | 2009-12-04 05:58:29 (GMT) |
commit | 9a44da4488a0ff00150eb5cb114f74ba560b96a6 (patch) | |
tree | e3e122fc895e0a6b40dee417fe816022af8fb4ca /tutorius/actions.py | |
parent | 49ab39870266196f6267f83dd6951f839ebde773 (diff) |
Creator, Remote : Dual code review power!
Diffstat (limited to 'tutorius/actions.py')
-rw-r--r-- | tutorius/actions.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tutorius/actions.py b/tutorius/actions.py index a32138f..8cc5f08 100644 --- a/tutorius/actions.py +++ b/tutorius/actions.py @@ -150,12 +150,9 @@ class Action(TPropContainer): TPropContainer.__init__(self) self.position = (0,0) self._drag = None - # The differences dictionary. This is a structure that holds all the - # modifications that were made to the properties since the action - # was last installed or the last moment the notification was executed. - # Every property change will be logged inside it and it will be sent - # to the creator to update its action edition dialog. - self._property_update_cb = None + # The callback that will be triggered when the action is requested + # to notify all its changes + self._properties_updated_cb = None def do(self, **kwargs): """ @@ -172,17 +169,15 @@ class Action(TPropContainer): def set_notification_cb(self, notif_cb): LOGGER.debug("Action :: Setting notification callback for creator...") - self._property_update_cb = notif_cb + self._properties_updated_cb = notif_cb def update_property(self, name, value): """ Callback used in the wrapper to send a new value to an action. """ LOGGER.debug("Action :: update_property on %s with value '%s'"%(name, str(value))) - #property = getattr(self, name) - #property = value - - #self._props[name] = value + # Set the property itself - this will modify the diff dict and we will + # be able to notify the owner with the new value self.__setattr__(name, value) # Send the notification to the creator @@ -197,7 +192,7 @@ class Action(TPropContainer): # Empty the diff dict as we just synchronized with the creator self._diff_dict.clear() - def enter_editmode(self, *args, **kwargs): + def enter_editmode(self, **kwargs): """ Enters edit mode. The action should display itself in some way, without affecting the currently running application. The default is |