Skip to content
Permalink
Browse files

[processing] fixed provider updates in toolbox

  • Loading branch information
volaya committed Apr 28, 2016
1 parent 71712ac commit e925382292e3927fd881890beacb484ee3d82452
@@ -183,6 +183,14 @@ def updateProviders():
for provider in providers:
provider.loadAlgorithms()

@staticmethod
def reloadProvider(providerName):
for p in Processing.providers:
if p.getName() == providerName:
p.loadAlgorithms()
Processing.algs[
p.getName()] = {a.commandLineName(): a for a in p.algs}

@staticmethod
def loadAlgorithms():
Processing.algs = {}
@@ -157,6 +157,7 @@ def activateProvider(self, providerName):
"The provider has been activated, but it might need additional configuration.")

def updateProvider(self, providerName):
Processing.reloadProvider(providerName)
item = self._providerItem(providerName)
if item is not None:
item.refresh()
@@ -308,9 +309,7 @@ def addRecentAlgorithms(self, updating):
def addProvider(self, providerName):
name = 'ACTIVATE_' + providerName.upper().replace(' ', '_')
providerItem = TreeProviderItem(providerName, None, self)
if ProcessingConfig.getSetting(name):
providerItem.setHidden(providerItem.childCount() == 0)
else:
if not ProcessingConfig.getSetting(name):
providerItem = TreeProviderItem(providerName, None, self)
providerItem.setHidden(True)
self.disabledProviderItems[providerName] = providerItem
@@ -330,7 +329,6 @@ def fillTreeUsingProviders(self):
name = 'ACTIVATE_' + providerName.upper().replace(' ', '_')
if ProcessingConfig.getSetting(name):
providerItem = TreeProviderItem(providerName, self.algorithmTree, self)
providerItem.setHidden(providerItem.childCount() == 0)
else:
disabled.append(providerName)
self.algorithmTree.sortItems(0, Qt.AscendingOrder)
@@ -436,3 +434,5 @@ def activateProvider():
self.setToolTip(0, self.text(0))
for groupItem in groups.values():
self.addChild(groupItem)

self.setHidden(self.childCount() == 0)

0 comments on commit e925382

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