Skip to content
Permalink
Browse files
Merge pull request #784 from ricardogsilva/sextante_issue_8407
Fix for issue #8407 - Allow selecting between file or directory when using a File Parameter in the modeler
  • Loading branch information
volaya committed Aug 3, 2013
2 parents 0367182 + 4cb5d04 commit fe6dcf1432cbcb1945504174ef5944ef3f524856
Showing with 4 additions and 2 deletions.
  1. +4 −2 python/plugins/sextante/modeler/ModelerParameterDefinitionDialog.py
@@ -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)
@@ -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):

0 comments on commit fe6dcf1

Please sign in to comment.