Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/chat
diff options
context:
space:
mode:
authorMarco 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)
commit92a470824413c896df5a97efc2db8bb10bfe6d48 (patch)
treecceb95b622d1125f50666f13c5c2f47a810cac17 /sugar/chat
parenta8c9f4301b7c8b66ee985199f7273d9fcd541b55 (diff)
Make sketches work in one-to-one chat
Diffstat (limited to 'sugar/chat')
-rw-r--r--sugar/chat/Chat.py10
-rw-r--r--sugar/chat/ChatWindow.py10
2 files changed, 10 insertions, 10 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
diff --git a/sugar/chat/ChatWindow.py b/sugar/chat/ChatWindow.py
index 59cb02c..b06175d 100644
--- a/sugar/chat/ChatWindow.py
+++ b/sugar/chat/ChatWindow.py
@@ -8,7 +8,6 @@ class ChatWindow(gtk.Window):
def __init__(self):
gtk.Window.__init__(self)
self._chat = None
- self.connect("key-press-event", self.__key_press_event_cb)
def set_chat(self, chat):
if self._chat != None:
@@ -17,12 +16,3 @@ class ChatWindow(gtk.Window):
self._chat = chat
self.add(self._chat)
self._chat.show()
-
- def __key_press_event_cb(self, window, event):
- if event.keyval == gtk.keysyms.s and \
- event.state & gtk.gdk.CONTROL_MASK:
- if self._chat.get_mode() == Chat.SKETCH_MODE:
- self._chat.set_mode(Chat.TEXT_MODE)
- elif self._chat.get_mode() == Chat.TEXT_MODE:
- self._chat.set_mode(Chat.SKETCH_MODE)
-