Skip to content

Commit 54bdcef

Browse files
committedNov 6, 2015
[processing] hide SAGA folder option if built-in SAGA is available
1 parent edb3cf3 commit 54bdcef

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎python/plugins/processing/algs/saga/SagaAlgorithmProvider.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import SagaUtils
3838
from processing.tools.system import isWindows, isMac
3939

40+
4041
pluginPath = os.path.normpath(os.path.join(
4142
os.path.split(os.path.dirname(__file__))[0], os.pardir))
4243

@@ -55,9 +56,10 @@ def __init__(self):
5556
self.activate = True
5657

5758
def initializeSettings(self):
58-
if isWindows() or isMac():
59+
if (isWindows() or isMac()) and SagaUtils.findSagaFolder() is None:
5960
ProcessingConfig.addSetting(Setting("SAGA",
60-
SagaUtils.SAGA_FOLDER, self.tr('SAGA folder'), '',
61+
SagaUtils.SAGA_FOLDER, self.tr('SAGA folder'),
62+
'',
6163
valuetype=Setting.FOLDER))
6264
ProcessingConfig.addSetting(Setting("SAGA",
6365
SagaUtils.SAGA_IMPORT_EXPORT_OPTIMIZATION,
@@ -74,7 +76,7 @@ def initializeSettings(self):
7476

7577
def unload(self):
7678
AlgorithmProvider.unload(self)
77-
if isWindows() or isMac():
79+
if (isWindows() or isMac()) and SagaUtils.findSagaFolder() is None:
7880
ProcessingConfig.removeSetting(SagaUtils.SAGA_FOLDER)
7981

8082
ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_CONSOLE)

0 commit comments

Comments
 (0)
Please sign in to comment.