[pitivi] clipmediaprops: Allow closing the dialog with ESC



commit 771db7eeae25b9cd9b39c4a11ed8e2b8d5e13836
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sat Mar 1 23:35:24 2014 +0100

    clipmediaprops: Allow closing the dialog with ESC

 pitivi/dialogs/clipmediaprops.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/dialogs/clipmediaprops.py b/pitivi/dialogs/clipmediaprops.py
index b75c293..0b6e04b 100644
--- a/pitivi/dialogs/clipmediaprops.py
+++ b/pitivi/dialogs/clipmediaprops.py
@@ -19,8 +19,9 @@
 
 import os
 
-from gi.repository import Gtk
+from gi.repository import Gdk
 from gi.repository import Gst
+from gi.repository import Gtk
 
 from gettext import gettext as _
 
@@ -106,6 +107,8 @@ class ClipMediaPropsDialog(object):
             self.hbox2.hide()
             self.hbox3.hide()
             self.label2.set_markup("<b>" + _("Image:") + "</b>")
+
+        self.dialog.connect("key-press-event", self._keyPressCb)
         self.dialog.run()
 
     def _applyButtonCb(self, unused_button):
@@ -134,3 +137,8 @@ class ClipMediaPropsDialog(object):
     def _cancelButtonCb(self, unused_button):
         """Destroy the dialog"""
         self.dialog.destroy()
+
+    def _keyPressCb(self, unused_widget, event):
+        if event.keyval in (Gdk.KEY_Escape, Gdk.KEY_Q, Gdk.KEY_q):
+            self.dialog.destroy()
+        return True


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]