mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
Fix #11951 - support for output directory in batch processing
This commit is contained in:
parent
efcbe2f55b
commit
c9682e550b
@ -38,6 +38,7 @@ from processing.core.parameters import ParameterVector
|
|||||||
from processing.core.parameters import ParameterBoolean
|
from processing.core.parameters import ParameterBoolean
|
||||||
from processing.core.parameters import ParameterSelection
|
from processing.core.parameters import ParameterSelection
|
||||||
from processing.core.parameters import ParameterFixedTable
|
from processing.core.parameters import ParameterFixedTable
|
||||||
|
from processing.core.outputs import OutputDirectory
|
||||||
|
|
||||||
|
|
||||||
class BatchOutputSelectionPanel(QWidget):
|
class BatchOutputSelectionPanel(QWidget):
|
||||||
@ -65,6 +66,10 @@ class BatchOutputSelectionPanel(QWidget):
|
|||||||
self.setLayout(self.horizontalLayout)
|
self.setLayout(self.horizontalLayout)
|
||||||
|
|
||||||
def showSelectionDialog(self):
|
def showSelectionDialog(self):
|
||||||
|
if isinstance(self.output, OutputDirectory):
|
||||||
|
self.selectDirectory()
|
||||||
|
return
|
||||||
|
|
||||||
filefilter = self.output.getFileFilter(self.alg)
|
filefilter = self.output.getFileFilter(self.alg)
|
||||||
settings = QSettings()
|
settings = QSettings()
|
||||||
if settings.contains('/Processing/LastBatchOutputPath'):
|
if settings.contains('/Processing/LastBatchOutputPath'):
|
||||||
@ -117,6 +122,21 @@ class BatchOutputSelectionPanel(QWidget):
|
|||||||
except:
|
except:
|
||||||
pass
|
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):
|
def setValue(self, text):
|
||||||
return self.text.setText(text)
|
return self.text.setText(text)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user