Skip to content
Permalink
Browse files

[processing] renmed setting group from ProcessingQGIS to Processing

  • Loading branch information
volaya committed Sep 24, 2013
1 parent 1ad2334 commit 2b61f793f9c871871b6476dd1d94e56d4c924ca9
@@ -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
@@ -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:
@@ -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())
@@ -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())
@@ -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)
@@ -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())
@@ -42,7 +42,7 @@

class ProcessingToolbox(QDockWidget, Ui_ProcessingToolbox):

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

def __init__(self):
QDockWidget.__init__(self, None)
@@ -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)
@@ -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"),
@@ -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))
@@ -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)
@@ -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

0 comments on commit 2b61f79

Please sign in to comment.
You can’t perform that action at this time.