[processing] do not collapse tree when updating models or scripts

This commit is contained in:
volaya 2015-10-06 15:49:28 +02:00
parent 484f94c38f
commit 19eca9a84b
2 changed files with 7 additions and 2 deletions

View File

@ -144,7 +144,6 @@ class ProcessingPlugin:
dlg = ModelerDialog() dlg = ModelerDialog()
dlg.exec_() dlg.exec_()
if dlg.update: if dlg.update:
Processing.updateAlgsList()
self.toolbox.updateProvider('model') self.toolbox.updateProvider('model')
def openResults(self): def openResults(self):

View File

@ -52,6 +52,8 @@ class ProcessingToolbox(BASE, WIDGET):
USE_CATEGORIES = '/Processing/UseSimplifiedInterface' USE_CATEGORIES = '/Processing/UseSimplifiedInterface'
updateAlgList = True
def __init__(self): def __init__(self):
super(ProcessingToolbox, self).__init__(None) super(ProcessingToolbox, self).__init__(None)
self.setupUi(self) self.setupUi(self)
@ -118,11 +120,14 @@ class ProcessingToolbox(BASE, WIDGET):
self.fillTree() self.fillTree()
def algsListHasChanged(self): def algsListHasChanged(self):
self.fillTree() if self.updateAlgList:
self.fillTree()
def updateProvider(self, providerName, updateAlgsList=True): def updateProvider(self, providerName, updateAlgsList=True):
if updateAlgsList: if updateAlgsList:
self.updateAlgList = False
Processing.updateAlgsList() Processing.updateAlgsList()
self.updateAlgList = True
for i in xrange(self.algorithmTree.invisibleRootItem().childCount()): for i in xrange(self.algorithmTree.invisibleRootItem().childCount()):
child = self.algorithmTree.invisibleRootItem().child(i) child = self.algorithmTree.invisibleRootItem().child(i)
if isinstance(child, TreeProviderItem): if isinstance(child, TreeProviderItem):
@ -133,6 +138,7 @@ class ProcessingToolbox(BASE, WIDGET):
for i in xrange(child.childCount()): for i in xrange(child.childCount()):
child.child(i).sortChildren(0, Qt.AscendingOrder) child.child(i).sortChildren(0, Qt.AscendingOrder)
break break
self.addRecentAlgorithms(True)
def showPopupMenu(self, point): def showPopupMenu(self, point):
item = self.algorithmTree.itemAt(point) item = self.algorithmTree.itemAt(point)