mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
make sure to always deinit modelChooser
This commit is contained in:
parent
7d74be890b
commit
c5b02a5835
1 changed files with 3 additions and 2 deletions
|
@ -1385,18 +1385,19 @@ class ChangeModelDialog(QDialog):
|
||||||
cmap = self.getTemplateMap()
|
cmap = self.getTemplateMap()
|
||||||
if not cmap or (self.targetModel != self.oldModel and
|
if not cmap or (self.targetModel != self.oldModel and
|
||||||
not fmap):
|
not fmap):
|
||||||
return ui.utils.showInfo(
|
ui.utils.showInfo(
|
||||||
_("Targets must be unique."), parent=self)
|
_("Targets must be unique."), parent=self)
|
||||||
|
return
|
||||||
if [c for c in cmap.values() if not c]:
|
if [c for c in cmap.values() if not c]:
|
||||||
if not ui.utils.askUser(_("""\
|
if not ui.utils.askUser(_("""\
|
||||||
Any cards with templates mapped to nothing will be deleted.
|
Any cards with templates mapped to nothing will be deleted.
|
||||||
If a fact has no remaining cards, it will be lost.
|
If a fact has no remaining cards, it will be lost.
|
||||||
Are you sure you want to continue?"""), parent=self):
|
Are you sure you want to continue?"""), parent=self):
|
||||||
return
|
return
|
||||||
|
self.modelChooser.deinit()
|
||||||
if self.targetModel == self.oldModel:
|
if self.targetModel == self.oldModel:
|
||||||
self.ret = (self.targetModel, None, cmap)
|
self.ret = (self.targetModel, None, cmap)
|
||||||
return QDialog.accept(self)
|
return QDialog.accept(self)
|
||||||
self.modelChooser.deinit()
|
|
||||||
self.ret = (self.targetModel, fmap, cmap)
|
self.ret = (self.targetModel, fmap, cmap)
|
||||||
return QDialog.accept(self)
|
return QDialog.accept(self)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue