Skip to content

Commit d400fa0

Browse files
author
borysiasty
committedNov 12, 2010
Plugin Installer update. New features: Upgrade All button, plugin count in the window title and Horst's repository
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14577 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed
 

‎python/plugins/plugin_installer/__init__.py

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

1717
def version():
18-
return "Version 1.1"
18+
return "Version 1.2"
1919

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

‎python/plugins/plugin_installer/installer_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def setIface(qgisIface):
7979
("CatAIS Repository", "http://www.catais.org/qgis/plugins.xml", ""),
8080
("Faunalia Repository", "http://www.faunalia.it/qgis/plugins.xml", "http://faunalia.it/qgis/plugins.xml"),
8181
("GIS-Lab Repository", "http://gis-lab.info/programs/qgis/qgis-repo.xml", ""),
82+
("Kappasys Repositoty", "http://www.kappasys.org/qgis/plugins.xml", ""),
8283
("Martin Dobias' Sandbox", "http://mapserver.sk/~wonder/qgis/plugins-sandbox.xml", ""),
8384
("Marco Hugentobler's Repository","http://karlinapp.ethz.ch/python_plugins/python_plugins.xml", ""),
8485
("Sourcepole Repository", "http://build.sourcepole.ch/qgis/plugins.xml", ""),

‎python/plugins/plugin_installer/installer_gui.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ def __init__(self, parent, fl):
260260
self.connect(self.treePlugins, SIGNAL("itemSelectionChanged()"), self.pluginTreeClicked)
261261
self.connect(self.treeRepositories, SIGNAL("itemSelectionChanged()"), self.repositoryTreeClicked)
262262
# buttons
263+
self.connect(self.buttonUpgradeAll, SIGNAL("clicked()"), self.upgradeAllClicked)
263264
self.connect(self.buttonInstall, SIGNAL("clicked()"), self.installPluginClicked)
264265
self.connect(self.buttonUninstall, SIGNAL("clicked()"), self.uninstallPluginClicked)
265266
self.buttonInstall.setEnabled(False)
@@ -517,10 +518,17 @@ def addItem(p):
517518
for p in plugins.all().values():
518519
if p["error"] == i:
519520
addItem(p)
521+
n = 0 # displayed plugins count
522+
self.upgradeablePlugins = [] # list of plugins able to update
520523
for i in orderValid:
521524
for p in plugins.all().values():
522525
if p["status"] == i and not p["error"]:
523526
addItem(p)
527+
if p["status"] == "upgradeable": self.upgradeablePlugins += [p["localdir"]]
528+
n +=1
529+
self.setWindowTitle(self.tr("QGIS Python Plugin Installer") + self.tr(" - %d plugins available" % len(plugins.all())))
530+
self.buttonUpgradeAll.setEnabled( len(self.upgradeablePlugins) )
531+
524532
# resize the columns
525533
for i in [0,1,2,3,4,5]:
526534
self.treePlugins.resizeColumnToContents(i)
@@ -563,6 +571,12 @@ def pluginTreeClicked(self):
563571
self.buttonUninstall.setEnabled(False)
564572

565573

574+
# ----------------------------------------- #
575+
def upgradeAllClicked(self):
576+
for key in self.upgradeablePlugins:
577+
self.installPlugin(key, quiet=True)
578+
579+
566580
# ----------------------------------------- #
567581
def installPluginClicked(self):
568582
if not self.treePlugins.currentItem():
@@ -579,8 +593,8 @@ def uninstallPluginClicked(self):
579593
self.uninstallPlugin(key)
580594

581595

582-
# ----------------------------------------- #
583-
def installPlugin(self, key):
596+
# ----------------------------------------- #
597+
def installPlugin(self, key, quiet=False):
584598
""" install currently selected plugin """
585599
infoString = ('','')
586600
plugin = plugins.all()[key]
@@ -590,6 +604,7 @@ def installPlugin(self, key):
590604
if plugin["status"] == "newer" and not plugin["error"]: # ask for confirmation if user downgrades an usable plugin
591605
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:
592606
return
607+
593608
dlg = QgsPluginInstallerInstallingDialog(self,plugin)
594609
dlg.exec_()
595610

@@ -634,6 +649,8 @@ def installPlugin(self, key):
634649
else:
635650
infoString = (self.tr("Plugin reinstalled successfully"), self.tr("Python plugin reinstalled.\nYou need to restart Quantum GIS in order to reload it."))
636651
else: infoString = (self.tr("Plugin reinstalled successfully"), self.tr("Python plugin reinstalled.\nYou need to restart Quantum GIS in order to reload it."))
652+
if quiet:
653+
infoString = (None, None)
637654
else:
638655
if plugin["error"] == "incompatible":
639656
message = self.tr("The plugin is designed for a newer version of Quantum GIS. The minimum required version is:")

‎python/plugins/plugin_installer/qgsplugininstallerbase.ui

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,13 @@
237237
</item>
238238
<item>
239239
<layout class="QHBoxLayout">
240+
<item>
241+
<widget class="QPushButton" name="buttonUpgradeAll">
242+
<property name="text">
243+
<string>Upgrade all</string>
244+
</property>
245+
</widget>
246+
</item>
240247
<item>
241248
<spacer>
242249
<property name="orientation">

0 commit comments

Comments
 (0)
Please sign in to comment.