mirror of
https://github.com/ankitects/anki.git
synced 2025-11-12 15:47:12 -05:00
don't show tab add/close buttons in cloze model
This commit is contained in:
parent
b91b5babe2
commit
91e59dc35b
2 changed files with 9 additions and 7 deletions
|
|
@ -49,9 +49,11 @@ class CardLayout(QDialog):
|
||||||
|
|
||||||
def setupTabs(self):
|
def setupTabs(self):
|
||||||
c = self.connect
|
c = self.connect
|
||||||
|
cloze = self.model['type'] == MODEL_CLOZE
|
||||||
self.tabs = QTabWidget()
|
self.tabs = QTabWidget()
|
||||||
self.tabs.setTabsClosable(True)
|
self.tabs.setTabsClosable(not cloze)
|
||||||
self.tabs.setUsesScrollButtons(True)
|
self.tabs.setUsesScrollButtons(True)
|
||||||
|
if not cloze:
|
||||||
add = QPushButton("+")
|
add = QPushButton("+")
|
||||||
add.setFixedWidth(30)
|
add.setFixedWidth(30)
|
||||||
add.setToolTip(_("Add new card"))
|
add.setToolTip(_("Add new card"))
|
||||||
|
|
|
||||||
|
|
@ -669,7 +669,7 @@ class Editor(object):
|
||||||
|
|
||||||
def onCloze(self):
|
def onCloze(self):
|
||||||
# check that the model is set up for cloze deletion
|
# check that the model is set up for cloze deletion
|
||||||
if 'cloze' not in self.note.model()['tmpls'][0]['qfmt']:
|
if '{{cloze:' not in self.note.model()['tmpls'][0]['qfmt']:
|
||||||
openHelp("cloze")
|
openHelp("cloze")
|
||||||
return
|
return
|
||||||
f = self.note.fields[self.currentField]
|
f = self.note.fields[self.currentField]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue