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
This commit is contained in:
Arthur Milchior 2019-11-21 02:18:14 +01:00
parent f41014ca4b
commit d598434bde

View File

@ -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 = {"", "<br>"}
if previousNote and m['flds'][c]['sticky']:
notChangedvalues.add(previousNote.fields[c])
if f not in notChangedvalues:
return False
return True