From f234ebfff0f40d8eb49fce34242e730e43c179fe Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 15 Jun 2006 17:42:35 -0400 Subject: [PATCH] Merge with Marco --- README | 8 ++++++++ sugar/chat/Chat.py | 2 +- sugar/shell/PresenceWindow.py | 5 +---- sugar/shell/shell.py | 16 +++++++++++++++- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/README b/README index 0407c8fe..937f29c5 100644 --- a/README +++ b/README @@ -35,3 +35,11 @@ For example: sugar/sugar --test my_nick_name1 sugar/sugar --test my_nick_name2 ... + + +Key bindings +============ + +ctrl+Up Toggle chat window visibility +ctrl+Left Toggle presence window visibility +F11 Toggle activities window fullscreen diff --git a/sugar/chat/Chat.py b/sugar/chat/Chat.py index c0494354..c06bbc17 100644 --- a/sugar/chat/Chat.py +++ b/sugar/chat/Chat.py @@ -22,7 +22,7 @@ class Chat(gtk.Window): SERVICE_PORT = 6100 def __init__(self): - gtk.Window.__init__(self) + gtk.Window.__init__(self, gtk.WINDOW_POPUP) self._stream_writer = None diff --git a/sugar/shell/PresenceWindow.py b/sugar/shell/PresenceWindow.py index 75236657..35f06a3e 100644 --- a/sugar/shell/PresenceWindow.py +++ b/sugar/shell/PresenceWindow.py @@ -11,10 +11,7 @@ class PresenceWindow(gtk.Window): _MODEL_COL_BUDDY = 2 def __init__(self, activity_container): - gtk.Window.__init__(self) - - self.set_decorated(False) - self.set_skip_taskbar_hint(True) + gtk.Window.__init__(self, gtk.WINDOW_POPUP) self._activity_container = activity_container diff --git a/sugar/shell/shell.py b/sugar/shell/shell.py index f7eaa18a..cb811540 100755 --- a/sugar/shell/shell.py +++ b/sugar/shell/shell.py @@ -215,7 +215,6 @@ class ActivityHost(dbus.service.Object): class ActivityContainer(dbus.service.Object): def __init__(self, service, bus): - self.activities = [] self.bus = bus @@ -225,7 +224,11 @@ class ActivityContainer(dbus.service.Object): bus.add_signal_receiver(self.name_owner_changed, dbus_interface = "org.freedesktop.DBus", signal_name = "NameOwnerChanged") self.window = gtk.Window() + self.window.connect("key-press-event", self.__key_press_event_cb) self.window.set_title("OLPC Sugar") + + self._fullscreen = False + self.notebook = gtk.Notebook() tab_label = gtk.Label("Everyone") @@ -308,6 +311,15 @@ class ActivityContainer(dbus.service.Object): for owner, activity in self.activities: print " %d: owner=%s activity_object_name=%s" % (i, owner, activity.dbus_object_name) i += 1 + + def __key_press_event_cb(self, window, event): + if event.keyval == gtk.keysyms.F11: + if self._fullscreen: + window.unfullscreen() + self._fullscreen = False + else: + window.fullscreen() + self._fullscreen = True class ConsoleLogger(dbus.service.Object): def __init__(self): @@ -383,6 +395,7 @@ def main(): wm.manage() presence_window = PresenceWindow(activity_container) + presence_window.set_transient_for(activity_container.window) wm = WindowManager(presence_window) @@ -392,6 +405,7 @@ def main(): wm.manage() group_chat = GroupChat() + group_chat.set_transient_for(activity_container.window) group_chat.set_decorated(False) group_chat.set_skip_taskbar_hint(True)