mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -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"
|
return "Plugin Installer"
|
||||||
|
|
||||||
def version():
|
def version():
|
||||||
return "Version 0.9.4"
|
return "Version 0.9.5"
|
||||||
|
|
||||||
def description():
|
def description():
|
||||||
return "Downloads and installs QGIS python plugins"
|
return "Downloads and installs QGIS python plugins"
|
||||||
|
@ -61,6 +61,13 @@ except:
|
|||||||
QGIS_MAJOR_VER = 1
|
QGIS_MAJOR_VER = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def setIface(qgisIface):
|
||||||
|
global iface
|
||||||
|
iface = qgisIface
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
reposGroup = "/Qgis/plugin-repos"
|
reposGroup = "/Qgis/plugin-repos"
|
||||||
settingsGroup = "/Qgis/plugin-installer"
|
settingsGroup = "/Qgis/plugin-installer"
|
||||||
seenPluginGroup = "/Qgis/plugin-seen"
|
seenPluginGroup = "/Qgis/plugin-seen"
|
||||||
@ -317,10 +324,13 @@ class Repositories(QObject):
|
|||||||
"repository" : reposName,
|
"repository" : reposName,
|
||||||
"localdir" : name,
|
"localdir" : name,
|
||||||
"read-only" : False}
|
"read-only" : False}
|
||||||
#if compatible, add the plugin to list
|
|
||||||
qgisMinimumVersion = pluginNodes.item(i).firstChildElement("qgis_minimum_version").text().trimmed()
|
qgisMinimumVersion = pluginNodes.item(i).firstChildElement("qgis_minimum_version").text().trimmed()
|
||||||
if not qgisMinimumVersion: qgisMinimumVersion = "0"
|
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.addPlugin(plugin)
|
||||||
plugins.workarounds()
|
plugins.workarounds()
|
||||||
self.mRepositories[reposName]["state"] = 2
|
self.mRepositories[reposName]["state"] = 2
|
||||||
@ -440,10 +450,10 @@ class Plugins(QObject):
|
|||||||
errorDetails = qgisMinimumVersion
|
errorDetails = qgisMinimumVersion
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
#try:
|
try:
|
||||||
# exec ("%s.classFactory(QgisInterface)" % key)
|
exec ("%s.classFactory(iface)" % key)
|
||||||
#except Exception, error:
|
except Exception, error:
|
||||||
# error = error.message
|
error = error.message
|
||||||
except Exception, error:
|
except Exception, error:
|
||||||
error = error.message
|
error = error.message
|
||||||
|
|
||||||
@ -571,8 +581,6 @@ class Plugins(QObject):
|
|||||||
# ----------------------------------------- #
|
# ----------------------------------------- #
|
||||||
def workarounds(self):
|
def workarounds(self):
|
||||||
""" workarounds for particular plugins with wrong metadata """
|
""" 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":
|
if self.mPlugins.has_key("select") and self.mPlugins["select"]["version_avail"] == "0.1":
|
||||||
self.mPlugins["select"]["version_avail"] = "0.2"
|
self.mPlugins["select"]["version_avail"] = "0.2"
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialogBase):
|
|||||||
ver = availableVersion
|
ver = availableVersion
|
||||||
else:
|
else:
|
||||||
ver = installedVersion
|
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
|
verTip = self.tr("installed version") + ": " + installedVersion + "\n" + self.tr("available version") + ": " + availableVersion
|
||||||
elif p["status"] in ["not installed", "new"]:
|
elif p["status"] in ["not installed", "new"]:
|
||||||
verTip = self.tr("available version") + ": " + availableVersion
|
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 = self.tr("The plugin is designed for a newer version of Quantum GIS. The minimum required version is:")
|
||||||
message += " <b>" + plugin["error_details"] + "</b>"
|
message += " <b>" + plugin["error_details"] + "</b>"
|
||||||
elif plugin["error"] == "dependent":
|
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>"
|
message += "<b> " + plugin["error_details"] + "</b>"
|
||||||
else:
|
else:
|
||||||
message = self.tr("The plugin is broken. Python said:")
|
message = self.tr("The plugin is broken. Python said:")
|
||||||
|
@ -26,6 +26,7 @@ class InstallerPlugin():
|
|||||||
# ----------------------------------------- #
|
# ----------------------------------------- #
|
||||||
def __init__(self, iface):
|
def __init__(self, iface):
|
||||||
self.iface = 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
|
if QGIS_MAJOR_VER: # new plugin API
|
||||||
self.mainWindow = self.iface.mainWindow
|
self.mainWindow = self.iface.mainWindow
|
||||||
else: # old plugin API
|
else: # old plugin API
|
||||||
|
Loading…
x
Reference in New Issue
Block a user