From 2dda4d8e040841c6cac8ad9b59e9436ef91fbcc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Mon, 10 Apr 2017 14:54:47 +0200 Subject: [PATCH] First action is to ask for PyLoT.in file. --- QtPyLoT.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/QtPyLoT.py b/QtPyLoT.py index 79dc0aad..73287430 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -73,6 +73,18 @@ class MainWindow(QMainWindow): def __init__(self, parent=None): super(MainWindow, self).__init__(parent) + # check for default pylot.in-file + infile = os.path.join(os.path.expanduser('~'), '.pylot', 'pylot.in') + if os.path.isfile(infile)== False: + infile = QFileDialog().getOpenFileName(caption='Choose PyLoT-input file') + if not os.path.exists(infile[0]): + QMessageBox.warning(self, "PyLoT Warning", + "No PyLoT-input file declared!") + sys.exit(0) + self.infile = infile[0] + else: + self.infile = infile + # UI has to be set up before(!) children widgets are about to show up self.createAction = createAction # read settings