make sure we save tags regardless of where the focus is

This commit is contained in:
Damien Elmes 2012-07-04 20:37:38 +09:00
parent 61c577df85
commit b77ab05421

View file

@ -579,12 +579,12 @@ class Editor(object):
"Must call this before adding cards, closing dialog, etc."
if not self.note:
return
self.saveTags()
if self.mw.app.focusWidget() != self.web:
# if no fields are focused, there's nothing to save
return
# move focus out of fields and save tags
self.parentWindow.setFocus()
self.saveTags()
# and process events so any focus-lost hooks fire
self.mw.app.processEvents()