Skip to content
Permalink
Browse files

[processing] make items hidden after adding them to the view (fix #17881

)
  • Loading branch information
alexbruy committed Jan 23, 2018
1 parent aaf9793 commit d7e18131808c3a622e5597cdf5608a28136755e7
Showing with 8 additions and 8 deletions.
  1. +8 −8 python/plugins/processing/gui/ProcessingToolbox.py
@@ -342,16 +342,18 @@ def addRecentAlgorithms(self, updating):
def addProvider(self, provider_id):
provider = QgsApplication.processingRegistry().providerById(provider_id)
providerItem = TreeProviderItem(provider, self.algorithmTree, self)
if not provider.isActive():
providerItem.setHidden(True)
self.disabledProviderItems[provider.id()] = providerItem

for i in range(self.algorithmTree.invisibleRootItem().childCount()):
child = self.algorithmTree.invisibleRootItem().child(i)
if isinstance(child, TreeProviderItem):
if child.text(0) > providerItem.text(0):
break

self.algorithmTree.insertTopLevelItem(i, providerItem)
if not provider.isActive():
providerItem.setHidden(True)
self.disabledProviderItems[provider.id()] = providerItem

provider.algorithmsLoaded.connect(self.updateProvider)

def fillTreeUsingProviders(self):
@@ -375,19 +377,17 @@ def fillTreeUsingProviders(self):
else:
providerItem = TreeProviderItem(provider, self.algorithmTree, self)

if not provider.isActive():
providerItem.setHidden(True)
self.disabledProviderItems[provider.id()] = providerItem

# insert non-native providers at end of tree, alphabetically

for i in range(self.algorithmTree.invisibleRootItem().childCount()):
child = self.algorithmTree.invisibleRootItem().child(i)
if isinstance(child, TreeProviderItem):
if child.text(0) > providerItem.text(0):
break

self.algorithmTree.insertTopLevelItem(i + 1, providerItem)
if not provider.isActive():
providerItem.setHidden(True)
self.disabledProviderItems[provider.id()] = providerItem

def addAlgorithmsFromProvider(self, provider, parent):
groups = {}

0 comments on commit d7e1813

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