mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -04:00
disable 'edit current' when no card, don't fail closing editor in empty deck
This commit is contained in:
parent
d913d84572
commit
0717aa1d4f
2 changed files with 4 additions and 0 deletions
|
@ -333,6 +333,8 @@ class FactEditor(object):
|
||||||
|
|
||||||
def saveFieldsNow(self):
|
def saveFieldsNow(self):
|
||||||
"Must call this before adding cards, closing dialog, etc."
|
"Must call this before adding cards, closing dialog, etc."
|
||||||
|
if not self.fact:
|
||||||
|
return
|
||||||
# disable timer
|
# disable timer
|
||||||
if self.changeTimer:
|
if self.changeTimer:
|
||||||
self.changeTimer.stop()
|
self.changeTimer.stop()
|
||||||
|
|
|
@ -1361,6 +1361,7 @@ To upgrade an old deck, download Anki 0.9.8.7."""))
|
||||||
self.mainWin.actionRepeatQuestionAudio.setEnabled(False)
|
self.mainWin.actionRepeatQuestionAudio.setEnabled(False)
|
||||||
self.mainWin.actionRepeatAnswerAudio.setEnabled(False)
|
self.mainWin.actionRepeatAnswerAudio.setEnabled(False)
|
||||||
self.mainWin.actionRepeatAudio.setEnabled(False)
|
self.mainWin.actionRepeatAudio.setEnabled(False)
|
||||||
|
self.mainWin.actionEditCurrent.setEnabled(False)
|
||||||
|
|
||||||
def enableCardMenuItems(self):
|
def enableCardMenuItems(self):
|
||||||
self.mainWin.actionUndoAnswer.setEnabled(not not self.lastCard)
|
self.mainWin.actionUndoAnswer.setEnabled(not not self.lastCard)
|
||||||
|
@ -1373,6 +1374,7 @@ To upgrade an old deck, download Anki 0.9.8.7."""))
|
||||||
self.mainWin.actionRepeatAudio.setEnabled(
|
self.mainWin.actionRepeatAudio.setEnabled(
|
||||||
self.mainWin.actionRepeatQuestionAudio.isEnabled() or
|
self.mainWin.actionRepeatQuestionAudio.isEnabled() or
|
||||||
self.mainWin.actionRepeatAnswerAudio.isEnabled())
|
self.mainWin.actionRepeatAnswerAudio.isEnabled())
|
||||||
|
self.mainWin.actionEditCurrent.setEnabled(True)
|
||||||
|
|
||||||
# Auto update
|
# Auto update
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
Loading…
Reference in a new issue