Skip to content
Permalink
Browse files

Save and restore window geometry for modeler dialogs

  • Loading branch information
nyalldawson committed Jul 8, 2017
1 parent 3665e46 commit 7db1a9dfd3492bcda18f23bea12144c3dbde5d26
@@ -29,7 +29,8 @@
import math

from qgis.gui import QgsExpressionLineEdit, QgsProjectionSelectionWidget
from qgis.core import (QgsCoordinateReferenceSystem,
from qgis.core import (QgsSettings,
QgsCoordinateReferenceSystem,
QgsProcessingParameterDefinition,
QgsProcessingParameterBoolean,
QgsProcessingParameterCrs,
@@ -48,7 +49,8 @@
QgsProcessingParameterVectorLayer,
QgsProcessingParameterField,
QgsProcessingParameterFeatureSource)
from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtCore import (Qt,
QByteArray)
from qgis.PyQt.QtWidgets import (QDialog,
QVBoxLayout,
QLabel,
@@ -98,6 +100,13 @@ def __init__(self, alg, paramType=None, param=None):
QDialog.__init__(self)
self.setModal(True)
self.setupUi()
settings = QgsSettings()
self.restoreGeometry(settings.value("/Processing/modelParametersDefinitionDialogGeometry", QByteArray()))

def closeEvent(self, event):
settings = QgsSettings()
settings.setValue("/Processing/modelParametersDefinitionDialogGeometry", self.saveGeometry())
super(ModelerParameterDefinitionDialog, self).closeEvent(event)

def setupUi(self):
self.setWindowTitle(self.tr('Parameter definition'))
@@ -28,7 +28,10 @@

import webbrowser

from qgis.PyQt.QtCore import Qt, QUrl, QMetaObject
from qgis.PyQt.QtCore import (Qt,
QUrl,
QMetaObject,
QByteArray)
from qgis.PyQt.QtWidgets import (QDialog, QDialogButtonBox, QLabel, QLineEdit,
QFrame, QPushButton, QSizePolicy, QVBoxLayout,
QHBoxLayout, QWidget)
@@ -41,7 +44,8 @@
QgsProcessingParameterRasterDestination,
QgsProcessingParameterFileDestination,
QgsProcessingParameterFolderDestination,
QgsProcessingOutputDefinition)
QgsProcessingOutputDefinition,
QgsSettings)

from qgis.gui import (QgsMessageBar,
QgsScrollArea,
@@ -70,6 +74,13 @@ def __init__(self, alg, model, algName=None):
self.childId = algName
self.setupUi()
self.params = None
settings = QgsSettings()
self.restoreGeometry(settings.value("/Processing/modelParametersDialogGeometry", QByteArray()))

def closeEvent(self, event):
settings = QgsSettings()
settings.setValue("/Processing/modelParametersDialogGeometry", self.saveGeometry())
super(ModelerParametersDialog, self).closeEvent(event)

def setupUi(self):
self.labels = {}

0 comments on commit 7db1a9d

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