Skip to content

Commit

Permalink
[processing] save geometry for the algorithm dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa committed Sep 11, 2015
1 parent 390ea4e commit 0548793
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion python/plugins/processing/gui/AlgorithmDialog.py
Expand Up @@ -131,7 +131,7 @@ def setParamValue(self, param, widget, alg=None):
options = dataobjects.getVectorLayers([param.datatype], sorting=False)
return param.setValue([options[i] for i in widget.selectedoptions])
elif isinstance(param, (ParameterNumber, ParameterFile, ParameterCrs,
ParameterExtent)):
ParameterExtent)):
return param.setValue(widget.getValue())
elif isinstance(param, ParameterString):
if param.multiline:
Expand All @@ -144,6 +144,8 @@ def setParamValue(self, param, widget, alg=None):
return param.setValue(unicode(widget.text()))

def accept(self):
self.settings.setValue("/Processing/dialogBase", self.saveGeometry())

checkCRS = ProcessingConfig.getSetting(ProcessingConfig.WARN_UNMATCHING_CRS)
try:
self.setParamValues()
Expand Down
8 changes: 7 additions & 1 deletion python/plugins/processing/gui/AlgorithmDialogBase.py
Expand Up @@ -28,7 +28,7 @@
import os

from PyQt4 import uic
from PyQt4.QtCore import QCoreApplication, QUrl
from PyQt4.QtCore import Qt, QCoreApplication, QUrl, QSettings, QByteArray
from PyQt4.QtGui import QApplication, QDialogButtonBox

from qgis.utils import iface
Expand All @@ -51,6 +51,9 @@ def __init__(self, alg):
super(AlgorithmDialogBase, self).__init__(iface.mainWindow())
self.setupUi(self)

self.settings = QSettings()
self.restoreGeometry(self.settings.value("/Processing/dialogBase", QByteArray()))

self.executed = False
self.mainWidget = None
self.alg = alg
Expand Down Expand Up @@ -82,6 +85,9 @@ def __init__(self, alg):
self.showDebug = ProcessingConfig.getSetting(
ProcessingConfig.SHOW_DEBUG_IN_DIALOG)

def closeEvent(self, evt):
self.settings.setValue("/Processing/dialogBase", self.saveGeometry())

def setMainWidget(self):
self.tabWidget.widget(0).layout().addWidget(self.mainWidget)

Expand Down

0 comments on commit 0548793

Please sign in to comment.