Skip to content
Permalink
Browse files

[Plugin Installer] Simplify plugin reloading

  • Loading branch information
borysiasty committed Jun 25, 2013
1 parent 6cfe4a5 commit fd2b221e6541c1850d7fb8b9037e13c73b9dc785
Showing with 6 additions and 4 deletions.
  1. +6 −4 python/pyplugin_installer/installer.py
@@ -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()

0 comments on commit fd2b221

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