Skip to content
Permalink
Browse files

[Plugin Manager] Prevent from removing the official repository

  • Loading branch information
borysiasty committed Jun 11, 2013
1 parent 3400211 commit 74f08c508135f97d7a4f8c3b1ff3604d83b88bcb
Showing with 5 additions and 2 deletions.
  1. +5 −2 python/pyplugin_installer/installer.py
@@ -485,12 +485,15 @@ def deleteRepository(self, reposName):
""" delete repository connection """
if not reposName:
return
settings = QSettings()
settings.beginGroup(reposGroup)
if settings.value(reposName+"/url", "", type=unicode) == officialRepo[1]:
QMessageBox.warning(iface.mainWindow(), self.tr("QGIS Python Plugin Installer"), self.tr("You can't remove the official QGIS Plugin Repository. You can disable it if needed."))
return
warning = self.tr("Are you sure you want to remove the following repository?") + "\n" + reposName
if QMessageBox.warning(iface.mainWindow(), self.tr("QGIS Python Plugin Installer"), warning , QMessageBox.Yes, QMessageBox.No) == QMessageBox.No:
return
# delete from the settings, refresh data and repopulate all the widgets
settings = QSettings()
settings.beginGroup(reposGroup)
settings.remove(reposName)
repositories.remove(reposName)
plugins.removeRepository(reposName)

0 comments on commit 74f08c5

Please sign in to comment.
You can’t perform that action at this time.