Navigation Menu

Skip to content

Commit

Permalink
[Plugin Manager] Plugin installer fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
borysiasty committed Jun 12, 2013
1 parent e37a6e0 commit 85e1ab9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions python/pyplugin_installer/installer.py
Expand Up @@ -312,14 +312,13 @@ def installPlugin(self, key, quiet=False):
loadPlugin(plugin["id"])
plugins.getAllInstalled(testLoad=True)
plugins.rebuild()
self.exportPluginsToManager()
plugin = plugins.all()[key]
if not plugin["error"]:
if previousStatus in ["not installed", "new"]:
infoString = (self.tr("Plugin installed successfully"), self.tr("Plugin installed successfully"))
settings = QSettings()
settings.setValue("/PythonPlugins/"+plugin["id"], True)
startPlugin(plugin["id"])
if startPlugin(plugin["id"]):
settings = QSettings()
settings.setValue("/PythonPlugins/"+plugin["id"], True)
else:
settings = QSettings()
if settings.value("/PythonPlugins/"+key, False, type=bool): # plugin will be reloaded on the fly only if currently loaded
Expand All @@ -344,9 +343,6 @@ def installPlugin(self, key, quiet=False):
dlg.exec_()
if dlg.result():
# revert installation
plugins.getAllInstalled()
plugins.rebuild()
self.exportPluginsToManager()
pluginDir = QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "/python/plugins/" + plugin["id"]
removeDir(pluginDir)
if QDir(pluginDir).exists():
Expand All @@ -364,7 +360,8 @@ def installPlugin(self, key, quiet=False):
pass
plugins.getAllInstalled()
plugins.rebuild()
self.exportPluginsToManager()

self.exportPluginsToManager()

if infoString[0]:
QMessageBox.information(iface.mainWindow(), infoString[0], infoString[1])
Expand Down
4 changes: 2 additions & 2 deletions python/pyplugin_installer/installer_data.py
Expand Up @@ -630,8 +630,8 @@ def pluginMetadata(fct):
if not isCompatible(QGis.QGIS_VERSION, qgisMinimumVersion, qgisMaximumVersion):
error = "incompatible"
errorDetails = "%s - %s" % (qgisMinimumVersion, qgisMaximumVersion)

if testLoad:
elif testLoad:
# only testLoad if compatible version
try:
exec "import %s" % key in globals(), locals()
exec "reload (%s)" % key in globals(), locals()
Expand Down

0 comments on commit 85e1ab9

Please sign in to comment.