diff --git a/shell/view/ActivityHost.py b/shell/view/ActivityHost.py index f87b65bb..3da8e779 100644 --- a/shell/view/ActivityHost.py +++ b/shell/view/ActivityHost.py @@ -90,6 +90,9 @@ class ActivityHost: else: return profile.get_color() + def execute(self, command, args): + self._activity.execute(command, args) + def share(self): self._activity.share() self._chat_widget.share() diff --git a/shell/view/Shell.py b/shell/view/Shell.py index dad78be8..e5d49de4 100644 --- a/shell/view/Shell.py +++ b/shell/view/Shell.py @@ -88,9 +88,12 @@ class Shell(gobject.GObject): self._frame = Frame(self) self._frame.show_and_hide(3) - def _open_terminal_cb(self): - self.start_activity('org.sugar.Terminal') - return False + def _handle_camera_key(self): + if self._current_host: + if self._current_host.execute('camera', []): + return + + self.start_activity('org.laptop.CameraActivity') def __global_key_pressed_cb(self, grabber, key): if key == 'F1': @@ -114,7 +117,7 @@ class Shell(gobject.GObject): elif key == 'F10': self.toggle_chat_visibility() elif key == '0xDC': # Camera key - pass + self._handle_camera_key() elif key == '0xE0': # Overlay key self.toggle_chat_visibility() elif key == '0x93': # Frame key diff --git a/sugar/activity/Activity.py b/sugar/activity/Activity.py index 03402591..74f940e1 100644 --- a/sugar/activity/Activity.py +++ b/sugar/activity/Activity.py @@ -85,9 +85,9 @@ class ActivityDbusService(dbus.service.Object): return self._activity.get_shared() @dbus.service.method(ACTIVITY_INTERFACE, - in_signature="sas", out_signature="") + in_signature="sas", out_signature="b") def execute(self, command, args): - self._activity.execute(command, args) + return self._activity.execute(command, args) class Activity(gtk.Window): """Base Activity class that all other Activities derive from.""" @@ -170,7 +170,7 @@ class Activity(gtk.Window): def execute(self, command, args): """Execute the given command with args""" - pass + return False def __destroy_cb(self, window): if self._bus: