Plugin installer update

git-svn-id: http://svn.osgeo.org/qgis/trunk@14472 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
borysiasty 2010-11-01 00:52:20 +00:00
parent bd65124802
commit 5bcdfb00e1
2 changed files with 26 additions and 11 deletions

View File

@ -260,8 +260,8 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialogBase):
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 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialogBase):
# ----------------------------------------- #
def installPlugin(self):
""" install currently selected plugin """
def installPluginClicked(self):
if not self.treePlugins.currentItem():
return
infoString = ('','')
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 = ('','')
plugin = plugins.all()[key]
previousStatus = plugin["status"]
if not plugin:
@ -666,11 +679,8 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialogBase):
# ----------------------------------------- #
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

View File

@ -78,9 +78,14 @@ class InstallerPlugin():
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."))
# ----------------------------------------- #