Skip to content

Commit 35638a2

Browse files
author
borysiasty
committedNov 1, 2010
Plugin installer update
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14472 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed
 

‎python/plugins/plugin_installer/installer_gui.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ 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.buttonInstall, SIGNAL("clicked()"), self.installPlugin)
264-
self.connect(self.buttonUninstall, SIGNAL("clicked()"), self.uninstallPlugin)
263+
self.connect(self.buttonInstall, SIGNAL("clicked()"), self.installPluginClicked)
264+
self.connect(self.buttonUninstall, SIGNAL("clicked()"), self.uninstallPluginClicked)
265265
self.buttonInstall.setEnabled(False)
266266
self.buttonUninstall.setEnabled(False)
267267
self.buttonHelp.setEnabled(QGIS_14)
@@ -564,12 +564,25 @@ def pluginTreeClicked(self):
564564

565565

566566
# ----------------------------------------- #
567-
def installPlugin(self):
568-
""" install currently selected plugin """
567+
def installPluginClicked(self):
568+
if not self.treePlugins.currentItem():
569+
return
570+
key = plugins.keyByUrl(self.treePlugins.currentItem().toolTip(5))
571+
self.installPlugin(key)
572+
573+
574+
# ----------------------------------------- #
575+
def uninstallPluginClicked(self):
569576
if not self.treePlugins.currentItem():
570577
return
571-
infoString = ('','')
572578
key = plugins.keyByUrl(self.treePlugins.currentItem().toolTip(5))
579+
self.uninstallPlugin(key)
580+
581+
582+
# ----------------------------------------- #
583+
def installPlugin(self, key):
584+
""" install currently selected plugin """
585+
infoString = ('','')
573586
plugin = plugins.all()[key]
574587
previousStatus = plugin["status"]
575588
if not plugin:
@@ -666,11 +679,8 @@ def installPlugin(self):
666679

667680

668681
# ----------------------------------------- #
669-
def uninstallPlugin(self):
682+
def uninstallPlugin(self,key):
670683
""" uninstall currently selected plugin """
671-
if not self.treePlugins.currentItem():
672-
return
673-
key = plugins.keyByUrl(self.treePlugins.currentItem().toolTip(5))
674684
plugin = plugins.all()[key]
675685
if not plugin:
676686
return

‎python/plugins/plugin_installer/installer_plugin.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,14 @@ def initGui(self):
7878
else:
7979
for key in repositories.allEnabled():
8080
repositories.setRepositoryData(key,"state",3)
81-
8281
for i in plugins.obsoletePlugins:
83-
QMessageBox.warning(self.mainWindow(), QCoreApplication.translate("QgsPluginInstaller","QGIS Plugin Conflict:")+" "+plugins.localCache[i]["name"], "<b>"+ plugins.localCache[i]["name"] + "</b><br/><br/>" + QCoreApplication.translate("QgsPluginInstaller","The Plugin Installer has detected an obsolete plugin which masks a newer version shipped with this QGIS version. This is likely due to files associated with a previous installation of QGIS. Please use the Plugin Installer to remove that older plugin in order to unmask the newer version shipped with this copy of QGIS."))
82+
if i == "plugin_installer":
83+
# uninstall the installer itself
84+
QMessageBox.warning(self.mainWindow(), QCoreApplication.translate("QgsPluginInstaller","QGIS Plugin Installer update"), QCoreApplication.translate("QgsPluginInstaller","The Plugin Installer has been updated. Please restart QGIS prior to using it"))
85+
removeDir( QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "/python/plugins/" + plugins.localCache[i]["localdir"] )
86+
return
87+
else:
88+
QMessageBox.warning(self.mainWindow(), QCoreApplication.translate("QgsPluginInstaller","QGIS Plugin Conflict:")+" "+plugins.localCache[i]["name"], "<b>"+ plugins.localCache[i]["name"] + "</b><br/><br/>" + QCoreApplication.translate("QgsPluginInstaller","The Plugin Installer has detected an obsolete plugin which masks a newer version shipped with this QGIS version. This is likely due to files associated with a previous installation of QGIS. Please use the Plugin Installer to remove that older plugin in order to unmask the newer version shipped with this copy of QGIS."))
8489

8590

8691
# ----------------------------------------- #

0 commit comments

Comments
 (0)
Please sign in to comment.