Skip to content

Commit

Permalink
[processing] fixed adding extension to output filenames in batch inte…
Browse files Browse the repository at this point in the history
…rface

fixes #10444
  • Loading branch information
volaya committed Oct 1, 2015
1 parent a9dab06 commit 7f061d2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions python/plugins/processing/gui/BatchOutputSelectionPanel.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* * * *
*************************************************************************** ***************************************************************************
""" """
import re


__author__ = 'Victor Olaya' __author__ = 'Victor Olaya'
__date__ = 'August 2012' __date__ = 'August 2012'
Expand Down Expand Up @@ -77,10 +78,15 @@ def showSelectionDialog(self):
path = unicode(settings.value('/Processing/LastBatchOutputPath')) path = unicode(settings.value('/Processing/LastBatchOutputPath'))
else: else:
path = '' path = ''
filename = QFileDialog.getSaveFileName(self, self.tr('Save file'), path, filename, selectedFileFilter = QFileDialog.getSaveFileNameAndFilter(self,
filefilter) self.tr('Save file'), path, filefilter)
print filename, selectedFileFilter
if filename: if filename:
filename = unicode(filename) if not filename.lower().endswith(
tuple(re.findall("\*(\.[a-z]{1,10})", filefilter))):
ext = re.search("\*(\.[a-z]{1,10})", selectedFileFilter)
if ext:
filename += ext.group(1)
settings.setValue('/Processing/LastBatchOutputPath', os.path.dirname(filename)) settings.setValue('/Processing/LastBatchOutputPath', os.path.dirname(filename))
dlg = AutofillDialog(self.alg) dlg = AutofillDialog(self.alg)
dlg.exec_() dlg.exec_()
Expand Down

0 comments on commit 7f061d2

Please sign in to comment.