Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Plugin Manager] Prevent from removing the official repository
  • Loading branch information
borysiasty committed Jun 11, 2013
1 parent 3400211 commit 74f08c5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/pyplugin_installer/installer.py
Expand Up @@ -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)
Expand Down

0 comments on commit 74f08c5

Please sign in to comment.