Close Archiving Preferences Window with ESC

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

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="GtkImage" id="add_image">
@ -43,6 +43,7 @@
<property name="window_position">center</property>
<property name="default_width">450</property>
<signal name="destroy" handler="on_archiving_preferences_window_destroy" swapped="no"/>
<signal name="key-press-event" handler="on_key_press_event" swapped="no"/>
<child>
<object class="GtkGrid" id="pref_grid">
<property name="visible">True</property>

View File

@ -4144,6 +4144,10 @@ class Archiving313PreferencesWindow:
self.idle_id = GLib.timeout_add_seconds(3, self._nec_archiving_error)
gajim.connections[self.account].request_archive_preferences()
def on_key_press_event(self, widget, event):
if event.keyval == Gdk.KEY_Escape:
self.window.destroy()
def set_widget_state(self, state):
for widget in ('default_cb', 'save_button', 'add_button',
'remove_button'):