From 21d60086a81602974ba32a0582a9d37100198911 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 20 Apr 2012 22:37:20 +0900 Subject: [PATCH] don't allow final template to be deleted in empty note type --- aqt/clayout.py | 2 ++ designer/debug.ui | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/aqt/clayout.py b/aqt/clayout.py index 9b8dd75f4..86261c2eb 100644 --- a/aqt/clayout.py +++ b/aqt/clayout.py @@ -106,6 +106,8 @@ class CardLayout(QDialog): self.tabs.addTab(w, t['name']) def onRemoveTab(self, idx): + if len(self.model['tmpls']) < 2: + return showInfo(_("At least one template is required.")) if not askUser(_("Remove all cards of this type?")): return if not self.mm.remTemplate(self.model, self.cards[idx].template()): diff --git a/designer/debug.ui b/designer/debug.ui index 6f49cd645..200d0485a 100644 --- a/designer/debug.ui +++ b/designer/debug.ui @@ -31,7 +31,7 @@ - Qt::NoFocus + Qt::ClickFocus true