mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
display the full error in a textarea
This commit is contained in:
parent
fded7a85da
commit
5cd30656b4
1 changed files with 17 additions and 4 deletions
|
@ -169,18 +169,31 @@ An error occurred. Please:<p>
|
||||||
<li><b>Tools > Advanced > Check DB</b>.
|
<li><b>Tools > Advanced > Check DB</b>.
|
||||||
</ol>
|
</ol>
|
||||||
If it does not fix the problem, please copy the following<br>
|
If it does not fix the problem, please copy the following<br>
|
||||||
into a bug report:<br><br>
|
into a bug report:<br>
|
||||||
""")
|
""")
|
||||||
pluginText = _("""\
|
pluginText = _("""\
|
||||||
An error occurred in a plugin. Please contact the plugin author.<br>
|
An error occurred in a plugin. Please contact the plugin author.<br>
|
||||||
Please do not file a bug report with Anki.<br><br>""")
|
Please do not file a bug report with Anki.<br>""")
|
||||||
if "plugin" in error:
|
if "plugin" in error:
|
||||||
txt = pluginText
|
txt = pluginText
|
||||||
else:
|
else:
|
||||||
txt = stdText
|
txt = stdText
|
||||||
self.errorOccurred = True
|
self.errorOccurred = True
|
||||||
ui.utils.showText(txt + error[0:10000].replace(
|
# show dialog
|
||||||
"\n", "<br>"))
|
diag = QDialog(self.app.activeWindow())
|
||||||
|
diag.setWindowTitle("Anki")
|
||||||
|
layout = QVBoxLayout(diag)
|
||||||
|
diag.setLayout(layout)
|
||||||
|
text = QTextEdit()
|
||||||
|
text.setReadOnly(True)
|
||||||
|
text.setHtml(txt + "<div style='white-space: pre-wrap'>" + error + "</div>")
|
||||||
|
layout.addWidget(text)
|
||||||
|
box = QDialogButtonBox(QDialogButtonBox.Close)
|
||||||
|
layout.addWidget(box)
|
||||||
|
self.connect(box, SIGNAL("rejected()"), diag, SLOT("reject()"))
|
||||||
|
diag.setMinimumHeight(400)
|
||||||
|
diag.setMinimumWidth(500)
|
||||||
|
diag.exec_()
|
||||||
|
|
||||||
def closeAllDeckWindows(self):
|
def closeAllDeckWindows(self):
|
||||||
ui.dialogs.closeAll()
|
ui.dialogs.closeAll()
|
||||||
|
|
Loading…
Reference in a new issue