Skip to content

Commit

Permalink
Save/restore window geometry for plugin installer repo fetching dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 18, 2017
1 parent 3037f22 commit b834156
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/pyplugin_installer/qgsplugininstallerfetchingdialog.py
Expand Up @@ -24,7 +24,9 @@
***************************************************************************/
"""

from qgis.PyQt.QtCore import QByteArray
from qgis.PyQt.QtWidgets import QDialog, QTreeWidgetItem
from qgis.core import QgsSettings

from .ui_qgsplugininstallerfetchingbase import Ui_QgsPluginInstallerFetchingDialogBase
from .installer_data import repositories
Expand Down Expand Up @@ -52,6 +54,14 @@ def __init__(self, parent):
repositories.repositoryFetched.connect(self.repositoryFetched)
repositories.anythingChanged.connect(self.displayState)

settings = QgsSettings()
self.restoreGeometry(settings.value("/Qgis/plugin-installer/fetching_geometry", QByteArray()))

def closeEvent(self, event):
settings = QgsSettings()
settings.setValue("/Qgis/plugin-installer/fetching_geometry", self.saveGeometry())
super(QgsPluginInstallerFetchingDialog, self).closeEvent(event)

# ----------------------------------------- #
def displayState(self, key, state, state2=None):
messages = [self.tr("Success"), self.tr("Resolving host name..."), self.tr("Connecting..."), self.tr("Host connected. Sending request..."), self.tr("Downloading data..."), self.tr("Idle"), self.tr("Closing connection..."), self.tr("Error")]
Expand Down

0 comments on commit b834156

Please sign in to comment.