Skip to content
Permalink
Browse files

fixed bug with unfound recent algs

improved model algorithms edition

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@258 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf
volayaf committed Jun 22, 2012
1 parent 1742c6e commit 180e6923fa17787794551ca65cab284b2366ea64
@@ -3,7 +3,6 @@
from PyQt4 import QtCore, QtGui
from sextante.core.Sextante import Sextante
from sextante.gui.ParametersDialog import ParametersDialog
import copy
from sextante.gui.BatchProcessingDialog import BatchProcessingDialog
from sextante.gui.EditRenderingStylesDialog import EditRenderingStylesDialog
from sextante.core.SextanteLog import SextanteLog
@@ -143,6 +142,9 @@ def fillTree(self):
for providerName in Sextante.algs.keys():
groups = {}
provider = Sextante.algs[providerName]
name = "ACTIVATE_" + providerName.upper().replace(" ", "_")
if not SextanteConfig.getSetting(name):
continue
algs = provider.values()
#add algorithms
for alg in algs:
@@ -158,19 +160,17 @@ def fillTree(self):
algItem = TreeAlgorithmItem(alg)
groupItem.addChild(algItem)

#add actions only if there are algorithms in this provider
if len(groups)>0:
actions = Sextante.actions[providerName]
for action in actions:
if text =="" or text.lower() in action.name.lower():
if action.group in groups:
groupItem = groups[action.group]
else:
groupItem = QtGui.QTreeWidgetItem()
groupItem.setText(0,action.group)
groups[action.group] = groupItem
algItem = TreeActionItem(action)
groupItem.addChild(algItem)
actions = Sextante.actions[providerName]
for action in actions:
if text =="" or text.lower() in action.name.lower():
if action.group in groups:
groupItem = groups[action.group]
else:
groupItem = QtGui.QTreeWidgetItem()
groupItem.setText(0,action.group)
groups[action.group] = groupItem
algItem = TreeActionItem(action)
groupItem.addChild(algItem)

if len(groups)>0:
providerItem = QtGui.QTreeWidgetItem()
@@ -191,15 +191,18 @@ def fillTree(self):
if showRecent:
recent = SextanteLog.getRecentAlgorithms()
if len(recent) != 0:
found = False
recentItem = QtGui.QTreeWidgetItem()
recentItem.setText(0,"Recently used algorithms")
for algname in recent:
alg = Sextante.getAlgorithm(algname)
algItem = TreeAlgorithmItem(alg)
recentItem.addChild(algItem)
self.algorithmTree.insertTopLevelItem(0, recentItem)
recentItem.setExpanded(True)

if alg is not None:
algItem = TreeAlgorithmItem(alg)
recentItem.addChild(algItem)
found = True
if found:
self.algorithmTree.insertTopLevelItem(0, recentItem)
recentItem.setExpanded(True)



@@ -2,6 +2,11 @@
import os
class ToolboxAction(object):

def __init__(self):
#this should be true if the action should be shown even if there are no algorithms
#in the provider (for instance, when it is deactivated
self.showAlways = False

def setData(self,toolbox):
self.toolbox = toolbox

@@ -383,6 +383,12 @@ def setPreviousValues(self):
else:
pass

for out in self.alg.outputs:
if not out.hidden:
value = self.model.algOutputs[self.algIndex][out.name]
if value is not None:
widget = self.valueItems[out.name].setText(str(value))

#TODO


0 comments on commit 180e692

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