mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
prevent import in cramming, warn when editing in cramming
This commit is contained in:
parent
af2bd52003
commit
1fe922fed4
1 changed files with 11 additions and 2 deletions
|
@ -1374,12 +1374,18 @@ day = :d""", d=yesterday)
|
||||||
|
|
||||||
def onAddCard(self):
|
def onAddCard(self):
|
||||||
if self.isCramming():
|
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
|
return
|
||||||
ui.dialogs.get("AddCards", self)
|
ui.dialogs.get("AddCards", self)
|
||||||
|
|
||||||
def onEditDeck(self):
|
def onEditDeck(self):
|
||||||
ui.dialogs.get("CardList", self)
|
ui.dialogs.get("CardList", self)
|
||||||
|
if self.isCramming():
|
||||||
|
self.showToolTip(_("""\
|
||||||
|
<h1>Cramming</h1>
|
||||||
|
You are currently cramming. Any edits you make to this deck
|
||||||
|
will be lost when you close the deck."""))
|
||||||
|
|
||||||
def onEditCurrent(self):
|
def onEditCurrent(self):
|
||||||
self.moveToState("editCurrentFact")
|
self.moveToState("editCurrentFact")
|
||||||
|
@ -1415,7 +1421,10 @@ day = :d""", d=yesterday)
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
def onImport(self):
|
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:
|
if self.deck is None:
|
||||||
self.onNew()
|
self.onNew()
|
||||||
ui.importing.ImportDialog(self)
|
ui.importing.ImportDialog(self)
|
||||||
|
|
Loading…
Reference in a new issue