Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] renmed setting group from ProcessingQGIS to Processing
  • Loading branch information
volaya committed Sep 24, 2013
1 parent 1ad2334 commit 2b61f79
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/core/VectorWriter.py
Expand Up @@ -47,7 +47,7 @@ def __init__(self, fileName, encoding, fields, geometryType, crs, options=None):

if encoding is None:
settings = QSettings()
encoding = settings.value("/ProcessingQGIS/encoding", "System")
encoding = settings.value("/Processing/encoding", "System")

if self.fileName.startswith(self.MEMORY_LAYER_PREFIX):
self.isMemory = True
Expand Down
8 changes: 4 additions & 4 deletions python/plugins/processing/gui/BatchInputSelectionPanel.py
Expand Up @@ -57,19 +57,19 @@ def showSelectionDialog(self):
path = text
elif os.path.isdir(os.path.dirname(text)):
path = os.path.dirname(text)
elif settings.contains("/ProcessingQGIS/LastInputPath"):
path = unicode(settings.value( "/ProcessingQGIS/LastInputPath"))
elif settings.contains("/Processing/LastInputPath"):
path = unicode(settings.value( "/Processing/LastInputPath"))
else:
path = ""

ret = QtGui.QFileDialog.getOpenFileNames(self, "Open file", path, self.param.getFileFilter())
if ret:
files = list(ret)
if len(files) == 1:
settings.setValue("/ProcessingQGIS/LastInputPath", os.path.dirname(unicode(files[0])))
settings.setValue("/Processing/LastInputPath", os.path.dirname(unicode(files[0])))
self.text.setText(str(files[0]))
else:
settings.setValue("/ProcessingQGIS/LastInputPath", os.path.dirname(unicode(files[0])))
settings.setValue("/Processing/LastInputPath", os.path.dirname(unicode(files[0])))
if isinstance(self.param, ParameterMultipleInput):
self.text.setText(";".join(unicode(f) for f in files))
else:
Expand Down
8 changes: 4 additions & 4 deletions python/plugins/processing/gui/FileSelectionPanel.py
Expand Up @@ -52,21 +52,21 @@ def showSelectionDialog(self):
path = text
elif os.path.isdir( os.path.dirname(text) ):
path = os.path.dirname(text)
elif settings.contains("/ProcessingQGIS/LastInputPath"):
path = settings.value( "/ProcessingQGIS/LastInputPath")
elif settings.contains("/Processing/LastInputPath"):
path = settings.value( "/Processing/LastInputPath")
else:
path = ""

if self.isFolder:
folder = QtGui.QFileDialog.getExistingDirectory(self, "Select folder", path)
if folder:
self.text.setText(str(folder))
settings.setValue("/ProcessingQGIS/LastInputPath", os.path.dirname(unicode(folder)))
settings.setValue("/Processing/LastInputPath", os.path.dirname(unicode(folder)))
else:
filenames = QtGui.QFileDialog.getOpenFileNames(self, "Open file", path, "*.*")
if filenames:
self.text.setText(u";".join(filenames))
settings.setValue("/ProcessingQGIS/LastInputPath", os.path.dirname(unicode(filenames[0])))
settings.setValue("/Processing/LastInputPath", os.path.dirname(unicode(filenames[0])))

def getValue(self):
s = unicode(self.text.text())
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/gui/InputLayerSelectorPanel.py
Expand Up @@ -52,16 +52,16 @@ def showSelectionDialog(self):
path = text
elif os.path.isdir( os.path.dirname(text) ):
path = os.path.dirname(text)
elif settings.contains("/ProcessingQGIS/LastInputPath"):
path = unicode(settings.value( "/ProcessingQGIS/LastInputPath"))
elif settings.contains("/Processing/LastInputPath"):
path = unicode(settings.value( "/Processing/LastInputPath"))
else:
path = ""

filename = QtGui.QFileDialog.getOpenFileName(self, "All files", path, "*.*")
if filename:
self.text.addItem(filename, filename)
self.text.setCurrentIndex(self.text.count() - 1)
settings.setValue("/ProcessingQGIS/LastInputPath", os.path.dirname(unicode(filename)))
settings.setValue("/Processing/LastInputPath", os.path.dirname(unicode(filename)))

def getValue(self):
return self.text.itemData(self.text.currentIndex())
10 changes: 5 additions & 5 deletions python/plugins/processing/gui/OutputSelectionPanel.py
Expand Up @@ -77,11 +77,11 @@ def saveToMemory(self):
def saveToFile(self):
filefilter = self.output.getFileFilter(self.alg)
settings = QSettings()
if settings.contains("/ProcessingQGIS/LastOutputPath"):
path = settings.value( "/ProcessingQGIS/LastOutputPath")
if settings.contains("/Processing/LastOutputPath"):
path = settings.value( "/Processing/LastOutputPath")
else:
path = ProcessingConfig.getSetting(ProcessingConfig.OUTPUT_FOLDER)
lastEncoding = settings.value("/ProcessingQGIS/encoding", "System")
lastEncoding = settings.value("/Processing/encoding", "System")
fileDialog = QgsEncodingFileDialog(self, "Save file", path, filefilter, lastEncoding)
fileDialog.setFileMode(QFileDialog.AnyFile)
fileDialog.setAcceptMode(QFileDialog.AcceptSave)
Expand All @@ -97,8 +97,8 @@ def saveToFile(self):
if ext:
filename = filename + ext.group(1)
self.text.setText(filename)
settings.setValue("/ProcessingQGIS/LastOutputPath", os.path.dirname(filename))
settings.setValue("/ProcessingQGIS/encoding", encoding)
settings.setValue("/Processing/LastOutputPath", os.path.dirname(filename))
settings.setValue("/Processing/encoding", encoding)

def getValue(self):
filename = unicode(self.text.text())
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/gui/ProcessingToolbox.py
Expand Up @@ -42,7 +42,7 @@

class ProcessingToolbox(QDockWidget, Ui_ProcessingToolbox):

USE_CATEGORIES = "/ProcessingQGIS/UseCategories"
USE_CATEGORIES = "/Processing/UseSimplifiedInterface"

def __init__(self):
QDockWidget.__init__(self, None)
Expand All @@ -53,7 +53,7 @@ def __init__(self):
self.modeComboBox.addItems(['Simplified interface', 'Advanced interface'])
settings = QSettings()
if not settings.contains(self.USE_CATEGORIES):
settings.setValue(self.USE_CATEGORIES, True)
settings.setValue(self.USE_CATEGORIES, False)
useCategories = settings.value(self.USE_CATEGORIES, type = bool)
if useCategories:
self.modeComboBox.setCurrentIndex(0)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/ScriptEditorDialog.py
Expand Up @@ -123,7 +123,7 @@ def saveScript(self, saveAs):
filterName = self.tr("Python scripts (*.py)")
elif self.algType == self.SCRIPT_R:
scriptDir = RUtils.RScriptsFolder()
filterName = self.tr("SEXTANTE R script (*.rsx)")
filterName = self.tr("Processing R script (*.rsx)")

self.filename = unicode(QFileDialog.getSaveFileName(self,
self.tr("Save script"),
Expand Down
4 changes: 1 addition & 3 deletions python/plugins/processing/modeler/ModelerDialog.py
Expand Up @@ -45,16 +45,14 @@

class ModelerDialog(QDialog, Ui_DlgModeler):

USE_CATEGORIES = "/ProcessingQGIS/UseCategories"
USE_CATEGORIES = "/Processing/UseSimplifiedInterface"

def __init__(self, alg=None):
QDialog.__init__(self)

self.hasChanged = False
self.setupUi(self)

#self.setWindowFlags(self.windowFlags() | Qt.WindowSystemMenuHint |
# Qt.WindowMinMaxButtonsHint)
self.tabWidget.setCurrentIndex(0)
self.scene = ModelerScene(self)
self.scene.setSceneRect(QRectF(0, 0, 4000, 4000))
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/outputs/OutputTable.py
Expand Up @@ -67,6 +67,6 @@ def getTableWriter(self, fields):

if self.encoding is None:
settings = QSettings()
self.encoding = settings.value("/ProcessingQGIS/encoding", "System")
self.encoding = settings.value("/Processing/encoding", "System")

return TableWriter(self.value, self.encoding, fields)
2 changes: 1 addition & 1 deletion python/plugins/processing/outputs/OutputVector.py
Expand Up @@ -80,7 +80,7 @@ def getVectorWriter(self, fields, geomType, crs, options=None):

if self.encoding is None:
settings = QSettings()
self.encoding = settings.value("/ProcessingQGIS/encoding", "System")
self.encoding = settings.value("/Processing/encoding", "System")

w = VectorWriter(self.value, self.encoding, fields, geomType, crs, options)
self.memoryLayer = w.memLayer
Expand Down

0 comments on commit 2b61f79

Please sign in to comment.