mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Always enable OTB settings modification
This commit is contained in:
parent
02cd0f0002
commit
716b17d216
@ -86,16 +86,14 @@ class OTBAlgorithmProvider(AlgorithmProvider):
|
||||
|
||||
def initializeSettings(self):
|
||||
AlgorithmProvider.initializeSettings(self)
|
||||
if OTBUtils.findOtbPath() is None:
|
||||
ProcessingConfig.addSetting(Setting(self.getDescription(),
|
||||
OTBUtils.OTB_FOLDER,
|
||||
self.tr("OTB command line tools folder"), OTBUtils.otbPath(),
|
||||
valuetype=Setting.FOLDER))
|
||||
if OTBUtils.findOtbLibPath() is None:
|
||||
ProcessingConfig.addSetting(Setting(self.getDescription(),
|
||||
OTBUtils.OTB_LIB_FOLDER,
|
||||
self.tr("OTB applications folder"), OTBUtils.otbLibPath(),
|
||||
valuetype=Setting.FOLDER))
|
||||
ProcessingConfig.addSetting(Setting(self.getDescription(),
|
||||
OTBUtils.OTB_FOLDER,
|
||||
self.tr("OTB command line tools folder"), OTBUtils.findOtbPath(),
|
||||
valuetype=Setting.FOLDER))
|
||||
ProcessingConfig.addSetting(Setting(self.getDescription(),
|
||||
OTBUtils.OTB_LIB_FOLDER,
|
||||
self.tr("OTB applications folder"), OTBUtils.findOtbLibPath(),
|
||||
valuetype=Setting.FOLDER))
|
||||
ProcessingConfig.addSetting(Setting(self.getDescription(),
|
||||
OTBUtils.OTB_SRTM_FOLDER,
|
||||
self.tr("SRTM tiles folder"), OTBUtils.otbSRTMPath(),
|
||||
|
@ -49,7 +49,7 @@ OTB_GEOID_FILE = "OTB_GEOID_FILE"
|
||||
|
||||
|
||||
def findOtbPath():
|
||||
folder = None
|
||||
folder = ""
|
||||
#try to configure the path automatically
|
||||
if isMac():
|
||||
testfolder = os.path.join(unicode(QgsApplication.prefixPath()), "bin")
|
||||
@ -72,14 +72,14 @@ def findOtbPath():
|
||||
|
||||
|
||||
def otbPath():
|
||||
folder = findOtbPath()
|
||||
folder = ProcessingConfig.getSetting(OTB_FOLDER)
|
||||
if folder is None:
|
||||
folder = ProcessingConfig.getSetting(OTB_FOLDER)
|
||||
folder = ""
|
||||
return folder
|
||||
|
||||
|
||||
def findOtbLibPath():
|
||||
folder = None
|
||||
folder = ""
|
||||
#try to configure the path automatically
|
||||
if isMac():
|
||||
testfolder = os.path.join(unicode(QgsApplication.prefixPath()), "lib/otb/applications")
|
||||
@ -101,9 +101,9 @@ def findOtbLibPath():
|
||||
|
||||
|
||||
def otbLibPath():
|
||||
folder = findOtbLibPath()
|
||||
folder = ProcessingConfig.getSetting(OTB_LIB_FOLDER)
|
||||
if folder is None:
|
||||
folder = ProcessingConfig.getSetting(OTB_LIB_FOLDER)
|
||||
folder = ""
|
||||
return folder
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user