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,14 +137,15 @@ 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)
|
||||||
repos = QPushButton(_("Reposition..."))
|
if self.model['type'] != MODEL_CLOZE:
|
||||||
repos.setAutoDefault(False)
|
repos = QPushButton(_("Reposition..."))
|
||||||
l.addWidget(repos)
|
repos.setAutoDefault(False)
|
||||||
c(repos, SIGNAL("clicked()"), self.onReorder)
|
l.addWidget(repos)
|
||||||
tgt = QPushButton(_("Deck..."))
|
c(repos, SIGNAL("clicked()"), self.onReorder)
|
||||||
tgt.setAutoDefault(False)
|
tgt = QPushButton(_("Deck..."))
|
||||||
l.addWidget(tgt)
|
tgt.setAutoDefault(False)
|
||||||
c(tgt, SIGNAL("clicked()"), self.onTargetDeck)
|
l.addWidget(tgt)
|
||||||
|
c(tgt, SIGNAL("clicked()"), self.onTargetDeck)
|
||||||
l.addStretch()
|
l.addStretch()
|
||||||
close = QPushButton(_("Close"))
|
close = QPushButton(_("Close"))
|
||||||
close.setAutoDefault(False)
|
close.setAutoDefault(False)
|
||||||
|
|
Loading…
Reference in a new issue