diff --git a/aqt/addcards.py b/aqt/addcards.py index 48b618875..ccfab18d1 100644 --- a/aqt/addcards.py +++ b/aqt/addcards.py @@ -131,6 +131,12 @@ class AddCards(QDialog): "The first field is empty."), help="AddItems#AddError") return + if '{{cloze:' in note.model()['tmpls'][0]['qfmt']: + if not self.mw.col.models._availClozeOrds( + note.model(), note.joinedFields(), False): + if not askUser(_("You have a cloze deletion note type " + "but have not made any cloze deletions. Proceed?")): + return cards = self.mw.col.addNote(note) if not cards: showWarning(_("""\ diff --git a/aqt/editor.py b/aqt/editor.py index ea6fdcd4c..cfffb0197 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -10,7 +10,7 @@ from anki.hooks import runHook, runFilter from aqt.sound import getAudio from aqt.webview import AnkiWebView from aqt.utils import shortcut, showInfo, showWarning, getBase, getFile, \ - openHelp + openHelp, tooltip import aqt import anki.js from BeautifulSoup import BeautifulSoup @@ -754,14 +754,13 @@ class Editor(object): # check that the model is set up for cloze deletion if '{{cloze:' not in self.note.model()['tmpls'][0]['qfmt']: if self.addMode: - showInfo(_("""\ -To use this button, please select the Cloze note type. To learn more, \ -please click the help button."""), help="cloze") + tooltip(_("Warning, cloze deletions will not work until " + "you switch the type at the top to Cloze.")) else: showInfo(_("""\ To make a cloze deletion on an existing note, you need to change it \ to a cloze type first, via Edit>Change Note Type.""")) - return + return # find the highest existing cloze highest = 0 for name, val in self.note.items():