mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -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, \
|
||||
saveSplitter, restoreSplitter, showInfo, askUser, getOnlyText, \
|
||||
showWarning, openHelp, openLink
|
||||
from anki.utils import isMac, isWin
|
||||
from anki.utils import isMac, isWin, joinFields
|
||||
from aqt.webview import AnkiWebView
|
||||
|
||||
class CardLayout(QDialog):
|
||||
|
@ -90,6 +90,12 @@ class CardLayout(QDialog):
|
|||
right = QWidget()
|
||||
pform = aqt.forms.preview.Ui_Form()
|
||||
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.frontPrevBox.addWidget(pform.frontWeb)
|
||||
pform.backWeb = AnkiWebView()
|
||||
|
@ -131,6 +137,7 @@ Please create a new card type first."""))
|
|||
rename.setAutoDefault(False)
|
||||
l.addWidget(rename)
|
||||
c(rename, SIGNAL("clicked()"), self.onRename)
|
||||
if self.model['type'] != MODEL_CLOZE:
|
||||
repos = QPushButton(_("Reposition..."))
|
||||
repos.setAutoDefault(False)
|
||||
l.addWidget(repos)
|
||||
|
|
Loading…
Reference in a new issue