Skip to content
Permalink
Browse files

Plugin Installer update. New features: Upgrade All button, plugin cou…

…nt in the window title and Horst's repository

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14577 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty
borysiasty committed Nov 12, 2010
1 parent ca556eb commit d400fa06ba5db1e6b9e91cf9a9c8b3fdc7065616
@@ -15,7 +15,7 @@ def name():
return "Plugin Installer"

def version():
return "Version 1.1"
return "Version 1.2"

def description():
return "Downloads and installs QGIS python plugins"
@@ -79,6 +79,7 @@ def setIface(qgisIface):
("CatAIS Repository", "http://www.catais.org/qgis/plugins.xml", ""),
("Faunalia Repository", "http://www.faunalia.it/qgis/plugins.xml", "http://faunalia.it/qgis/plugins.xml"),
("GIS-Lab Repository", "http://gis-lab.info/programs/qgis/qgis-repo.xml", ""),
("Kappasys Repositoty", "http://www.kappasys.org/qgis/plugins.xml", ""),
("Martin Dobias' Sandbox", "http://mapserver.sk/~wonder/qgis/plugins-sandbox.xml", ""),
("Marco Hugentobler's Repository","http://karlinapp.ethz.ch/python_plugins/python_plugins.xml", ""),
("Sourcepole Repository", "http://build.sourcepole.ch/qgis/plugins.xml", ""),
@@ -260,6 +260,7 @@ def __init__(self, parent, fl):
self.connect(self.treePlugins, SIGNAL("itemSelectionChanged()"), self.pluginTreeClicked)
self.connect(self.treeRepositories, SIGNAL("itemSelectionChanged()"), self.repositoryTreeClicked)
# buttons
self.connect(self.buttonUpgradeAll, SIGNAL("clicked()"), self.upgradeAllClicked)
self.connect(self.buttonInstall, SIGNAL("clicked()"), self.installPluginClicked)
self.connect(self.buttonUninstall, SIGNAL("clicked()"), self.uninstallPluginClicked)
self.buttonInstall.setEnabled(False)
@@ -517,10 +518,17 @@ def addItem(p):
for p in plugins.all().values():
if p["error"] == i:
addItem(p)
n = 0 # displayed plugins count
self.upgradeablePlugins = [] # list of plugins able to update
for i in orderValid:
for p in plugins.all().values():
if p["status"] == i and not p["error"]:
addItem(p)
if p["status"] == "upgradeable": self.upgradeablePlugins += [p["localdir"]]
n +=1
self.setWindowTitle(self.tr("QGIS Python Plugin Installer") + self.tr(" - %d plugins available" % len(plugins.all())))
self.buttonUpgradeAll.setEnabled( len(self.upgradeablePlugins) )

# resize the columns
for i in [0,1,2,3,4,5]:
self.treePlugins.resizeColumnToContents(i)
@@ -563,6 +571,12 @@ def pluginTreeClicked(self):
self.buttonUninstall.setEnabled(False)


# ----------------------------------------- #
def upgradeAllClicked(self):
for key in self.upgradeablePlugins:
self.installPlugin(key, quiet=True)


# ----------------------------------------- #
def installPluginClicked(self):
if not self.treePlugins.currentItem():
@@ -579,8 +593,8 @@ def uninstallPluginClicked(self):
self.uninstallPlugin(key)


# ----------------------------------------- #
def installPlugin(self, key):
# ----------------------------------------- #
def installPlugin(self, key, quiet=False):
""" install currently selected plugin """
infoString = ('','')
plugin = plugins.all()[key]
@@ -590,6 +604,7 @@ def installPlugin(self, key):
if plugin["status"] == "newer" and not plugin["error"]: # ask for confirmation if user downgrades an usable plugin
if QMessageBox.warning(self, self.tr("QGIS Python Plugin Installer"), self.tr("Are you sure you want to downgrade the plugin to the latest available version? The installed one is newer!"), QMessageBox.Yes, QMessageBox.No) == QMessageBox.No:
return

dlg = QgsPluginInstallerInstallingDialog(self,plugin)
dlg.exec_()

@@ -634,6 +649,8 @@ def installPlugin(self, key):
else:
infoString = (self.tr("Plugin reinstalled successfully"), self.tr("Python plugin reinstalled.\nYou need to restart Quantum GIS in order to reload it."))
else: infoString = (self.tr("Plugin reinstalled successfully"), self.tr("Python plugin reinstalled.\nYou need to restart Quantum GIS in order to reload it."))
if quiet:
infoString = (None, None)
else:
if plugin["error"] == "incompatible":
message = self.tr("The plugin is designed for a newer version of Quantum GIS. The minimum required version is:")
@@ -237,6 +237,13 @@
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QPushButton" name="buttonUpgradeAll">
<property name="text">
<string>Upgrade all</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">

0 comments on commit d400fa0

Please sign in to comment.
You can’t perform that action at this time.