[QGIS Commit] r14472 - trunk/qgis/python/plugins/plugin_installer
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sun Oct 31 20:52:20 EDT 2010
Author: borysiasty
Date: 2010-10-31 17:52:20 -0700 (Sun, 31 Oct 2010)
New Revision: 14472
Modified:
trunk/qgis/python/plugins/plugin_installer/installer_gui.py
trunk/qgis/python/plugins/plugin_installer/installer_plugin.py
Log:
Plugin installer update
Modified: trunk/qgis/python/plugins/plugin_installer/installer_gui.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/installer_gui.py 2010-10-31 23:36:26 UTC (rev 14471)
+++ trunk/qgis/python/plugins/plugin_installer/installer_gui.py 2010-11-01 00:52:20 UTC (rev 14472)
@@ -260,8 +260,8 @@
self.connect(self.treePlugins, SIGNAL("itemSelectionChanged()"), self.pluginTreeClicked)
self.connect(self.treeRepositories, SIGNAL("itemSelectionChanged()"), self.repositoryTreeClicked)
# buttons
- self.connect(self.buttonInstall, SIGNAL("clicked()"), self.installPlugin)
- self.connect(self.buttonUninstall, SIGNAL("clicked()"), self.uninstallPlugin)
+ self.connect(self.buttonInstall, SIGNAL("clicked()"), self.installPluginClicked)
+ self.connect(self.buttonUninstall, SIGNAL("clicked()"), self.uninstallPluginClicked)
self.buttonInstall.setEnabled(False)
self.buttonUninstall.setEnabled(False)
self.buttonHelp.setEnabled(QGIS_14)
@@ -564,12 +564,25 @@
# ----------------------------------------- #
- def installPlugin(self):
- """ install currently selected plugin """
+ def installPluginClicked(self):
if not self.treePlugins.currentItem():
return
+ key = plugins.keyByUrl(self.treePlugins.currentItem().toolTip(5))
+ self.installPlugin(key)
+
+
+ # ----------------------------------------- #
+ def uninstallPluginClicked(self):
+ if not self.treePlugins.currentItem():
+ return
+ key = plugins.keyByUrl(self.treePlugins.currentItem().toolTip(5))
+ self.uninstallPlugin(key)
+
+
+# ----------------------------------------- #
+ def installPlugin(self, key):
+ """ install currently selected plugin """
infoString = ('','')
- key = plugins.keyByUrl(self.treePlugins.currentItem().toolTip(5))
plugin = plugins.all()[key]
previousStatus = plugin["status"]
if not plugin:
@@ -666,11 +679,8 @@
# ----------------------------------------- #
- def uninstallPlugin(self):
+ def uninstallPlugin(self,key):
""" uninstall currently selected plugin """
- if not self.treePlugins.currentItem():
- return
- key = plugins.keyByUrl(self.treePlugins.currentItem().toolTip(5))
plugin = plugins.all()[key]
if not plugin:
return
Modified: trunk/qgis/python/plugins/plugin_installer/installer_plugin.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/installer_plugin.py 2010-10-31 23:36:26 UTC (rev 14471)
+++ trunk/qgis/python/plugins/plugin_installer/installer_plugin.py 2010-11-01 00:52:20 UTC (rev 14472)
@@ -78,9 +78,14 @@
else:
for key in repositories.allEnabled():
repositories.setRepositoryData(key,"state",3)
-
for i in plugins.obsoletePlugins:
- 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."))
+ if i == "plugin_installer":
+ # uninstall the installer itself
+ 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"))
+ removeDir( QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "/python/plugins/" + plugins.localCache[i]["localdir"] )
+ return
+ else:
+ 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."))
# ----------------------------------------- #
More information about the QGIS-commit
mailing list