diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-06-23 18:11:26 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-06-23 18:11:26 (GMT) |
commit | 92a470824413c896df5a97efc2db8bb10bfe6d48 (patch) | |
tree | cceb95b622d1125f50666f13c5c2f47a810cac17 /sugar/chat/Chat.py | |
parent | a8c9f4301b7c8b66ee985199f7273d9fcd541b55 (diff) |
Make sketches work in one-to-one chat
Diffstat (limited to 'sugar/chat/Chat.py')
-rw-r--r-- | sugar/chat/Chat.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sugar/chat/Chat.py b/sugar/chat/Chat.py index 325fa7f..51f24f9 100644 --- a/sugar/chat/Chat.py +++ b/sugar/chat/Chat.py @@ -64,6 +64,16 @@ class Chat(gtk.VBox): self.pack_start(self._editor, False) self._editor.show() + self.connect("key-press-event", self.__key_press_event_cb) + + def __key_press_event_cb(self, window, event): + if event.keyval == gtk.keysyms.s and \ + event.state & gtk.gdk.CONTROL_MASK: + if self.get_mode() == Chat.SKETCH_MODE: + self.set_mode(Chat.TEXT_MODE) + elif self.get_mode() == Chat.TEXT_MODE: + self.set_mode(Chat.SKETCH_MODE) + def get_mode(self): return self._mode |