From 84d6f88e7146287cdf773e79ad52f29c1a7675d9 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 7 Dec 2010 17:27:10 +0900 Subject: [PATCH] make sure field saved before toggling mark/suspend --- ankiqt/ui/cardlist.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ankiqt/ui/cardlist.py b/ankiqt/ui/cardlist.py index e755cf0a6..b109a6ede 100644 --- a/ankiqt/ui/cardlist.py +++ b/ankiqt/ui/cardlist.py @@ -829,6 +829,8 @@ where id in (%s)""" % ",".join([ self.updateAfterCardChange() def addTags(self, tags=None, label=None): + # focus lost hook may not have chance to fire + self.editor.saveFieldsNow() if tags is None: (tags, r) = ui.utils.getTag(self, self.deck, _("Enter tags to add:")) else: @@ -844,6 +846,8 @@ where id in (%s)""" % ",".join([ self.updateAfterCardChange() def deleteTags(self, tags=None, label=None): + # focus lost hook may not have chance to fire + self.editor.saveFieldsNow() if tags is None: (tags, r) = ui.utils.getTag(self, self.deck, _("Enter tags to delete:")) else: @@ -866,6 +870,8 @@ where id in (%s)""" % ",".join([ return self.currentCard and self.currentCard.priority == -3 def onSuspend(self, sus): + # focus lost hook may not have chance to fire + self.editor.saveFieldsNow() if sus: self._onSuspend() else: