Close XML Console Window with ESC

This commit is contained in:
Philipp Hörist 2017-02-06 23:12:31 +01:00
parent 5dff9bb057
commit ad936b8df8
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 --> <!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<object class="GtkImage" id="image1"> <object class="GtkImage" id="image1">
@ -13,6 +13,7 @@
<property name="default_width">550</property> <property name="default_width">550</property>
<property name="default_height">450</property> <property name="default_height">450</property>
<signal name="destroy" handler="on_xml_console_window_destroy" swapped="no"/> <signal name="destroy" handler="on_xml_console_window_destroy" swapped="no"/>
<signal name="key-press-event" handler="on_key_press_event" swapped="no"/>
<child> <child>
<object class="GtkBox" id="vbox"> <object class="GtkBox" id="vbox">
<property name="visible">True</property> <property name="visible">True</property>

View File

@ -3397,6 +3397,10 @@ class XMLConsoleWindow:
self.xml.connect_signals(self) self.xml.connect_signals(self)
def on_key_press_event(self, widget, event):
if event.keyval == Gdk.KEY_Escape:
self.window.destroy()
def on_xml_console_window_destroy(self, widget): def on_xml_console_window_destroy(self, widget):
del gajim.interface.instances[self.account]['xml_console'] del gajim.interface.instances[self.account]['xml_console']
gajim.ged.remove_event_handler('stanza-received', ged.GUI1, gajim.ged.remove_event_handler('stanza-received', ged.GUI1,