Skip to content
Permalink
Browse files

[processing] remember last path for batch processes

Fixes #16310
  • Loading branch information
volaya committed Aug 23, 2017
1 parent 3ef008c commit 64f3e675969634a5f8729f50865b81dc61312258
Showing with 9 additions and 2 deletions.
  1. +9 −2 python/plugins/processing/gui/BatchPanel.py
@@ -31,6 +31,7 @@
from qgis.PyQt import uic
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QTableWidgetItem, QComboBox, QLineEdit, QHeaderView, QFileDialog, QMessageBox
from qgis.PyQt.QtCore import QSettings

from qgis.core import QgsApplication

@@ -178,9 +179,15 @@ def getWidgetFromParameter(self, param, row, col):

return item

def getLastFolder():
settings = QSettings()
if settings.contains('/Processing/LastBatchInputPath'):
return settings.value('/Processing/LastBatchInputPath')

def load(self):
filename = unicode(QFileDialog.getOpenFileName(self,
self.tr('Open batch'), None,
self.tr('Open batch'),
self.getLastFolder(),
self.tr('JSON files (*.json)')))
if filename:
with open(filename) as f:
@@ -287,7 +294,7 @@ def save(self):

filename = unicode(QFileDialog.getSaveFileName(self,
self.tr('Save batch'),
None,
self.getLastFolder(),
self.tr('JSON files (*.json)')))
if filename:
if not filename.endswith('.json'):

0 comments on commit 64f3e67

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