From aa15cbeff005a679161d76c7087ab7ccc5bf6961 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 29 Jan 2009 17:08:14 +0900 Subject: [PATCH] select current card's model if available --- ankiqt/ui/deckproperties.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ankiqt/ui/deckproperties.py b/ankiqt/ui/deckproperties.py index ad3062875..d9d4230ef 100644 --- a/ankiqt/ui/deckproperties.py +++ b/ankiqt/ui/deckproperties.py @@ -12,6 +12,7 @@ from anki.deck import newCardOrderLabels, newCardSchedulingLabels from anki.deck import revCardOrderLabels from anki.utils import hexifyID, dehexifyID from anki.lang import ngettext +import ankiqt tabs = ("ModelsAndPriorities", "Synchronization", @@ -111,7 +112,10 @@ class DeckProperties(QDialog): for (name, model) in self.models: item = QListWidgetItem(name) self.dialog.modelsList.addItem(item) - if model == self.d.currentModel: + cm = self.d.currentModel + if ankiqt.mw.currentCard: + cm = ankiqt.mw.currentCard.fact.model + if model == cm: self.dialog.modelsList.setCurrentItem(item) def onAdd(self):