Skip to content

Commit

Permalink
Agregado la posibilidad de seleccionar directorios con <$ ...>
Browse files Browse the repository at this point in the history
  • Loading branch information
manublesa committed Apr 8, 2019
1 parent 50e333e commit 42c0260
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/gui/paramForm.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@ def __init__(self, param_list):
if parametro[:1] == "#":
self.labels[counter] = QtGui.QLabel(parametro[1:], self)
self.texts[counter] = QtGui.QLineEdit(self)
self.buttons[counter] = QtGui.QPushButton("file")
self.buttons[counter] = QtGui.QPushButton("File...")
self.buttons[counter].clicked.connect(
lambda ignore, co=counter: self.getFileName(co))
fileMod = 1

elif parametro[:1] == "$":
self.labels[counter] = QtGui.QLabel(parametro[1:], self)
self.texts[counter] = QtGui.QLineEdit(self)
self.buttons[counter] = QtGui.QPushButton("Dir...")
self.buttons[counter].clicked.connect(
lambda ignore, co=counter: self.getDirName(co))
fileMod = 1
else:
self.labels[counter] = QtGui.QLabel(parametro, self)
self.texts[counter] = QtGui.QLineEdit(self)
Expand Down Expand Up @@ -79,6 +87,10 @@ def getFileName(self, counter):
directory=src.logic.helper.getTreeViewInitialPath())
self.texts[counter].setText(filename)

def getDirName(self, counter):
filename = QtGui.QFileDialog.getExistingDirectory(
directory=src.logic.helper.getTreeViewInitialPath())
self.texts[counter].setText(filename)

if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
Expand Down

0 comments on commit 42c0260

Please sign in to comment.