Commit 1e5c45bf authored by Yan's avatar Yan

Error message now with detailed view

* error message has now "show details.." button for traceback
* reactivity tools legend location can be changed now
parent 18ffc9ed
......@@ -13,7 +13,7 @@ from . import zcetools_help
from . import reactivitytools
__version__ = "0.0.26"
__version__ = "0.0.27"
__all__ = ['config', 'datatools', 'docks', 'drltools', 'drltoos_gui', 'filetools',
......
......@@ -49,11 +49,15 @@ def show_exception_and_exit(exc_type, exc_value, tb):
return
import traceback
traceback.print_exception(exc_type, exc_value, tb)
errmsg = "\n".join(traceback.format_exception(exc_type, exc_value, tb))\
details = "\n".join(traceback.format_exception(exc_type, exc_value, tb))
errmsg = "\n".join(traceback.format_exception_only(exc_type, exc_value))\
+ ("\n The program might misbehave, do you want to continue?")
outmsg = QtWidgets.QMessageBox.critical(None, "Exception!", errmsg,
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
if outmsg != QtWidgets.QMessageBox.Yes:
msgbox = QtWidgets.QMessageBox(
3, "Exception!", errmsg,
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
msgbox.setDetailedText(details)
outvalue = msgbox.exec_()
if outvalue != QtWidgets.QMessageBox.Yes:
sys.exit(-1)
......
......@@ -26,6 +26,7 @@ def settings():
("reactivity/coef2", 0),
("reactivity/transparency", 200),
("reactivity/markersize", 10),
("reactivity/labelloc", 2),
("recents", "")}
[settings.setValue(*i)
for i in defvals if not settings.contains(i[0])]
......
......@@ -57,7 +57,7 @@ def update_parselect(augCanvas, parselect):
def paint_image(augCanvas, drls, grph, labels, parselect):
paintfig = Figure(figsize=(3.5,3), dpi=300, constrained_layout=True)
paintfig = Figure(figsize=(3.5,2), dpi=300, constrained_layout=True)
FigureCanvas(paintfig)
printplot = paintfig.add_subplot(111)
pop_dial(augCanvas, drls, printplot, labels, parselect)
......@@ -130,7 +130,8 @@ def pop_dial(augCanvas, drls, graph, labels, parselect):
label=label, color=(transcolors[
colorargs[i] % len(transcolors)] / 255), marker=".",
markersize=markersize, linestyle="None")
graph.legend(loc=2)
graph.legend(loc=cf.settings().value("reactivity/labelloc", type=float))
graph.autoscale(True)
graph.figure.canvas.draw()
......@@ -188,9 +189,17 @@ def main_window(parent, augCanvas, update_signal, drls):
[translayout.addWidget(i) for i in [translabel, transbox]]
translayout.addStretch()
layouts = []
layouts.append(xannlayout)
layouts.append(translayout)
labelloclayout = QtWidgets.QHBoxLayout()
labelloclabel = QtWidgets.QLabel("Label location (0-10): ")
labellocbox = QtWidgets.QSpinBox(minimum=0, maximum=10)
labellocbox.setValue(cf.settings().value(
"reactivity/labelloc", type=int))
labellocbox.valueChanged.connect(lambda x:
cf.settings().setValue("reactivity/labelloc", x))
[labelloclayout.addWidget(i) for i in [labelloclabel, labellocbox]]
labelloclayout.addStretch()
layouts = [xannlayout, translayout, labelloclayout]
valnames = ["markersize", "coef1", "coef2"]
valtexts = ["dot size: ", "a: ", "b: "]
coefs = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment