mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
2 tooltips in Preview window and support Enter
Let's give the users tips over the arrow buttons and provide passing Back Side / Next Card by pressing Enter key.
This commit is contained in:
parent
640d906230
commit
692dcfd4e7
1 changed files with 9 additions and 1 deletions
|
@ -1009,25 +1009,33 @@ where id in %s""" % ids2str(sf))
|
||||||
self._previewState = "question"
|
self._previewState = "question"
|
||||||
self._previewWindow = QDialog(None, Qt.Window)
|
self._previewWindow = QDialog(None, Qt.Window)
|
||||||
self._previewWindow.setWindowTitle(_("Preview"))
|
self._previewWindow.setWindowTitle(_("Preview"))
|
||||||
|
|
||||||
c(self._previewWindow, SIGNAL("finished(int)"), self._onPreviewFinished)
|
c(self._previewWindow, SIGNAL("finished(int)"), self._onPreviewFinished)
|
||||||
vbox = QVBoxLayout()
|
vbox = QVBoxLayout()
|
||||||
vbox.setMargin(0)
|
vbox.setMargin(0)
|
||||||
self._previewWeb = AnkiWebView()
|
self._previewWeb = AnkiWebView()
|
||||||
vbox.addWidget(self._previewWeb)
|
vbox.addWidget(self._previewWeb)
|
||||||
bbox = QDialogButtonBox()
|
bbox = QDialogButtonBox()
|
||||||
|
|
||||||
self._previewReplay = bbox.addButton(_("Replay Audio"), QDialogButtonBox.ActionRole)
|
self._previewReplay = bbox.addButton(_("Replay Audio"), QDialogButtonBox.ActionRole)
|
||||||
self._previewReplay.setAutoDefault(False)
|
self._previewReplay.setAutoDefault(False)
|
||||||
self._previewReplay.setShortcut(QKeySequence("R"))
|
self._previewReplay.setShortcut(QKeySequence("R"))
|
||||||
self._previewReplay.setToolTip(_("Shortcut key: %s" % "R"))
|
self._previewReplay.setToolTip(_("Shortcut key: %s" % "R"))
|
||||||
|
|
||||||
self._previewPrev = bbox.addButton("<", QDialogButtonBox.ActionRole)
|
self._previewPrev = bbox.addButton("<", QDialogButtonBox.ActionRole)
|
||||||
self._previewPrev.setAutoDefault(False)
|
self._previewPrev.setAutoDefault(False)
|
||||||
self._previewPrev.setShortcut(QKeySequence("Left"))
|
self._previewPrev.setShortcut(QKeySequence("Left"))
|
||||||
|
self._previewPrev.setToolTip(_("Shortcut key: Left arrow"))
|
||||||
|
|
||||||
self._previewNext = bbox.addButton(">", QDialogButtonBox.ActionRole)
|
self._previewNext = bbox.addButton(">", QDialogButtonBox.ActionRole)
|
||||||
self._previewNext.setAutoDefault(False)
|
self._previewNext.setAutoDefault(True)
|
||||||
self._previewNext.setShortcut(QKeySequence("Right"))
|
self._previewNext.setShortcut(QKeySequence("Right"))
|
||||||
|
self._previewPrev.setToolTip(_("Shortcut key: Right arrow or Enter"))
|
||||||
|
|
||||||
c(self._previewPrev, SIGNAL("clicked()"), self._onPreviewPrev)
|
c(self._previewPrev, SIGNAL("clicked()"), self._onPreviewPrev)
|
||||||
c(self._previewNext, SIGNAL("clicked()"), self._onPreviewNext)
|
c(self._previewNext, SIGNAL("clicked()"), self._onPreviewNext)
|
||||||
c(self._previewReplay, SIGNAL("clicked()"), self._onReplayAudio)
|
c(self._previewReplay, SIGNAL("clicked()"), self._onReplayAudio)
|
||||||
|
|
||||||
vbox.addWidget(bbox)
|
vbox.addWidget(bbox)
|
||||||
self._previewWindow.setLayout(vbox)
|
self._previewWindow.setLayout(vbox)
|
||||||
restoreGeom(self._previewWindow, "preview")
|
restoreGeom(self._previewWindow, "preview")
|
||||||
|
|
Loading…
Reference in a new issue