Skip to content

Commit

Permalink
[Plugin Installer] Simplify plugin reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
borysiasty committed Jun 25, 2013
1 parent 6cfe4a5 commit fd2b221
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/pyplugin_installer/installer.py
Expand Up @@ -320,11 +320,13 @@ def installPlugin(self, key, quiet=False):
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()
Expand Down

0 comments on commit fd2b221

Please sign in to comment.