From cf1b0e45f0e031801b2f0650bb3be741e8002926 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 26 Jun 2009 07:28:43 +0900 Subject: [PATCH] don't let user remove facts by disabling all card models --- ankiqt/ui/cardlist.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ankiqt/ui/cardlist.py b/ankiqt/ui/cardlist.py index 9f890d36f..c7eabb5ad 100644 --- a/ankiqt/ui/cardlist.py +++ b/ankiqt/ui/cardlist.py @@ -1274,6 +1274,9 @@ class ChangeModelDialog(QDialog): not fmap): return ui.utils.showInfo( _("Targets must be unique."), parent=self) + if not any(cmap.values()): + return ui.utils.showInfo( + _("Must map at least one template."), parent=self) if self.targetModel == self.oldModel: self.ret = (self.targetModel, None, cmap) return QDialog.accept(self)