From fd2b221e6541c1850d7fb8b9037e13c73b9dc785 Mon Sep 17 00:00:00 2001 From: Borys Jurgiel Date: Tue, 25 Jun 2013 19:28:20 +0200 Subject: [PATCH] [Plugin Installer] Simplify plugin reloading --- python/pyplugin_installer/installer.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python/pyplugin_installer/installer.py b/python/pyplugin_installer/installer.py index fb991fb9656..c196ae20c7d 100644 --- a/python/pyplugin_installer/installer.py +++ b/python/pyplugin_installer/installer.py @@ -320,11 +320,13 @@ class QgsPluginInstaller(QObject): settings = QSettings() settings.setValue("/PythonPlugins/"+plugin["id"], True) else: + infoString = (self.tr("Plugin reinstalled successfully"), self.tr("Plugin reinstalled successfully")) settings = QSettings() - if settings.value("/PythonPlugins/"+key, False, type=bool): # plugin will be reloaded on the fly only if currently loaded - infoString = (self.tr("Plugin reinstalled successfully"), self.tr("Plugin reinstalled successfully")) - reloadPlugin(key) - else: infoString = (self.tr("Plugin reinstalled successfully"), self.tr("Python plugin reinstalled.\nYou need to restart QGIS in order to reload it.")) + if settings.value("/PythonPlugins/"+key, False, type=bool): + reloadPlugin(key) # unloadPlugin + loadPlugin + startPlugin + else: + unloadPlugin(key) # Just for a case. Will exit quietly if really not loaded + loadPlugin(key) if quiet: infoString = (None, None) QApplication.restoreOverrideCursor()