From 1fe922fed4a32c658db74878a1043bafe7aee65a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 23 Apr 2009 03:54:28 +0900 Subject: [PATCH] prevent import in cramming, warn when editing in cramming --- ankiqt/ui/main.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index d85b678e6..9296c1552 100644 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -1374,12 +1374,18 @@ day = :d""", d=yesterday) def onAddCard(self): if self.isCramming(): - ui.utils.showInfo(_("Can't add cards while cramming.")) + ui.utils.showInfo(_("""\ +You are currently cramming. Please close this deck first.""")) return ui.dialogs.get("AddCards", self) def onEditDeck(self): ui.dialogs.get("CardList", self) + if self.isCramming(): + self.showToolTip(_("""\ +

Cramming

+You are currently cramming. Any edits you make to this deck +will be lost when you close the deck.""")) def onEditCurrent(self): self.moveToState("editCurrentFact") @@ -1415,7 +1421,10 @@ day = :d""", d=yesterday) ########################################################################## def onImport(self): - import ui.importing + if self.isCramming(): + ui.utils.showInfo(_("""\ +You are currently cramming. Please close this deck first.""")) + return if self.deck is None: self.onNew() ui.importing.ImportDialog(self)