mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
wrap errors, improve earliest card message
This commit is contained in:
parent
7391cef4f2
commit
a9857a5e4f
2 changed files with 23 additions and 1 deletions
|
@ -115,6 +115,7 @@ class AnkiQt(QMainWindow):
|
||||||
self.timer.setInterval(interval)
|
self.timer.setInterval(interval)
|
||||||
|
|
||||||
def onTimeout(self):
|
def onTimeout(self):
|
||||||
|
print self.pool
|
||||||
ui.utils.showText(_("""\
|
ui.utils.showText(_("""\
|
||||||
An error occurred. Please copy the following message into a bug report.\n\n""" + self.pool))
|
An error occurred. Please copy the following message into a bug report.\n\n""" + self.pool))
|
||||||
self.pool = ""
|
self.pool = ""
|
||||||
|
@ -286,7 +287,27 @@ An error occurred. Please copy the following message into a bug report.\n\n""" +
|
||||||
if delay > 86400:
|
if delay > 86400:
|
||||||
return
|
return
|
||||||
if delay < 0:
|
if delay < 0:
|
||||||
sys.stderr.write("earliest time returned negative value\n")
|
c = self.deck.getCard()
|
||||||
|
if c:
|
||||||
|
c = (c.id, c.question, c.due, c.combinedDue, c.isDue, c.type)
|
||||||
|
sys.stderr.write("""
|
||||||
|
earliest time returned %f
|
||||||
|
|
||||||
|
failed is:
|
||||||
|
%s
|
||||||
|
|
||||||
|
rev:
|
||||||
|
%s
|
||||||
|
|
||||||
|
new:
|
||||||
|
%s
|
||||||
|
|
||||||
|
getCard() returns:
|
||||||
|
%s""" % (delay,
|
||||||
|
self.deck.s.all("select * from failedCards"),
|
||||||
|
self.deck.s.all("select * from revCardsOld"),
|
||||||
|
self.deck.s.all("select * from acqCardsOrdered"),
|
||||||
|
c))
|
||||||
return
|
return
|
||||||
t = QTimer(self)
|
t = QTimer(self)
|
||||||
t.setSingleShot(True)
|
t.setSingleShot(True)
|
||||||
|
|
|
@ -44,6 +44,7 @@ def showText(text, parent=None):
|
||||||
d.setWindowTitle("Anki")
|
d.setWindowTitle("Anki")
|
||||||
v = QVBoxLayout()
|
v = QVBoxLayout()
|
||||||
l = QLabel(text)
|
l = QLabel(text)
|
||||||
|
l.setWordWrap(True)
|
||||||
l.setTextInteractionFlags(Qt.TextSelectableByMouse)
|
l.setTextInteractionFlags(Qt.TextSelectableByMouse)
|
||||||
v.addWidget(l)
|
v.addWidget(l)
|
||||||
buts = QDialogButtonBox.Ok
|
buts = QDialogButtonBox.Ok
|
||||||
|
|
Loading…
Reference in a new issue