mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
show cloze count in preview, remove unneeded buttons
This commit is contained in:
parent
8a7c3a9f3c
commit
f480629ed1
1 changed files with 16 additions and 9 deletions
|
@ -10,7 +10,7 @@ from anki.sound import playFromText, clearAudioQueue
|
||||||
from aqt.utils import saveGeom, restoreGeom, getBase, mungeQA, \
|
from aqt.utils import saveGeom, restoreGeom, getBase, mungeQA, \
|
||||||
saveSplitter, restoreSplitter, showInfo, askUser, getOnlyText, \
|
saveSplitter, restoreSplitter, showInfo, askUser, getOnlyText, \
|
||||||
showWarning, openHelp, openLink
|
showWarning, openHelp, openLink
|
||||||
from anki.utils import isMac, isWin
|
from anki.utils import isMac, isWin, joinFields
|
||||||
from aqt.webview import AnkiWebView
|
from aqt.webview import AnkiWebView
|
||||||
|
|
||||||
class CardLayout(QDialog):
|
class CardLayout(QDialog):
|
||||||
|
@ -90,6 +90,12 @@ class CardLayout(QDialog):
|
||||||
right = QWidget()
|
right = QWidget()
|
||||||
pform = aqt.forms.preview.Ui_Form()
|
pform = aqt.forms.preview.Ui_Form()
|
||||||
pform.setupUi(right)
|
pform.setupUi(right)
|
||||||
|
# for cloze notes, show that it's one of n cards
|
||||||
|
if self.model['type'] == MODEL_CLOZE:
|
||||||
|
cnt = len(self.mm.availOrds(
|
||||||
|
self.model, joinFields(self.note.fields)))
|
||||||
|
for g in pform.groupBox, pform.groupBox_2:
|
||||||
|
g.setTitle(g.title() + _(" (1 of %d)") % max(cnt, 1))
|
||||||
pform.frontWeb = AnkiWebView()
|
pform.frontWeb = AnkiWebView()
|
||||||
pform.frontPrevBox.addWidget(pform.frontWeb)
|
pform.frontPrevBox.addWidget(pform.frontWeb)
|
||||||
pform.backWeb = AnkiWebView()
|
pform.backWeb = AnkiWebView()
|
||||||
|
@ -131,6 +137,7 @@ Please create a new card type first."""))
|
||||||
rename.setAutoDefault(False)
|
rename.setAutoDefault(False)
|
||||||
l.addWidget(rename)
|
l.addWidget(rename)
|
||||||
c(rename, SIGNAL("clicked()"), self.onRename)
|
c(rename, SIGNAL("clicked()"), self.onRename)
|
||||||
|
if self.model['type'] != MODEL_CLOZE:
|
||||||
repos = QPushButton(_("Reposition..."))
|
repos = QPushButton(_("Reposition..."))
|
||||||
repos.setAutoDefault(False)
|
repos.setAutoDefault(False)
|
||||||
l.addWidget(repos)
|
l.addWidget(repos)
|
||||||
|
|
Loading…
Reference in a new issue