Skip to content
Permalink
Browse files

Remember window geometry in multi input dialogs

  • Loading branch information
nyalldawson committed Aug 4, 2017
1 parent a1f487d commit 572dadab0157e60ea1d75d2cc854ee7ba85cb436
@@ -32,6 +32,7 @@

from qgis.core import QgsSettings
from qgis.PyQt import uic
from qgis.PyQt.QtCore import QByteArray
from qgis.PyQt.QtWidgets import QDialog, QAbstractItemView, QPushButton, QDialogButtonBox, QFileDialog
from qgis.PyQt.QtGui import QStandardItemModel, QStandardItem

@@ -65,7 +66,14 @@ def __init__(self, options):
self.btnRemove.clicked.connect(lambda: self.removeRows())
self.btnRemoveAll.clicked.connect(lambda: self.removeRows(True))

self.settings = QgsSettings()
self.restoreGeometry(self.settings.value("/Processing/multipleFileInputDialogGeometry", QByteArray()))

self.populateList()
self.finished.connect(self.saveWindowGeometry)

def saveWindowGeometry(self):
self.settings.setValue("/Processing/multipleInputDialogGeometry", self.saveGeometry())

def populateList(self):
model = QStandardItemModel()
@@ -29,8 +29,10 @@

import os

from qgis.core import QgsSettings
from qgis.PyQt import uic
from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtCore import QByteArray
from qgis.PyQt.QtWidgets import QDialog, QAbstractItemView, QPushButton, QDialogButtonBox
from qgis.PyQt.QtGui import QStandardItemModel, QStandardItem

@@ -71,7 +73,14 @@ def __init__(self, options, selectedoptions=None):
self.btnClearSelection.clicked.connect(lambda: self.selectAll(False))
self.btnToggleSelection.clicked.connect(self.toggleSelection)

self.settings = QgsSettings()
self.restoreGeometry(self.settings.value("/Processing/multipleInputDialogGeometry", QByteArray()))

self.populateList()
self.finished.connect(self.saveWindowGeometry)

def saveWindowGeometry(self):
self.settings.setValue("/Processing/multipleInputDialogGeometry", self.saveGeometry())

def populateList(self):
model = QStandardItemModel()

0 comments on commit 572dada

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