mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
trigger on key release instead of press; add overview action+shortcut
This commit is contained in:
parent
a036b97a68
commit
363571cc94
4 changed files with 48 additions and 17 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>412</width>
|
||||
<height>20</height>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
|
@ -149,6 +149,7 @@
|
|||
<addaction name="menuStartup"/>
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
<addaction name="actionOverview"/>
|
||||
<addaction name="actionStudyOptions"/>
|
||||
<addaction name="actionDeckProperties"/>
|
||||
<addaction name="separator"/>
|
||||
|
@ -550,10 +551,6 @@
|
|||
</property>
|
||||
</action>
|
||||
<action name="actionStudyOptions">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/chronometer.png</normaloff>:/icons/chronometer.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Study Options...</string>
|
||||
</property>
|
||||
|
@ -670,6 +667,18 @@
|
|||
<string>Localize Media</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionOverview">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/chronometer.png</normaloff>:/icons/chronometer.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Overview...</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>O</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="icons.qrc"/>
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>435</width>
|
||||
<width>390</width>
|
||||
<height>334</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
|
@ -144,6 +144,8 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,0">
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
|
@ -154,6 +156,21 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
|
|
Loading…
Reference in a new issue