Skip to content

Commit

Permalink
[processing] hide SAGA folder option if built-in SAGA is available
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Nov 6, 2015
1 parent edb3cf3 commit 54bdcef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/plugins/processing/algs/saga/SagaAlgorithmProvider.py
Expand Up @@ -37,6 +37,7 @@
import SagaUtils
from processing.tools.system import isWindows, isMac


pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))

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

def initializeSettings(self):
if isWindows() or isMac():
if (isWindows() or isMac()) and SagaUtils.findSagaFolder() is None:
ProcessingConfig.addSetting(Setting("SAGA",
SagaUtils.SAGA_FOLDER, self.tr('SAGA folder'), '',
SagaUtils.SAGA_FOLDER, self.tr('SAGA folder'),
'',
valuetype=Setting.FOLDER))
ProcessingConfig.addSetting(Setting("SAGA",
SagaUtils.SAGA_IMPORT_EXPORT_OPTIMIZATION,
Expand All @@ -74,7 +76,7 @@ def initializeSettings(self):

def unload(self):
AlgorithmProvider.unload(self)
if isWindows() or isMac():
if (isWindows() or isMac()) and SagaUtils.findSagaFolder() is None:
ProcessingConfig.removeSetting(SagaUtils.SAGA_FOLDER)

ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_CONSOLE)
Expand Down

0 comments on commit 54bdcef

Please sign in to comment.