Removed location tool popup from Preferences GUI, as there is yet only NonLonLoc as location routine available. Changed size of GUI. Implemented additional diaolg for picking parameters, yet not finished.

This commit is contained in:
Ludger Küperkoch 2017-04-11 10:55:29 +02:00
parent d370ef67c0
commit 640ed1acda

View File

@ -1221,16 +1221,15 @@ class PropertiesDlg(QDialog):
self.infile = infile self.infile = infile
self.setWindowTitle("PyLoT Properties")
appName = QApplication.applicationName()
self.setWindowTitle("{0} Properties".format(appName))
self.tabWidget = QTabWidget() self.tabWidget = QTabWidget()
self.tabWidget.addTab(InputsTab(self), "Inputs") self.tabWidget.addTab(InputsTab(self), "Inputs")
self.tabWidget.addTab(OutputsTab(self), "Outputs") self.tabWidget.addTab(OutputsTab(self), "Outputs")
self.tabWidget.addTab(PhasesTab(self), "Phases") self.tabWidget.addTab(PhasesTab(self), "Phases")
self.tabWidget.addTab(GraphicsTab(self), "Graphics") self.tabWidget.addTab(GraphicsTab(self), "Graphics")
self.tabWidget.addTab(LocalisationTab(self), "Loc Tools") #self.tabWidget.addTab(LocalisationTab(self), "Loc. Tools")
self.tabWidget.addTab(LocalisationTab(self), "NonLinLoc")
self.tabWidget.addTab(ParametersTab(self), "Picking Parameters")
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok |
QDialogButtonBox.Apply | QDialogButtonBox.Apply |
QDialogButtonBox.Close | QDialogButtonBox.Close |
@ -1240,6 +1239,7 @@ class PropertiesDlg(QDialog):
layout.addWidget(self.tabWidget) layout.addWidget(self.tabWidget)
layout.addWidget(self.buttonBox) layout.addWidget(self.buttonBox)
self.setLayout(layout) self.setLayout(layout)
self.setFixedWidth(700)
self.buttonBox.accepted.connect(self.accept) self.buttonBox.accepted.connect(self.accept)
self.buttonBox.rejected.connect(self.reject) self.buttonBox.rejected.connect(self.reject)
@ -1404,14 +1404,14 @@ class LocalisationTab(PropTab):
settings = QSettings() settings = QSettings()
curtool = settings.value("loc/tool", None) curtool = settings.value("loc/tool", None)
loctoollabel = QLabel("location tool") #loctoollabel = QLabel("location tool")
self.locToolComboBox = QComboBox() self.locToolComboBox = QComboBox()
loctools = LOCTOOLS.keys() #loctools = LOCTOOLS.keys()
self.locToolComboBox.addItems(loctools) #self.locToolComboBox.addItems(loctools)
toolind = findComboBoxIndex(self.locToolComboBox, curtool) #toolind = findComboBoxIndex(self.locToolComboBox, curtool)
self.locToolComboBox.setCurrentIndex(toolind) #self.locToolComboBox.setCurrentIndex(toolind)
curroot = settings.value("{0}/rootPath".format(curtool), None) curroot = settings.value("{0}/rootPath".format(curtool), None)
curbin = settings.value("{0}/binPath".format(curtool), None) curbin = settings.value("{0}/binPath".format(curtool), None)
@ -1433,13 +1433,13 @@ class LocalisationTab(PropTab):
binBrowse = QPushButton('...', self) binBrowse = QPushButton('...', self)
binBrowse.clicked.connect(lambda: self.selectDirectory(self.binedit)) binBrowse.clicked.connect(lambda: self.selectDirectory(self.binedit))
self.locToolComboBox.currentIndexChanged.connect(self.updateUi) #self.locToolComboBox.currentIndexChanged.connect(self.updateUi)
self.updateUi() self.updateUi()
layout = QGridLayout() layout = QGridLayout()
layout.addWidget(loctoollabel, 0, 0) #layout.addWidget(loctoollabel, 0, 0)
layout.addWidget(self.locToolComboBox, 0, 1) #layout.addWidget(self.locToolComboBox, 0, 1)
layout.addWidget(self.rootlabel, 1, 0) layout.addWidget(self.rootlabel, 1, 0)
layout.addWidget(self.rootedit, 1, 1) layout.addWidget(self.rootedit, 1, 1)
layout.addWidget(rootBrowse, 1, 2) layout.addWidget(rootBrowse, 1, 2)
@ -1451,9 +1451,9 @@ class LocalisationTab(PropTab):
def updateUi(self): def updateUi(self):
curtool = self.locToolComboBox.currentText() curtool = self.locToolComboBox.currentText()
if curtool is not None: #if curtool is not None:
self.rootlabel.setText("{0} root directory".format(curtool)) self.rootlabel.setText("{0} root directory".format(curtool))
self.binlabel.setText("{0} bin directory".format(curtool)) self.binlabel.setText("{0} bin directory".format(curtool))
def selectDirectory(self, edit): def selectDirectory(self, edit):
selected_directory = QFileDialog.getExistingDirectory() selected_directory = QFileDialog.getExistingDirectory()
@ -1464,8 +1464,8 @@ class LocalisationTab(PropTab):
def getValues(self): def getValues(self):
loctool = self.locToolComboBox.currentText() loctool = self.locToolComboBox.currentText()
values = {"{0}/rootPath".format(loctool): self.rootedit.text(), values = {"{0}/rootPath".format(loctool): self.rootedit.text(),
"{0}/binPath".format(loctool): self.binedit.text(), "{0}/binPath".format(loctool): self.binedit.text()}
"loc/tool": loctool} #"loc/tool": loctool}
return values return values
def resetValues(self, infile): def resetValues(self, infile):
@ -1476,6 +1476,12 @@ class LocalisationTab(PropTab):
values = {"nll/rootPath": self.rootedit.setText("%s" % nllocroot), values = {"nll/rootPath": self.rootedit.setText("%s" % nllocroot),
"nll/binPath": self.binedit.setText("%s" % nllocbin)} "nll/binPath": self.binedit.setText("%s" % nllocbin)}
class ParametersTab(PropTab):
def __init__(self, parent=None, infile=None):
super(ParametersTab, self).__init__(parent)
settings = QSettings()
class NewEventDlg(QDialog): class NewEventDlg(QDialog):
def __init__(self, parent=None, titleString="Create a new event"): def __init__(self, parent=None, titleString="Create a new event"):
""" """