Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] fixed adding extension to output filenames in batch inte…
…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
Expand Up @@ -16,6 +16,7 @@
* *
***************************************************************************
"""
import re

__author__ = 'Victor Olaya'
__date__ = 'August 2012'
Expand Down Expand Up @@ -77,10 +78,15 @@ def showSelectionDialog(self):
path = unicode(settings.value('/Processing/LastBatchOutputPath'))
else:
path = ''
filename = QFileDialog.getSaveFileName(self, self.tr('Save file'), path,
filefilter)
filename, selectedFileFilter = QFileDialog.getSaveFileNameAndFilter(self,
self.tr('Save file'), path, filefilter)
print filename, selectedFileFilter
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))
dlg = AutofillDialog(self.alg)
dlg.exec_()
Expand Down

0 comments on commit 7f061d2

Please sign in to comment.