Commit 9720776c authored by Yan's avatar Yan
Browse files

Fixed autozoomy button, fixed config

* config is not rewroting False variables to True anymore
* autozoomy is called with valid argument from __main__
* minor formatting
parent f10cd910
...@@ -325,18 +325,18 @@ def main(): ...@@ -325,18 +325,18 @@ def main():
checked=config.value("view/autozoomy", type=bool)) checked=config.value("view/autozoomy", type=bool))
autozoomy.triggered.connect(lambda: config.setValue( autozoomy.triggered.connect(lambda: config.setValue(
"view/autozoomy", autozoomy.isChecked())) "view/autozoomy", autozoomy.isChecked()))
autozoomy.triggered.connect(lambda: gt.autozoomy(augCanvas.spectrum)) autozoomy.triggered.connect(lambda: gt.autozoomy(augCanvas.spectplot))
intensitiesact = QtWidgets.QAction( intensitiesact = QtWidgets.QAction(
"&Show intensities", None, checkable=True, checked=config.value( "&Show intensities", None, checkable=True,
"view/intensities", type=bool)) checked=config.value("view/intensities", type=bool))
intensitiesact.triggered.connect(lambda: config.setValue( intensitiesact.triggered.connect(lambda: config.setValue(
"view/intensities", intensitiesact.isChecked())) "view/intensities", intensitiesact.isChecked()))
intensitiesact.triggered.connect(lambda: gt.ann_spec( intensitiesact.triggered.connect(lambda: gt.ann_spec(
augCanvas.spectplot, augCanvas.ms)) augCanvas.spectplot, augCanvas.ms))
intensitiesact.triggered.connect(lambda: augCanvas.draw()) intensitiesact.triggered.connect(lambda: augCanvas.draw())
oddevenact = QtWidgets.QAction( oddevenact = QtWidgets.QAction(
"&Odd / even", None, checkable=True, checked=config.value( "&Odd / even", None, checkable=True,
"view/oddeven", type=bool)) checked=config.value("view/oddeven", type=bool))
oddevenact.triggered.connect( oddevenact.triggered.connect(
lambda: oddeven_changed(augCanvas, config, oddevenact)) lambda: oddeven_changed(augCanvas, config, oddevenact))
......
...@@ -20,8 +20,8 @@ def settings(): ...@@ -20,8 +20,8 @@ def settings():
("imggen/yinch", 4), ("imggen/yinch", 4),
("imggen/dpi", 300), ("imggen/dpi", 300),
("imggen/xtics", 5)} ("imggen/xtics", 5)}
[settings.setValue(i[0], i[1]) [print("will set value", i[0])
for i in defvals if not settings.value(i[0])] for i in defvals if not settings.contains(i[0])]
return settings return settings
......
Supports Markdown
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