Skip to content

Commit 5fbda84

Browse files

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed
 

‎python/plugins/plugin_installer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def name():
1414
return "Plugin Installer"
1515

1616
def version():
17-
return "Version 0.9.4"
17+
return "Version 0.9.5"
1818

1919
def description():
2020
return "Downloads and installs QGIS python plugins"

‎python/plugins/plugin_installer/installer_data.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@
6161
QGIS_MAJOR_VER = 1
6262

6363

64+
65+
def setIface(qgisIface):
66+
global iface
67+
iface = qgisIface
68+
69+
70+
6471
reposGroup = "/Qgis/plugin-repos"
6572
settingsGroup = "/Qgis/plugin-installer"
6673
seenPluginGroup = "/Qgis/plugin-seen"
@@ -317,10 +324,13 @@ def xmlDownloaded(self,nr,state):
317324
"repository" : reposName,
318325
"localdir" : name,
319326
"read-only" : False}
320-
#if compatible, add the plugin to list
321327
qgisMinimumVersion = pluginNodes.item(i).firstChildElement("qgis_minimum_version").text().trimmed()
322328
if not qgisMinimumVersion: qgisMinimumVersion = "0"
323-
if compareVersions(QGIS_VER, qgisMinimumVersion) < 2:
329+
# please use the tag below only if really needed! (for example if plugin development is abandoned)
330+
qgisMaximumVersion = pluginNodes.item(i).firstChildElement("qgis_maximum_version").text().trimmed()
331+
if not qgisMaximumVersion: qgisMaximumVersion = "2"
332+
#if compatible, add the plugin to the list
333+
if compareVersions(QGIS_VER, qgisMinimumVersion) < 2 and compareVersions(qgisMaximumVersion, QGIS_VER) < 2:
324334
plugins.addPlugin(plugin)
325335
plugins.workarounds()
326336
self.mRepositories[reposName]["state"] = 2
@@ -440,10 +450,10 @@ def updatePlugin(self, key, readOnly):
440450
errorDetails = qgisMinimumVersion
441451
except:
442452
pass
443-
#try:
444-
# exec ("%s.classFactory(QgisInterface)" % key)
445-
#except Exception, error:
446-
# error = error.message
453+
try:
454+
exec ("%s.classFactory(iface)" % key)
455+
except Exception, error:
456+
error = error.message
447457
except Exception, error:
448458
error = error.message
449459

@@ -571,8 +581,6 @@ def isThereAnythingNew(self):
571581
# ----------------------------------------- #
572582
def workarounds(self):
573583
""" workarounds for particular plugins with wrong metadata """
574-
if self.mPlugins.has_key("postgps") and self.mPlugins["postgps"]["version_avail"] == "0.2":
575-
self.mPlugins["postgps"]["version_avail"] = "0.01"
576584
if self.mPlugins.has_key("select") and self.mPlugins["select"]["version_avail"] == "0.1":
577585
self.mPlugins["select"]["version_avail"] = "0.2"
578586

‎python/plugins/plugin_installer/installer_gui.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def addItem(p):
412412
ver = availableVersion
413413
else:
414414
ver = installedVersion
415-
if p["status"] in ["upgradeable","newer"]:
415+
if p["status"] in ["upgradeable","newer"] or installedVersion == "?" or availableVersion == "?":
416416
verTip = self.tr("installed version") + ": " + installedVersion + "\n" + self.tr("available version") + ": " + availableVersion
417417
elif p["status"] in ["not installed", "new"]:
418418
verTip = self.tr("available version") + ": " + availableVersion
@@ -568,7 +568,7 @@ def installPlugin(self):
568568
message = self.tr("The plugin is designed for a newer version of Quantum GIS. The minimum required version is:")
569569
message += " <b>" + plugin["error_details"] + "</b>"
570570
elif plugin["error"] == "dependent":
571-
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:")
571+
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:")
572572
message += "<b> " + plugin["error_details"] + "</b>"
573573
else:
574574
message = self.tr("The plugin is broken. Python said:")

‎python/plugins/plugin_installer/installer_plugin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class InstallerPlugin():
2626
# ----------------------------------------- #
2727
def __init__(self, iface):
2828
self.iface = iface
29+
setIface(self.iface) #pass self.iface to installer_data module (needed for plugin loading & testing)
2930
if QGIS_MAJOR_VER: # new plugin API
3031
self.mainWindow = self.iface.mainWindow
3132
else: # old plugin API

0 commit comments

Comments
 (0)
Please sign in to comment.