From 2ed75030b2b833fafea002867daea4b690546f6b Mon Sep 17 00:00:00 2001 From: Kilian Valkhof Date: Fri, 5 Feb 2010 17:40:43 +0100 Subject: [PATCH] fix keysequence to use quit when available --- todo | 12 +++++------- trimage.py | 6 ++++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/todo b/todo index 6ce5787..2d7e55f 100644 --- a/todo +++ b/todo @@ -18,13 +18,11 @@ jpgegoptim 1.2.2 advancecomp 1.15 =========================================== later versions: -animate compressing.gif -figure out why QKeySequence.quit doesnt work - -allow selection/deletion of rows from table (and subsequently the imagelist) -check for double files -pnypng api? http://www.gracepointafterfive.com/punypng/api -imagemagick/graphicmagick? + animate compressing.gif + allow selection/deletion of rows from table (and subsequently the imagelist) + check for double files when adding + pnypng api? http://www.gracepointafterfive.com/punypng/api + imagemagick/graphicmagick? thanks to: diff --git a/trimage.py b/trimage.py index d7bf48d..ff3c091 100644 --- a/trimage.py +++ b/trimage.py @@ -26,8 +26,10 @@ class StartQT4(QMainWindow): QWidget.__init__(self, parent) self.ui = Ui_trimage() self.ui.setupUi(self) - #TODO use standardKey Quit. - self.quit_shortcut = QShortcut(QKeySequence("Ctrl+Q"), self) + if hasattr(QKeySequence, 'Quit'): + self.quit_shortcut = QShortcut(QKeySequence(QKeySequence.Quit), self) + else: + self.quit_shortcut = QShortcut(QKeySequence("Ctrl+Q"), self) # disable recompress self.ui.recompress.setEnabled(False)