mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
hide notice immediately on next card answer
This commit is contained in:
parent
9ae9c2e85e
commit
eda8c2011a
1 changed files with 7 additions and 9 deletions
|
@ -119,7 +119,6 @@ class AnkiQt(QMainWindow):
|
||||||
SIGNAL("clicked()"),
|
SIGNAL("clicked()"),
|
||||||
self.onClose)
|
self.onClose)
|
||||||
# notices
|
# notices
|
||||||
self.noticeShown = 0
|
|
||||||
self.mainWin.noticeFrame.setShown(False)
|
self.mainWin.noticeFrame.setShown(False)
|
||||||
self.connect(self.mainWin.noticeButton, SIGNAL("clicked()"),
|
self.connect(self.mainWin.noticeButton, SIGNAL("clicked()"),
|
||||||
lambda: self.mainWin.noticeFrame.setShown(False))
|
lambda: self.mainWin.noticeFrame.setShown(False))
|
||||||
|
@ -129,13 +128,11 @@ class AnkiQt(QMainWindow):
|
||||||
self.mainWin.noticeButton.setFixedWidth(20)
|
self.mainWin.noticeButton.setFixedWidth(20)
|
||||||
self.mainWin.noticeButton.setFixedHeight(20)
|
self.mainWin.noticeButton.setFixedHeight(20)
|
||||||
|
|
||||||
def setNotice(self, str):
|
def setNotice(self, str=""):
|
||||||
self.noticeShown = time.time()
|
if str:
|
||||||
self.mainWin.noticeLabel.setText(str)
|
self.mainWin.noticeLabel.setText(str)
|
||||||
self.mainWin.noticeFrame.setShown(True)
|
self.mainWin.noticeFrame.setShown(True)
|
||||||
|
else:
|
||||||
def maybeClearNotice(self):
|
|
||||||
if time.time() - self.noticeShown > 5:
|
|
||||||
self.mainWin.noticeFrame.setShown(False)
|
self.mainWin.noticeFrame.setShown(False)
|
||||||
|
|
||||||
def setupViews(self):
|
def setupViews(self):
|
||||||
|
@ -305,7 +302,6 @@ Please do not file a bug report with Anki.<br>""")
|
||||||
elif state == "getQuestion":
|
elif state == "getQuestion":
|
||||||
# stop anything playing
|
# stop anything playing
|
||||||
clearAudioQueue()
|
clearAudioQueue()
|
||||||
self.maybeClearNotice()
|
|
||||||
if self.deck.isEmpty():
|
if self.deck.isEmpty():
|
||||||
return self.moveToState("deckEmpty")
|
return self.moveToState("deckEmpty")
|
||||||
else:
|
else:
|
||||||
|
@ -440,6 +436,8 @@ Please do not file a bug report with Anki.<br>""")
|
||||||
self.deck.answerCard(self.currentCard, quality)
|
self.deck.answerCard(self.currentCard, quality)
|
||||||
if self.isLeech():
|
if self.isLeech():
|
||||||
self.handleLeech()
|
self.handleLeech()
|
||||||
|
else:
|
||||||
|
self.setNotice()
|
||||||
self.lastScheduledTime = anki.utils.fmtTimeSpan(
|
self.lastScheduledTime = anki.utils.fmtTimeSpan(
|
||||||
self.currentCard.due - time.time())
|
self.currentCard.due - time.time())
|
||||||
self.lastQuality = quality
|
self.lastQuality = quality
|
||||||
|
|
Loading…
Reference in a new issue