mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05:00
don't allow final template to be deleted in empty note type
This commit is contained in:
parent
9fc21a61dc
commit
21d60086a8
2 changed files with 3 additions and 1 deletions
|
|
@ -106,6 +106,8 @@ class CardLayout(QDialog):
|
||||||
self.tabs.addTab(w, t['name'])
|
self.tabs.addTab(w, t['name'])
|
||||||
|
|
||||||
def onRemoveTab(self, idx):
|
def onRemoveTab(self, idx):
|
||||||
|
if len(self.model['tmpls']) < 2:
|
||||||
|
return showInfo(_("At least one template is required."))
|
||||||
if not askUser(_("Remove all cards of this type?")):
|
if not askUser(_("Remove all cards of this type?")):
|
||||||
return
|
return
|
||||||
if not self.mm.remTemplate(self.model, self.cards[idx].template()):
|
if not self.mm.remTemplate(self.model, self.cards[idx].template()):
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPlainTextEdit" name="log">
|
<widget class="QPlainTextEdit" name="log">
|
||||||
<property name="focusPolicy">
|
<property name="focusPolicy">
|
||||||
<enum>Qt::NoFocus</enum>
|
<enum>Qt::ClickFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue