From bac6ec88dd399d9889a31ac54b8c13ac6fca979d Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Wed, 6 Apr 2005 07:31:18 +0000
Subject: [PATCH] close the groupchat window when esc is pressed

---
 plugins/gtkgui/groupchat_window.py | 5 +++--
 plugins/gtkgui/gtkgui.glade        | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/plugins/gtkgui/groupchat_window.py b/plugins/gtkgui/groupchat_window.py
index ddc1f4a830..ac47c2eb52 100644
--- a/plugins/gtkgui/groupchat_window.py
+++ b/plugins/gtkgui/groupchat_window.py
@@ -57,6 +57,8 @@ class Groupchat_window(Chat):
 			self.on_chat_notebook_switch_page)
 		self.xml.signal_connect('on_set_button_clicked', \
 			self.on_set_button_clicked)
+		self.xml.signal_connect('on_groupchat_window_key_press_event', \
+			self.on_groupchat_window_key_press_event)
 
 	def on_groupchat_window_delete_event(self, widget, event):
 		"""close window"""
@@ -486,8 +488,7 @@ class Groupchat_window(Chat):
 		self.redraw_tab(room_jid)
 		self.show_title()
 	
-	def on_join_groupchat_window_key_press_event(self, widget, event):
-		print 'called'
+	def on_groupchat_window_key_press_event(self, widget, event):
 		if event.keyval == gtk.keysyms.Escape:
 			widget.get_toplevel().destroy()
 
diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade
index 313557dbab..76af651b06 100644
--- a/plugins/gtkgui/gtkgui.glade
+++ b/plugins/gtkgui/gtkgui.glade
@@ -7648,6 +7648,7 @@ Custom</property>
   <signal name="focus_in_event" handler="on_groupchat_window_focus_in_event" last_modification_time="Sat, 05 Mar 2005 00:34:51 GMT"/>
   <signal name="delete_event" handler="on_groupchat_window_delete_event" last_modification_time="Mon, 07 Mar 2005 11:19:05 GMT"/>
   <signal name="destroy" handler="on_groupchat_window_destroy" last_modification_time="Mon, 07 Mar 2005 16:46:37 GMT"/>
+  <signal name="key_press_event" handler="on_groupchat_window_key_press_event" last_modification_time="Wed, 06 Apr 2005 07:24:19 GMT"/>
 
   <child>
     <widget class="GtkVBox" id="vbox27">
-- 
GitLab