6 changes: 2 additions & 4 deletions python/plugins/sextante/core/SextanteConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
from PyQt4 import QtGui

class SextanteConfig():

USE_CATEGORIES = "USE_CATEGORIES"

TABLE_LIKE_PARAM_PANEL = "TABLE_LIKE_PARAM_PANEL"
OUTPUT_FOLDER = "OUTPUT_FOLDER"
RASTER_STYLE = "RASTER_STYLE"
Expand Down Expand Up @@ -61,8 +60,7 @@ def initialize():
SextanteConfig.addSetting(Setting("General", SextanteConfig.USE_SELECTED, "Use only selected features", True))
SextanteConfig.addSetting(Setting("General", SextanteConfig.TABLE_LIKE_PARAM_PANEL, "Show table-like parameter panels", False))
SextanteConfig.addSetting(Setting("General", SextanteConfig.USE_FILENAME_AS_LAYER_NAME, "Use filename as layer name", True))
SextanteConfig.addSetting(Setting("General", SextanteConfig.SHOW_RECENT_ALGORITHMS, "Show recently executed algorithms", True))
SextanteConfig.addSetting(Setting("General", SextanteConfig.USE_CATEGORIES, "Use categories to classify algorithms, instead of providers", True))
SextanteConfig.addSetting(Setting("General", SextanteConfig.SHOW_RECENT_ALGORITHMS, "Show recently executed algorithms", True))
SextanteConfig.addSetting(Setting("General", SextanteConfig.OUTPUT_FOLDER, "Output folder", SextanteUtils.tempFolder()))
SextanteConfig.addSetting(Setting("General", SextanteConfig.SHOW_CRS_DEF, "Show layer CRS definition in selection boxes", True))
SextanteConfig.addSetting(Setting("General", SextanteConfig.WARN_UNMATCHING_CRS, "Warn before executing if layer CRS's do not match", True))
Expand Down
7 changes: 0 additions & 7 deletions python/plugins/sextante/gui/ParametersPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
from sextante.parameters.ParameterCrs import ParameterCrs
from sextante.parameters.ParameterString import ParameterString

from sextante.outputs.OutputHTML import OutputHTML
from sextante.outputs.OutputRaster import OutputRaster
from sextante.outputs.OutputTable import OutputTable
from sextante.outputs.OutputVector import OutputVector
Expand Down Expand Up @@ -168,12 +167,6 @@ def initGUI(self):
self.verticalLayout.addStretch(1000)
self.setLayout(self.verticalLayout)

#=======================================================================
# for param in self.alg.parameters:
# if isinstance(param, ParameterExtent):
# self.widgets[param.name].useMinCovering()
#=======================================================================

def showAdvancedParametersClicked(self):
self.showAdvanced = not self.showAdvanced
if self.showAdvanced:
Expand Down
33 changes: 31 additions & 2 deletions python/plugins/sextante/gui/SextanteToolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
***************************************************************************
"""


__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
Expand Down Expand Up @@ -46,12 +47,28 @@
_fromUtf8 = lambda s: s

class SextanteToolbox(QDockWidget, Ui_SextanteToolbox):

USE_CATEGORIES = "/SextanteQGIS/UseCategories"


def __init__(self, iface):
QDockWidget.__init__(self, None)
self.setupUi(self)
self.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)

self.iface=iface

self.modeComboBox.clear()
self.modeComboBox.addItems(['Simplified interface', 'Advanced interface'])
settings = QSettings()
if not settings.contains(self.USE_CATEGORIES):
settings.setValue(self.USE_CATEGORIES, True)
useCategories = settings.value(self.USE_CATEGORIES).toBool()
if useCategories:
self.modeComboBox.setCurrentIndex(0)
else:
self.modeComboBox.setCurrentIndex(1)
self.modeComboBox.currentIndexChanged.connect(self.modeHasChanged)

self.externalAppsButton.clicked.connect(self.configureProviders)
self.searchBox.textChanged.connect(self.fillTree)
Expand All @@ -62,6 +79,16 @@ def __init__(self, iface):
self.searchBox.setPlaceholderText(self.tr("Search..."))

self.fillTree()

def modeHasChanged(self):
idx = self.modeComboBox.currentIndex()
settings = QSettings()
if idx == 0: #simplified
settings.setValue(self.USE_CATEGORIES, True)
else:
settings.setValue(self.USE_CATEGORIES, False)

self.fillTree()

def algsListHasChanged(self):
self.fillTree()
Expand Down Expand Up @@ -145,7 +172,8 @@ def executeAlgorithm(self):
action.execute()

def fillTree(self):
useCategories = SextanteConfig.getSetting(SextanteConfig.USE_CATEGORIES)
settings = QSettings()
useCategories = settings.value(self.USE_CATEGORIES).toBool()
if useCategories:
self.fillTreeUsingCategories()
else:
Expand Down Expand Up @@ -334,7 +362,8 @@ def fillTreeUsingProviders(self):
class TreeAlgorithmItem(QTreeWidgetItem):

def __init__(self, alg):
useCategories = SextanteConfig.getSetting(SextanteConfig.USE_CATEGORIES)
settings = QSettings()
useCategories = settings.value(SextanteToolbox.USE_CATEGORIES)
QTreeWidgetItem.__init__(self)
self.alg = alg
icon = alg.getIcon()
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/sextante/modeler/ModelerAlgorithmProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ModelerAlgorithmProvider(AlgorithmProvider):

def __init__(self):
AlgorithmProvider.__init__(self)
self.actions = [CreateNewModelAction()]
#self.actions = [CreateNewModelAction()]
self.contextMenuActions = [EditModelAction(), DeleteModelAction(), SaveAsPythonScriptAction()]

def initializeSettings(self):
Expand All @@ -56,7 +56,7 @@ def modelsFolder(self):
return ModelerUtils.modelsFolder()

def getDescription(self):
return "Modeler"
return "Models"

def getName(self):
return "model"
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/sextante/r/RAlgorithmProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RAlgorithmProvider(AlgorithmProvider):
def __init__(self):
AlgorithmProvider.__init__(self)
self.activate = False
self.actions.append(CreateNewRScriptAction())
#self.actions.append(CreateNewRScriptAction())
self.contextMenuActions = [EditRScriptAction(), DeleteRScriptAction()]

def initializeSettings(self):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/sextante/script/ScriptAlgorithmProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ScriptAlgorithmProvider(AlgorithmProvider):

def __init__(self):
AlgorithmProvider.__init__(self)
self.actions.append(CreateNewScriptAction())
#self.actions.append(CreateNewScriptAction())
self.contextMenuActions = [EditScriptAction(), DeleteScriptAction()]

def initializeSettings(self):
Expand Down
11 changes: 7 additions & 4 deletions python/plugins/sextante/ui/SextanteToolbox.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>225</width>
<height>444</height>
<width>289</width>
<height>438</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -24,8 +24,8 @@
<item>
<widget class="QPushButton" name="externalAppsButton">
<property name="text">
<string>Click here to configure
additional algorithm providers</string>
<string>Click here to learn more
about SEXTANTE</string>
</property>
</widget>
</item>
Expand All @@ -51,6 +51,9 @@ additional algorithm providers</string>
</column>
</widget>
</item>
<item>
<widget class="QComboBox" name="modeComboBox"/>
</item>
</layout>
</widget>
</widget>
Expand Down