mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Plugin Installer update
git-svn-id: http://svn.osgeo.org/qgis/trunk@9798 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
dced12f956
commit
6de112af5b
@ -14,7 +14,7 @@ def name():
|
||||
return "Plugin Installer"
|
||||
|
||||
def version():
|
||||
return "Version 0.9.4"
|
||||
return "Version 0.9.5"
|
||||
|
||||
def description():
|
||||
return "Downloads and installs QGIS python plugins"
|
||||
|
@ -61,6 +61,13 @@ except:
|
||||
QGIS_MAJOR_VER = 1
|
||||
|
||||
|
||||
|
||||
def setIface(qgisIface):
|
||||
global iface
|
||||
iface = qgisIface
|
||||
|
||||
|
||||
|
||||
reposGroup = "/Qgis/plugin-repos"
|
||||
settingsGroup = "/Qgis/plugin-installer"
|
||||
seenPluginGroup = "/Qgis/plugin-seen"
|
||||
@ -317,10 +324,13 @@ class Repositories(QObject):
|
||||
"repository" : reposName,
|
||||
"localdir" : name,
|
||||
"read-only" : False}
|
||||
#if compatible, add the plugin to list
|
||||
qgisMinimumVersion = pluginNodes.item(i).firstChildElement("qgis_minimum_version").text().trimmed()
|
||||
if not qgisMinimumVersion: qgisMinimumVersion = "0"
|
||||
if compareVersions(QGIS_VER, qgisMinimumVersion) < 2:
|
||||
# please use the tag below only if really needed! (for example if plugin development is abandoned)
|
||||
qgisMaximumVersion = pluginNodes.item(i).firstChildElement("qgis_maximum_version").text().trimmed()
|
||||
if not qgisMaximumVersion: qgisMaximumVersion = "2"
|
||||
#if compatible, add the plugin to the list
|
||||
if compareVersions(QGIS_VER, qgisMinimumVersion) < 2 and compareVersions(qgisMaximumVersion, QGIS_VER) < 2:
|
||||
plugins.addPlugin(plugin)
|
||||
plugins.workarounds()
|
||||
self.mRepositories[reposName]["state"] = 2
|
||||
@ -440,10 +450,10 @@ class Plugins(QObject):
|
||||
errorDetails = qgisMinimumVersion
|
||||
except:
|
||||
pass
|
||||
#try:
|
||||
# exec ("%s.classFactory(QgisInterface)" % key)
|
||||
#except Exception, error:
|
||||
# error = error.message
|
||||
try:
|
||||
exec ("%s.classFactory(iface)" % key)
|
||||
except Exception, error:
|
||||
error = error.message
|
||||
except Exception, error:
|
||||
error = error.message
|
||||
|
||||
@ -571,8 +581,6 @@ class Plugins(QObject):
|
||||
# ----------------------------------------- #
|
||||
def workarounds(self):
|
||||
""" workarounds for particular plugins with wrong metadata """
|
||||
if self.mPlugins.has_key("postgps") and self.mPlugins["postgps"]["version_avail"] == "0.2":
|
||||
self.mPlugins["postgps"]["version_avail"] = "0.01"
|
||||
if self.mPlugins.has_key("select") and self.mPlugins["select"]["version_avail"] == "0.1":
|
||||
self.mPlugins["select"]["version_avail"] = "0.2"
|
||||
|
||||
|
@ -412,7 +412,7 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialogBase):
|
||||
ver = availableVersion
|
||||
else:
|
||||
ver = installedVersion
|
||||
if p["status"] in ["upgradeable","newer"]:
|
||||
if p["status"] in ["upgradeable","newer"] or installedVersion == "?" or availableVersion == "?":
|
||||
verTip = self.tr("installed version") + ": " + installedVersion + "\n" + self.tr("available version") + ": " + availableVersion
|
||||
elif p["status"] in ["not installed", "new"]:
|
||||
verTip = self.tr("available version") + ": " + availableVersion
|
||||
@ -568,7 +568,7 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialogBase):
|
||||
message = self.tr("The plugin is designed for a newer version of Quantum GIS. The minimum required version is:")
|
||||
message += " <b>" + plugin["error_details"] + "</b>"
|
||||
elif plugin["error"] == "dependent":
|
||||
message = self.tr("The plugin depends on some components missing on this system. You need to install the following Python module in order to enable it:")
|
||||
message = self.tr("The plugin depends on some components missing on your system. You need to install the following Python module in order to enable it:")
|
||||
message += "<b> " + plugin["error_details"] + "</b>"
|
||||
else:
|
||||
message = self.tr("The plugin is broken. Python said:")
|
||||
|
@ -26,6 +26,7 @@ class InstallerPlugin():
|
||||
# ----------------------------------------- #
|
||||
def __init__(self, iface):
|
||||
self.iface = iface
|
||||
setIface(self.iface) #pass self.iface to installer_data module (needed for plugin loading & testing)
|
||||
if QGIS_MAJOR_VER: # new plugin API
|
||||
self.mainWindow = self.iface.mainWindow
|
||||
else: # old plugin API
|
||||
|
Loading…
x
Reference in New Issue
Block a user