Skip to content
Permalink
Browse files

[processing] save geometry for the algorithm dialog

  • Loading branch information
slarosa committed Sep 11, 2015
1 parent 390ea4e commit 05487935ef50abbf8c593b7cb5ce7dee65ff3309
@@ -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:
@@ -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()
@@ -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
@@ -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
@@ -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)

0 comments on commit 0548793

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