From 363571cc94badd51b59bb98a1a3b86338160f9f2 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 28 Mar 2011 10:20:27 +0900 Subject: [PATCH] trigger on key release instead of press; add overview action+shortcut --- aqt/main.py | 7 ++++++- aqt/webview.py | 2 +- designer/main.ui | 19 ++++++++++++++----- designer/studyopts.ui | 37 +++++++++++++++++++++++++++---------- 4 files changed, 48 insertions(+), 17 deletions(-) diff --git a/aqt/main.py b/aqt/main.py index 8b0c19920..1d7868137 100755 --- a/aqt/main.py +++ b/aqt/main.py @@ -527,7 +527,7 @@ Debug info:\n%s""") % traceback.format_exc(), help="DeckErrors") tb.addAction(frm.actionEditCurrent) tb.addAction(frm.actionEditLayout) tb.addAction(frm.actionEditdeck) - tb.addAction(frm.actionStudyOptions) + tb.addAction(frm.actionOverview) tb.addAction(frm.actionGraphs) tb.addAction(frm.actionMarkCard) tb.addAction(frm.actionRepeatAudio) @@ -650,6 +650,9 @@ Debug info:\n%s""") % traceback.format_exc(), help="DeckErrors") def onStudyOptions(self): aqt.studyopts.StudyOptions(self) + def onOverview(self): + self.moveToState("overview") + def onCardStats(self): self.cardStats.show() @@ -744,6 +747,7 @@ Please give your deck a name:""")) "Dstats", "Cstats", "StudyOptions", + "Overview", ) deckRelatedMenus = ( @@ -787,6 +791,7 @@ Please give your deck a name:""")) self.connect(m.actionDownloadMissingMedia, s, self.onDownloadMissingMedia) self.connect(m.actionLocalizeMedia, s, self.onLocalizeMedia) self.connect(m.actionStudyOptions, s, self.onStudyOptions) + self.connect(m.actionOverview, s, self.onOverview) self.connect(m.actionDonate, s, self.onDonate) self.connect(m.actionBuryFact, s, self.onBuryFact) diff --git a/aqt/webview.py b/aqt/webview.py index 97c82fc7e..8f93e6100 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -53,7 +53,7 @@ class AnkiWebView(QWebView): self.setKeyHandler() self.connect(self, SIGNAL("linkClicked(QUrl)"), self._linkHandler) self.connect(self, SIGNAL("loadFinished(bool)"), self._loadFinished) - def keyPressEvent(self, evt): + def keyReleaseEvent(self, evt): if evt.matches(QKeySequence.Copy): self.triggerPageAction(QWebPage.Copy) evt.accept() diff --git a/designer/main.ui b/designer/main.ui index ce7fa95ca..98463b129 100644 --- a/designer/main.ui +++ b/designer/main.ui @@ -40,7 +40,7 @@ 0 0 412 - 20 + 22 @@ -149,6 +149,7 @@ + @@ -550,10 +551,6 @@ - - - :/icons/chronometer.png:/icons/chronometer.png - &Study Options... @@ -670,6 +667,18 @@ Localize Media + + + + :/icons/chronometer.png:/icons/chronometer.png + + + &Overview... + + + O + + diff --git a/designer/studyopts.ui b/designer/studyopts.ui index 0b0c75e6f..e89d3ee11 100644 --- a/designer/studyopts.ui +++ b/designer/studyopts.ui @@ -6,14 +6,14 @@ 0 0 - 435 + 390 334 Dialog - + @@ -145,14 +145,31 @@ - - - Qt::Vertical - - - QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok - - + + + + + Qt::Vertical + + + QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + +