From cf6785d168eaf3ed5505705478a6aea05ad3da98 Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 07 Dec 2009 01:20:18 +0000 Subject: Probe : Inserting Probe in Journal --- diff --git a/tutorius/TProbe.py b/tutorius/TProbe.py index 5508d49..7f717f1 100644 --- a/tutorius/TProbe.py +++ b/tutorius/TProbe.py @@ -759,13 +759,21 @@ class ProbeManager(object): self._current_activity = activity_id def getCurrentActivity(self): + if self._current_activity == "org.laptop.JournalActivity": + return self._current_activity # TODO : Insert the correct call to remember the current activity, # taking the views and frame into account current_act = get_model().get_active_activity() - current_act_bundle = ActivityBundle(current_act.get_bundle_path()) - current_act_id = current_act_bundle.get_bundle_id() - self._current_activity = current_act_id - return self._current_activity + bundle_path = current_act.get_bundle_path() + if bundle_path: + current_act_bundle = ActivityBundle(bundle_path) + current_act_id = current_act_bundle.get_bundle_id() + self._current_activity = current_act_id + return self._current_activity + else: + # Temp hack for Journal + self._current_activity = 'org.laptop.JournalActivity'#current_act.get_bundle_id() + return self._current_activity currentActivity = property(fget=getCurrentActivity, fset=setCurrentActivity) diff --git a/tutorius/service.py b/tutorius/service.py index 1564339..97d914b 100644 --- a/tutorius/service.py +++ b/tutorius/service.py @@ -87,6 +87,11 @@ class Service(dbus.service.Object): LOGGER.debug("Service.unregister_probe(%s)", unique_id) self._probeMgr.unregister_probe(unique_id) + @dbus.service.method(_DBUS_SERVICE_IFACE, + in_signature='s', out_signature="") + def set_current_act(self, bundle_id): + self._probeMgr.currentActivity = str(bundle_id) + class ServiceProxy: """ Proxy to connect to the Service object, abstracting the DBus interface""" @@ -137,6 +142,9 @@ class ServiceProxy: # asynchronous call to be completed self._service.unregister_probe(unique_id) + def set_current_act(self, bundle_id): + remote_call(self._service.set_current_act, (bundle_id,), block=False) + if __name__ == "__main__": import dbus.mainloop.glib -- cgit v0.9.1