Skip to content

Commit

Permalink
Plugin installer update
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@14472 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty committed Nov 1, 2010
1 parent bd65124 commit 5bcdfb0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
28 changes: 19 additions & 9 deletions python/plugins/plugin_installer/installer_gui.py
Expand Up @@ -260,8 +260,8 @@ def __init__(self, parent, fl):
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)
Expand Down Expand Up @@ -564,12 +564,25 @@ def pluginTreeClicked(self):


# ----------------------------------------- #
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
infoString = ('','')
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:
Expand Down Expand Up @@ -666,11 +679,8 @@ def installPlugin(self):


# ----------------------------------------- #
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
Expand Down
9 changes: 7 additions & 2 deletions python/plugins/plugin_installer/installer_plugin.py
Expand Up @@ -78,9 +78,14 @@ def initGui(self):
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."))


# ----------------------------------------- #
Expand Down

0 comments on commit 5bcdfb0

Please sign in to comment.