From fc271e0f5590001544d3448a16b5b0f769c0dfd0 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 21 May 2012 13:10:17 +0900 Subject: [PATCH] no 'all its cards' if empty --- aqt/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aqt/models.py b/aqt/models.py index 5df3d974f..57c435946 100644 --- a/aqt/models.py +++ b/aqt/models.py @@ -87,9 +87,11 @@ class Models(QDialog): showInfo(_("Please add another note type first."), parent=self) return - if not askUser( - _("Delete this note type and all its cards?"), - parent=self): + if self.mm.useCount(self.model): + msg = _("Delete this note type and all its cards?") + else: + msg = _("Delete this unused note type?") + if not askUser(msg, parent=self): return self.mm.rem(self.model) self.model = None