diff --git a/ankiqt/ui/cardlist.py b/ankiqt/ui/cardlist.py index dc43ddb65..4cf3b2a99 100644 --- a/ankiqt/ui/cardlist.py +++ b/ankiqt/ui/cardlist.py @@ -513,7 +513,7 @@ class EditDeck(QMainWindow): "sel": ngettext("%d selected", "%d selected", selected) % selected }) - def onEvent(self): + def onEvent(self, type='field'): if self.deck.undoAvailable(): self.dialog.actionUndo.setText(_("Undo %s") % self.deck.undoName()) @@ -529,6 +529,8 @@ class EditDeck(QMainWindow): # update list if self.currentRow and self.model.cards: self.model.updateCard(self.currentRow) + if type == "tag": + self.drawTags() def filterTextChanged(self): interval = 300 @@ -730,6 +732,7 @@ where id in (%s)""" % ",".join([ self.rowChanged(self.currentRow, None) if reset: self.updateSearch() + self.drawTags() self.parent.moveToState("auto") # Menu options diff --git a/ankiqt/ui/facteditor.py b/ankiqt/ui/facteditor.py index 9ee6d967a..6a90c8bab 100644 --- a/ankiqt/ui/facteditor.py +++ b/ankiqt/ui/facteditor.py @@ -512,7 +512,7 @@ class FactEditor(object): self.saveFields() self.checkValid() if self.onChange: - self.onChange() + self.onChange('field') self.changeTimer = None def saveFieldsNow(self): @@ -524,7 +524,7 @@ class FactEditor(object): self.changeTimer.stop() self.changeTimer = None if self.onChange: - self.onChange() + self.onChange('field') # save fields and run features w = self.focusedEdit() if w: @@ -566,14 +566,14 @@ class FactEditor(object): return old = self.fact.tags self.fact.tags = canonifyTags(unicode(self.tags.text())) - if self.onChange: - self.onChange() if old != self.fact.tags: self.deck.s.flush() self.deck.updateFactTags([self.fact.id]) self.deck.updatePriorities([c.id for c in self.fact.cards]) self.fact.setModified(textChanged=True) self.deck.flushMod() + if self.onChange: + self.onChange('tag') def focusField(self, fieldName): self.fields[fieldName][1].setFocus()