From 1c610d22f0c76a2f7cc4eef9608720fd30ad73bc Mon Sep 17 00:00:00 2001 From: Marcel Paffrath Date: Fri, 30 Jun 2017 14:29:37 +0200 Subject: [PATCH] [add] restore default options for some tabs --- pylot/core/util/widgets.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 0a398703..8a827335 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -2672,12 +2672,16 @@ class PhasesTab(PropTab): def __init__(self, parent=None): super(PhasesTab, self).__init__(parent) - PphasesLabel = QLabel("P Phases to pick") - SphasesLabel = QLabel("S Phases to pick") self.PphasesEdit = QLineEdit() self.SphasesEdit = QLineEdit() - Pphases = 'P, Pg, Pn, PmP, P1, P2, P3' - Sphases = 'S, Sg, Sn, SmS, S1, S2, S3' + + PphasesLabel = QLabel("P Phases to pick") + SphasesLabel = QLabel("S Phases to pick") + + settings = QSettings() + Pphases = settings.value('p_phases') + Sphases = settings.value('s_phases') + self.PphasesEdit.setText("%s" % Pphases) self.SphasesEdit.setText("%s" % Sphases) @@ -2693,6 +2697,13 @@ class PhasesTab(PropTab): values = {'p_phases': self.PphasesEdit.text(), 's_phases': self.SphasesEdit.text()} return values + + def resetValues(self, infile=None): + Pphases = 'P, Pg, Pn, PmP, P1, P2, P3' + Sphases = 'S, Sg, Sn, SmS, S1, S2, S3' + values = {'p_phases': self.PphasesEdit.setText(Pphases), + 's_phases': self.SphasesEdit.setText(Sphases)} + return values class GraphicsTab(PropTab): @@ -2738,7 +2749,12 @@ class GraphicsTab(PropTab): 'pyqtgraphic': self.checkbox_pg.isChecked()} return values + def resetValues(self, infile=None): + values = {'nth_sample': self.spinbox_nth_sample.setValue(1), + 'pyqtgraphic': self.checkbox_pg.setChecked(True)} + return values + class ChannelOrderTab(PropTab): def __init__(self, parent=None, infile=None): super(ChannelOrderTab, self).__init__(parent)