Skip to content

Commit

Permalink
added the possibility to choose between file or folder for File Param…
Browse files Browse the repository at this point in the history
…eters in the modeller
  • Loading branch information
ricardogsilva committed Aug 3, 2013
1 parent 8de00c1 commit 4cb5d04
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,10 @@ def setupUi(self):
self.fileFolderCombo = QtGui.QComboBox()
self.fileFolderCombo.addItem("File")
self.fileFolderCombo.addItem("Folder")
self.horizontalLayout2.addWidget(self.fileFolderCombo)
if self.param is not None:
self.fileFolderCombo.setCurrentIndex(1 if self.param.isFolder else 0)
self.horizontalLayout2.addWidget(self.fileFolderCombo)
self.verticalLayout.addLayout(self.horizontalLayout2)

self.buttonBox = QtGui.QDialogButtonBox(self)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
Expand Down Expand Up @@ -268,7 +269,8 @@ def okPressed(self):
elif self.paramType == ModelerParameterDefinitionDialog.PARAMETER_EXTENT or isinstance(self.param, ParameterExtent):
self.param = ParameterExtent(name, description)
elif self.paramType == ModelerParameterDefinitionDialog.PARAMETER_FILE or isinstance(self.param, ParameterFile):
self.param = ParameterFile(name, description)
isFolder = self.fileFolderCombo.currentIndex() == 1
self.param = ParameterFile(name, description, isFolder=isFolder)
self.close()

def cancelPressed(self):
Expand Down

0 comments on commit 4cb5d04

Please sign in to comment.