diff options
author | Reinier Heeres <rwh@rwh.(none)> | 2007-12-19 12:02:39 (GMT) |
---|---|---|
committer | Reinier Heeres <rwh@rwh.(none)> | 2007-12-19 12:10:21 (GMT) |
commit | 561ef0df68354e93a84024aa46c98d9e3a302b7b (patch) | |
tree | b6ef5b3d16d08e5dc8946a804541017d64f76792 | |
parent | b659df327712dab5ec25b91fc2eec90202cd3a6e (diff) |
Implement ShowObject, #4909
-rwxr-xr-x | journalactivity.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/journalactivity.py b/journalactivity.py index 3339573..6e9a8f5 100755 --- a/journalactivity.py +++ b/journalactivity.py @@ -74,6 +74,16 @@ class JournalActivityDBusService(dbus.service.Object): self._parent.set_search(search_dict) self._parent.search_grab_focus() + @dbus.service.method(J_DBUS_INTERFACE, + in_signature='s', out_signature='') + def ShowObject(self, object_id): + """Pop-up journal and show object with object_id""" + + logging.debug('Trying to show object %s', object_id) + + if self._parent.show_object(object_id): + self._parent.present() + def _chooser_response_cb(self, chooser, response_id, chooser_id): logging.debug('JournalActivityDBusService._chooser_response_cb') if response_id == gtk.RESPONSE_ACCEPT: @@ -208,6 +218,14 @@ class JournalActivity(activity.Activity): self.set_canvas(self._secondary_view) self._secondary_view.show() + def show_object(self, object_id): + jobject = datastore.get(object_id) + if jobject is None: + return False + else: + self._show_secondary_view(jobject) + return True + def _entry_erased_cb(self, toolbar): self._show_main_view() |