make sure to always deinit modelChooser

This commit is contained in:
Damien Elmes 2010-02-07 01:07:23 +09:00
parent 7d74be890b
commit c5b02a5835

View file

@ -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)