Bugfix open settings

This commit is contained in:
Emanuele 2021-01-05 00:12:27 +01:00
parent 7593b7d9ad
commit 9108221e91

View file

@ -338,6 +338,7 @@ class rMViewApp(QApplication):
confpath = os.path.abspath(self.config_file or self.DEFAULT_CONFIG) confpath = os.path.abspath(self.config_file or self.DEFAULT_CONFIG)
if not os.path.isfile(confpath): if not os.path.isfile(confpath):
os.makedirs(os.path.dirname(confpath))
with open(confpath, "w") as f: with open(confpath, "w") as f:
json.dump({ json.dump({
"ssh": {"address": [self.config['ssh'].get('address', "10.11.99.1")]}, "ssh": {"address": [self.config['ssh'].get('address', "10.11.99.1")]},
@ -346,7 +347,7 @@ class rMViewApp(QApplication):
"pen_color": "red", "pen_color": "red",
"pen_trail": 200 "pen_trail": 200
}, f, indent=4) }, f, indent=4)
QDesktopServices.openUrl(QUrl("file://" + confpath)) QDesktopServices.openUrl(QUrl("file:///" + confpath))
self.quit() self.quit()
@pyqtSlot(Exception) @pyqtSlot(Exception)