[QGIS Commit] r14577 - trunk/qgis/python/plugins/plugin_installer
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Fri Nov 12 15:07:39 EST 2010
Author: borysiasty
Date: 2010-11-12 12:07:39 -0800 (Fri, 12 Nov 2010)
New Revision: 14577
Modified:
trunk/qgis/python/plugins/plugin_installer/__init__.py
trunk/qgis/python/plugins/plugin_installer/installer_data.py
trunk/qgis/python/plugins/plugin_installer/installer_gui.py
trunk/qgis/python/plugins/plugin_installer/qgsplugininstallerbase.ui
Log:
Plugin Installer update. New features: Upgrade All button, plugin count in the window title and Horst's repository
Modified: trunk/qgis/python/plugins/plugin_installer/__init__.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/__init__.py 2010-11-12 20:03:27 UTC (rev 14576)
+++ trunk/qgis/python/plugins/plugin_installer/__init__.py 2010-11-12 20:07:39 UTC (rev 14577)
@@ -15,7 +15,7 @@
return "Plugin Installer"
def version():
- return "Version 1.1"
+ return "Version 1.2"
def description():
return "Downloads and installs QGIS python plugins"
Modified: trunk/qgis/python/plugins/plugin_installer/installer_data.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/installer_data.py 2010-11-12 20:03:27 UTC (rev 14576)
+++ trunk/qgis/python/plugins/plugin_installer/installer_data.py 2010-11-12 20:07:39 UTC (rev 14577)
@@ -79,6 +79,7 @@
("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", ""),
Modified: trunk/qgis/python/plugins/plugin_installer/installer_gui.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/installer_gui.py 2010-11-12 20:03:27 UTC (rev 14576)
+++ trunk/qgis/python/plugins/plugin_installer/installer_gui.py 2010-11-12 20:07:39 UTC (rev 14577)
@@ -260,6 +260,7 @@
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 @@
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)
@@ -564,6 +572,12 @@
# ----------------------------------------- #
+ def upgradeAllClicked(self):
+ for key in self.upgradeablePlugins:
+ self.installPlugin(key, quiet=True)
+
+
+ # ----------------------------------------- #
def installPluginClicked(self):
if not self.treePlugins.currentItem():
return
@@ -579,8 +593,8 @@
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 @@
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 @@
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:")
Modified: trunk/qgis/python/plugins/plugin_installer/qgsplugininstallerbase.ui
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/qgsplugininstallerbase.ui 2010-11-12 20:03:27 UTC (rev 14576)
+++ trunk/qgis/python/plugins/plugin_installer/qgsplugininstallerbase.ui 2010-11-12 20:07:39 UTC (rev 14577)
@@ -238,6 +238,13 @@
<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">
<enum>Qt::Horizontal</enum>
More information about the QGIS-commit
mailing list