From d6ec6db8809659e827a2d5f6387451084e99338c Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 20 Jul 2006 10:13:47 +0000 Subject: Make the console contextual to the activity and use the window manager to activate it. --- (limited to 'sugar') diff --git a/sugar/LogWriter.py b/sugar/LogWriter.py index a04d14b..ba8bdb0 100644 --- a/sugar/LogWriter.py +++ b/sugar/LogWriter.py @@ -11,8 +11,8 @@ class LogWriter: self._use_console = use_console bus = dbus.SessionBus() - proxy_obj = bus.get_object('com.redhat.Sugar.Logger', '/com/redhat/Sugar/Logger') - self._logger = dbus.Interface(proxy_obj, 'com.redhat.Sugar.Logger') + proxy_obj = bus.get_object('com.redhat.Sugar.Shell', '/com/redhat/Sugar/Shell') + self._logger = dbus.Interface(proxy_obj, 'com.redhat.Sugar.Shell') def start(self): if self._use_console: diff --git a/sugar/activity/Activity.py b/sugar/activity/Activity.py index a7c5a6a..b7575e5 100644 --- a/sugar/activity/Activity.py +++ b/sugar/activity/Activity.py @@ -8,7 +8,6 @@ import gtk import gobject from sugar.LogWriter import LogWriter -from sugar import keybindings import sugar.util ACTIVITY_SERVICE_NAME = "com.redhat.Sugar.Activity" @@ -129,6 +128,12 @@ class ActivityDbusService(dbus.service.Object): """Get the activity identifier""" return self._activity.get_id() + + @dbus.service.method(ACTIVITY_SERVICE_NAME) + def get_default_type(self): + """Get the activity default type""" + return self._activity.get_default_type() + @dbus.service.method(ACTIVITY_SERVICE_NAME) def get_shared(self): """Get the activity identifier""" @@ -152,8 +157,6 @@ class Activity(gtk.Window): self._activity_object = None self._default_type = None - keybindings.setup_global_keys(self) - self.connect('realize', self.__realize) self.present() diff --git a/sugar/keybindings.py b/sugar/keybindings.py deleted file mode 100644 index f6b0feb..0000000 --- a/sugar/keybindings.py +++ /dev/null @@ -1,17 +0,0 @@ -import gtk -import dbus - -# FIXME These should be handled by the wm, but it's incovenient -# to do that with matchbox at the moment - -def setup_global_keys(window, shell = None): - if not shell: - bus = dbus.SessionBus() - proxy_obj = bus.get_object('com.redhat.Sugar.Shell', '/com/redhat/Sugar/Shell') - shell = dbus.Interface(proxy_obj, 'com.redhat.Sugar.Shell') - - window.connect("key-press-event", __key_press_event_cb, shell) - -def __key_press_event_cb(window, event, shell): - if event.keyval == gtk.keysyms.F3: - shell.toggle_console() -- cgit v0.9.1