finished implementation of location tool tab in properties window (used to modify settings from the GUI)
This commit is contained in:
parent
0a1d177d60
commit
69efd4d411
@ -789,7 +789,7 @@ class PropertiesDlg(QDialog):
|
||||
self.tabWidget.addTab(OutputsTab(self), "Outputs")
|
||||
self.tabWidget.addTab(PhasesTab(self), "Phases")
|
||||
self.tabWidget.addTab(GraphicsTab(self), "Graphics")
|
||||
self.tabWidget.addTab(LocalisationTab(self), "Tools")
|
||||
self.tabWidget.addTab(LocalisationTab(self), "Loc Tools")
|
||||
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok |
|
||||
QDialogButtonBox.Apply |
|
||||
QDialogButtonBox.Close)
|
||||
@ -934,42 +934,56 @@ class LocalisationTab(PropTab):
|
||||
curroot = settings.value("%s/rootPath".format(curtool), None)
|
||||
curbin = settings.value("%s/binPath".format(curtool), None)
|
||||
|
||||
rootlabel = QLabel("root directory")
|
||||
binlabel = QLabel("bin directory")
|
||||
self.rootlabel = QLabel("root directory")
|
||||
self.binlabel = QLabel("bin directory")
|
||||
|
||||
rootedit = QLineEdit('')
|
||||
binedit = QLineEdit('')
|
||||
self.rootedit = QLineEdit('')
|
||||
self.binedit = QLineEdit('')
|
||||
|
||||
if curroot is not None:
|
||||
self.rootedit.setText(curroot)
|
||||
if curbin is not None:
|
||||
self.binedit.setText(curbin)
|
||||
|
||||
rootBrowse = QPushButton('...', self)
|
||||
rootBrowse.clicked.connect(lambda: self.selectDirectory(rootedit))
|
||||
rootBrowse.clicked.connect(lambda: self.selectDirectory(self.rootedit))
|
||||
|
||||
binBrowse = QPushButton('...', self)
|
||||
binBrowse.clicked.connect(lambda: self.selectDirectory(binedit))
|
||||
binBrowse.clicked.connect(lambda: self.selectDirectory(self.binedit))
|
||||
|
||||
if curtool is not None:
|
||||
rootlabel.setText("{0} root directory".format(curtool))
|
||||
binlabel.setText("{0} bin directory".format(curtool))
|
||||
if curroot is not None:
|
||||
rootedit.setText(curroot)
|
||||
if curbin is not None:
|
||||
binedit.setText(curbin)
|
||||
self.locToolComboBox.currentIndexChanged.connect(self.updateUi)
|
||||
|
||||
self.updateUi()
|
||||
|
||||
layout = QGridLayout()
|
||||
layout.addWidget(loctoollabel, 0, 0)
|
||||
layout.addWidget(self.locToolComboBox, 0, 1)
|
||||
layout.addWidget(rootlabel, 1, 0)
|
||||
layout.addWidget(rootedit, 1, 1)
|
||||
layout.addWidget(self.rootlabel, 1, 0)
|
||||
layout.addWidget(self.rootedit, 1, 1)
|
||||
layout.addWidget(rootBrowse, 1, 2)
|
||||
layout.addWidget(binlabel, 2, 0)
|
||||
layout.addWidget(binedit, 2, 1)
|
||||
layout.addWidget(self.binlabel, 2, 0)
|
||||
layout.addWidget(self.binedit, 2, 1)
|
||||
layout.addWidget(binBrowse, 2, 2)
|
||||
|
||||
self.setLayout(layout)
|
||||
|
||||
def updateUi(self):
|
||||
curtool = self.locToolComboBox.currentText()
|
||||
if curtool is not None:
|
||||
self.rootlabel.setText("{0} root directory".format(curtool))
|
||||
self.binlabel.setText("{0} bin directory".format(curtool))
|
||||
|
||||
def selectDirectory(self, edit):
|
||||
selected_directory = QFileDialog.getExistingDirectory()
|
||||
edit.setText(selected_directory)
|
||||
|
||||
def getValues(self):
|
||||
loctool = self.locToolComboBox.currentText()
|
||||
values = {"%s/rootPath".format(loctool): self.rootedit.text(),
|
||||
"%s/binPath".format(loctool): self.binedit.text(),
|
||||
"loc/tool": loctool}
|
||||
return values
|
||||
|
||||
|
||||
|
||||
class NewEventDlg(QDialog):
|
||||
|
Loading…
Reference in New Issue
Block a user