Use fieldsAreBlank with the previous note

This commit is contained in:
Arthur Milchior 2019-11-21 02:18:52 +01:00
parent d598434bde
commit 6fc89d2f96

View file

@ -186,9 +186,7 @@ question on all cards."""), help="AddItems")
def _addCards(self): def _addCards(self):
self.editor.saveAddModeVars() self.editor.saveAddModeVars()
note = self.editor.note if not self.addNote(self.editor.note):
note = self.addNote(note)
if not note:
return return
tooltip(_("Added"), period=500) tooltip(_("Added"), period=500)
# stop anything playing # stop anything playing
@ -222,7 +220,7 @@ question on all cards."""), help="AddItems")
def ifCanClose(self, onOk): def ifCanClose(self, onOk):
def afterSave(): def afterSave():
ok = (self.editor.fieldsAreBlank() or ok = (self.editor.fieldsAreBlank(self.previousNote) or
askUser(_("Close and lose current input?"), defaultno=True)) askUser(_("Close and lose current input?"), defaultno=True))
if ok: if ok:
onOk() onOk()