From d598434bde57c0cb053327ddfbba412fcd39283f Mon Sep 17 00:00:00 2001 From: Arthur Milchior Date: Thu, 21 Nov 2019 02:18:14 +0100 Subject: [PATCH] Fields are blank compare to previous note So if a note is not empty but only because sticky fields didn't change, then it's considered as empty and we can close the windows without asking --- aqt/editor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aqt/editor.py b/aqt/editor.py index a190febf8..ad8d1f508 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -371,12 +371,15 @@ class Editor: contents)) browser.onSearchActivated() - def fieldsAreBlank(self): + def fieldsAreBlank(self, previousNote=None): if not self.note: return True m = self.note.model() for c, f in enumerate(self.note.fields): - if f and not m['flds'][c]['sticky']: + notChangedvalues = {"", "
"} + if previousNote and m['flds'][c]['sticky']: + notChangedvalues.add(previousNote.fields[c]) + if f not in notChangedvalues: return False return True