From 060bc1d0c8636fe303fbb68d39c6fa07f8e0b8c5 Mon Sep 17 00:00:00 2001 From: Sebastianw Wehling-Benatelli Date: Fri, 26 Aug 2016 14:36:33 +0200 Subject: [PATCH] [refs #137] bugfix value now is specified by user on demand --- QtPyLoT.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/QtPyLoT.py b/QtPyLoT.py index 9e04d8e4..41fdf523 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -907,10 +907,21 @@ class MainWindow(QMainWindow): if locroot is None: self.PyLoTprefs() self.locateEvent() + infile = settings.value("{0}/inputFile".format(loctool), None) + + if not infile: + caption = 'Select {0} input file'.format(loctool) + filt = "Supported file formats" \ + " (*.in *.ini *.conf *.cfg)" + ans = QFileDialog().getOpenFileName(self, caption=caption, + filter=filt, dir=locroot) + infile = ans[0] + settings.setValue("{0}/inputFile".format(loctool), infile) + settings.sync() outfile = settings.value("{0}/outputFile".format(loctool), None) - phasepath = os.tempnam(os.path.join(locroot, 'obs'), loctool) - phasefile = os.path.split(phasepath)[-1] + phasefile = os.path.split(os.tempnam())[-1] + phasepath = os.path.join(locroot, 'obs', phasefile) locpath = os.path.join(locroot, 'loc', outfile) lt.export(self.getPicks(), phasepath) lt.modify_inputs(infile, locroot, outfile, phasefile, )