Skip to content
Permalink
Browse files

Save/restore window geometry for plugin installer repo fetching dialog

  • Loading branch information
nyalldawson committed Jul 18, 2017
1 parent 3037f22 commit b83415688a51ead27aa1bb24e38077d1e66c5c06
Showing with 10 additions and 0 deletions.
  1. +10 −0 python/pyplugin_installer/qgsplugininstallerfetchingdialog.py
@@ -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
@@ -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")]

0 comments on commit b834156

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