Skip to content

Commit

Permalink
Plugin Installer update
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9798 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty committed Dec 14, 2008
1 parent 4a1b10e commit 5fbda84
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion python/plugins/plugin_installer/__init__.py
Expand Up @@ -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"
Expand Down
24 changes: 16 additions & 8 deletions python/plugins/plugin_installer/installer_data.py
Expand Up @@ -61,6 +61,13 @@
QGIS_MAJOR_VER = 1



def setIface(qgisIface):
global iface
iface = qgisIface



reposGroup = "/Qgis/plugin-repos"
settingsGroup = "/Qgis/plugin-installer"
seenPluginGroup = "/Qgis/plugin-seen"
Expand Down Expand Up @@ -317,10 +324,13 @@ def xmlDownloaded(self,nr,state):
"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
Expand Down Expand Up @@ -440,10 +450,10 @@ def updatePlugin(self, key, readOnly):
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

Expand Down Expand Up @@ -571,8 +581,6 @@ def isThereAnythingNew(self):
# ----------------------------------------- #
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"

Expand Down
4 changes: 2 additions & 2 deletions python/plugins/plugin_installer/installer_gui.py
Expand Up @@ -412,7 +412,7 @@ def addItem(p):
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
Expand Down Expand Up @@ -568,7 +568,7 @@ def installPlugin(self):
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:")
Expand Down
1 change: 1 addition & 0 deletions python/plugins/plugin_installer/installer_plugin.py
Expand Up @@ -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
Expand Down

0 comments on commit 5fbda84

Please sign in to comment.