Skip to content

Commit

Permalink
Fixed problem with duplicated recent algorithms tree.
Browse files Browse the repository at this point in the history
Also fixed  blocking typo in modeler code, introduced in last commit, and two minor changes in saga
  • Loading branch information
volaya committed Apr 1, 2013
1 parent a0e9f89 commit 4a560bb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
14 changes: 8 additions & 6 deletions python/plugins/sextante/gui/SextanteToolbox.py
Expand Up @@ -151,13 +151,16 @@ def fillTree(self):

def addRecentAlgorithms(self, updating):
showRecent = SextanteConfig.getSetting(SextanteConfig.SHOW_RECENT_ALGORITHMS)
if showRecent:
first = self.algorithmTree.topLevelItem(0)
if updating:
self.algorithmTree.removeItemWidget(first, 0)
if showRecent:
recent = SextanteLog.getRecentAlgorithms()
if len(recent) != 0:
found = False
if updating:
recentItem = self.algorithmTree.topLevelItem(0)
treeWidget = recentItem.treeWidget()
treeWidget.takeTopLevelItem(treeWidget.indexOfTopLevelItem(recentItem))
#self.algorithmTree.removeItemWidget(first, 0)

recentItem = QTreeWidgetItem()
recentItem.setText(0, self.tr("Recently used algorithms"))
for algname in recent:
Expand All @@ -166,13 +169,12 @@ def addRecentAlgorithms(self, updating):
algItem = TreeAlgorithmItem(alg)
recentItem.addChild(algItem)
found = True
if found:
if found:
self.algorithmTree.insertTopLevelItem(0, recentItem)
recentItem.setExpanded(True)

self.algorithmTree.setWordWrap(True)


def fillTreeUsingCategories(self):
providersToExclude = ["model", "script"]
self.algorithmTree.clear()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/sextante/modeler/ModelerAlgorithm.py
Expand Up @@ -59,7 +59,7 @@ def getCopy(self):
newone = ModelerAlgorithm()
newone.openModel(self.descriptionFile)
newone.provider = self.provider
newone.deactivated = self.deactivate
newone.deactivated = self.deactivated
return newone

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/sextante/saga/SagaAlgorithmProvider.py
Expand Up @@ -98,7 +98,7 @@ def getPostProcessingErrorMessage(self, wrongLayers):
html += ("<p>This algorithm requires SAGA to be run. A test to check if SAGA is correctly installed "
"and configured in your system has been performed, with the following result:</p><ul><i>")
if msg is None:
html += "Saga seems to be correctly installed and configured</li></ul>"
html += "SAGA seems to be correctly installed and configured</li></ul>"
else:
html += msg + "</i></li></ul>"
html += '<p><a href= "http://docs.qgis.org/html/en/docs/user_manual/sextante/3rdParty.html">Click here</a> to know more about how to install and configure SAGA to be used with SEXTANTE</p>'
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/sextante/saga/SagaUtils.py
Expand Up @@ -142,4 +142,4 @@ def checkSagaIsInstalled(ignoreRegistrySettings=False):
s = traceback.format_exc()
return "Error while checking SAGA installation. SAGA might not be correctly configured.\n" + s;

settings.setValue("/SextanteQGIS/SagaInstalled", True)
settings.setValue(SAGA_INSTALLED, True)

0 comments on commit 4a560bb

Please sign in to comment.