From aa26bcdf23f0d096ca38c6b48b7f479fb2fdcc6d Mon Sep 17 00:00:00 2001 From: mike Date: Wed, 02 Dec 2009 00:04:46 +0000 Subject: Creator Multi Process : Adding property update (still needing callback from DragWrapper) --- diff --git a/tutorius/TProbe.py b/tutorius/TProbe.py index 7021f80..8361314 100644 --- a/tutorius/TProbe.py +++ b/tutorius/TProbe.py @@ -28,7 +28,7 @@ from . import addon from . import properties from .services import ObjectStore -from .dbustools import remote_call, save_args +from .dbustools import remote_call, save_args, ignore, logError import copy """ @@ -465,7 +465,7 @@ class ProbeProxy: reply_handler=save_args(self.__update_event, event, notification_cb, event_subscribed_cb), error_handler=save_args(error_cb, event)) - def unsubscribe(self, address, block=True): + def unsubscribe(self, address): """ Unregister an event listener @param address identifier given by subscribe() @@ -487,12 +487,11 @@ class ProbeProxy: subscribed events should be removed. """ for action_addr in self._actions.keys(): - self.uninstall(action_addr) + self.uninstall(action_addr, True) for address in self._subscribedEvents.keys(): self.unsubscribe(address) - class ProbeManager(object): """ The ProbeManager provides multiplexing across multiple activity ProbeProxies diff --git a/tutorius/creator.py b/tutorius/creator.py index 54e2912..04c96fd 100644 --- a/tutorius/creator.py +++ b/tutorius/creator.py @@ -41,6 +41,11 @@ from functools import partial from dbus import SessionBus from dbus.service import method, Object, BusName +from .dbustools import ignore + +import logging + +LOGGER = logging.getLogger("creator") BUS_PATH = "/org/tutorius/Creator" BUS_NAME = "org.tutorius.Creator" @@ -58,7 +63,7 @@ def get_creator_proxy(): """ Returns a Creator dbus proxy for inter-process events. """ - bus = dbus.SessionBus() + bus = SessionBus() proxy = bus.get_object(BUS_NAME, BUS_PATH) return proxy @@ -315,6 +320,14 @@ class Creator(Object): self.set_insertion_point(new_state) def properties_changed(self, action, properties): + LOGGER.debug("Creator :: properties_changed for action at address %s to %s"%(action.address, str(properties))) + address = action.address + self._probe_mgr.update(address, + action, + is_editing=True + ) + + def _update_error(self, exception): pass def _action_refresh_cb(self, widget, evt, action): @@ -408,6 +421,14 @@ class Creator(Object): """ pass + @method(BUS_NAME, + in_signature='', + out_signature='b') + def is_creator_open(self): + """ + @returns True if the creator is being executed right now, False otherwise. + """ + return self.is_authoring class ToolBox(object): """ @@ -524,9 +545,8 @@ class ToolBox(object): def _refresh_action_cb(self): if self._action is not None: - self.__parent._creator._action_refresh_cb(None, None, self._action) - - + default_creator().properties_changed(self._action, self._action._props) + #self.__parent._creator._action_refresh_cb(None, None, self._action) # The purpose of this function is to reformat text, as current IconView # implentation does not insert carriage returns on long lines. -- cgit v0.9.1