Skip to content
Permalink
Browse files

Fix #11951 - support for output directory in batch processing

  • Loading branch information
wonder-sk committed Feb 20, 2015
1 parent efcbe2f commit c9682e550b7d34e28c75fa04d843d33902234ad3
Showing with 20 additions and 0 deletions.
  1. +20 −0 python/plugins/processing/gui/BatchOutputSelectionPanel.py
@@ -38,6 +38,7 @@
from processing.core.parameters import ParameterBoolean
from processing.core.parameters import ParameterSelection
from processing.core.parameters import ParameterFixedTable
from processing.core.outputs import OutputDirectory


class BatchOutputSelectionPanel(QWidget):
@@ -65,6 +66,10 @@ def __init__(self, output, alg, row, col, panel):
self.setLayout(self.horizontalLayout)

def showSelectionDialog(self):
if isinstance(self.output, OutputDirectory):
self.selectDirectory()
return

filefilter = self.output.getFileFilter(self.alg)
settings = QSettings()
if settings.contains('/Processing/LastBatchOutputPath'):
@@ -117,6 +122,21 @@ def showSelectionDialog(self):
except:
pass

def selectDirectory(self):

settings = QSettings()
if settings.contains('/Processing/LastBatchOutputPath'):
lastDir = unicode(settings.value('/Processing/LastBatchOutputPath'))
else:
lastDir = ''

dirName = QFileDialog.getExistingDirectory(self,
self.tr('Select directory'), lastDir, QFileDialog.ShowDirsOnly)

if dirName:
self.table.cellWidget(self.row, self.col).setValue(dirName)
settings.setValue('/Processing/LastBatchOutputPath', dirName)

def setValue(self, text):
return self.text.setText(text)

0 comments on commit c9682e5

Please sign in to comment.
You can’t perform that action at this time.