From a745381e8ed9c0fe70bc83769b3c4a717037fcc4 Mon Sep 17 00:00:00 2001 From: Marcel Paffrath Date: Tue, 30 May 2017 10:17:07 +0200 Subject: [PATCH] some changes in propertiesDlg --- QtPyLoT.py | 10 +++++++++- pylot/RELEASE-VERSION | 2 +- pylot/core/util/widgets.py | 17 +++++++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/QtPyLoT.py b/QtPyLoT.py index 4b4edbac..b7103da8 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -96,7 +96,7 @@ class MainWindow(QMainWindow): else: self.infile = infile self._inputs = AutoPickParameter(infile) - self._props = PropertiesDlg(self, infile=infile) + self._props = None self.project = Project() self.tap = None @@ -158,6 +158,8 @@ class MainWindow(QMainWindow): settings.setValue("data/dataRoot", dirname) settings.sync() + print('ns:', settings.value('nth_sample')) + self.filteroptions = {} self.pickDlgs = {} self.picks = {} @@ -651,6 +653,9 @@ class MainWindow(QMainWindow): return self.fnames except DatastructureError as e: print(e) + if not self._props: + self._props = PropertiesDlg(self, infile=self.infile) + if self._props.exec_() == QDialog.Accepted: return self.getWFFnames() else: @@ -2041,6 +2046,9 @@ class MainWindow(QMainWindow): QMainWindow.closeEvent(self, event) def PyLoTprefs(self): + if not self._props: + self._props = PropertiesDlg(self, infile=self.infile) + if self._props.exec_(): return diff --git a/pylot/RELEASE-VERSION b/pylot/RELEASE-VERSION index 470adf70..358ee3d8 100644 --- a/pylot/RELEASE-VERSION +++ b/pylot/RELEASE-VERSION @@ -1 +1 @@ -0f12-dirty +3952-dirty diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 3457c9bb..3f4f6839 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -2157,17 +2157,22 @@ class GraphicsTab(PropTab): self.main_layout = QGridLayout() def add_nth_sample(self): - self.nth_sample = QtGui.QSpinBox() + settings = QSettings() + nth_sample = settings.value("nth_sample") + if not nth_sample: + nth_sample = 1 + + self.spinbox_nth_sample = QtGui.QSpinBox() label = QLabel('nth sample') - self.nth_sample.setMinimum(1) - self.nth_sample.setMaximum(100) - self.nth_sample.setValue(1) + self.spinbox_nth_sample.setMinimum(1) + self.spinbox_nth_sample.setMaximum(100) + self.spinbox_nth_sample.setValue(int(nth_sample)) label.setToolTip('Plot every nth sample (to speed up plotting)') self.main_layout.addWidget(label, 0, 0) - self.main_layout.addWidget(self.nth_sample, 0, 1) + self.main_layout.addWidget(self.spinbox_nth_sample, 0, 1) def getValues(self): - values = {'nth_sample': self.nth_sample.value()} + values = {'nth_sample': self.spinbox_nth_sample.value()} return values