From ae4bdd7817722448bc27aa2c366ca62251c22c05 Mon Sep 17 00:00:00 2001 From: simon04 Date: Sat, 15 Oct 2011 16:11:31 +0200 Subject: [PATCH] configurator: exit on escape --- weather-extension-configurator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weather-extension-configurator.py b/weather-extension-configurator.py index 2fb18eb..737ef88 100755 --- a/weather-extension-configurator.py +++ b/weather-extension-configurator.py @@ -169,11 +169,16 @@ class App: opt = {} setting_items = ('location', 'appearences') + def keypress(self, widget, event): + if event.keyval == 65307: #Gtk.keysyms.Escape: + Gtk.main_quit() + def __init__(self): self.schema = Gio.Settings('org.gnome.shell.extensions.weather') keys = self.schema.keys() self.window = Gtk.Window(title='Weather Extension Configurator') self.window.connect('destroy', Gtk.main_quit) + self.window.connect('key-press-event', self.keypress) self.window.set_border_width(10) self.items = [] self.settings = {}