Skip to content
Permalink
Browse files

Merge remote-tracking branch 'origin/master' into hue_saturation

  • Loading branch information
nyalldawson committed Mar 26, 2013
2 parents 4e29436 + 8bf6df2 commit 86a246a0df3bf64dd5674713695f25f89f57d8dd
Showing with 1,187 additions and 748 deletions.
  1. +9 −23 python/core/composer/qgscomposerlegend.sip
  2. +2 −2 python/core/qgsgml.sip
  3. +1 −1 python/plugins/sextante/algs/FieldsCalculator.py
  4. +1 −1 python/plugins/sextante/algs/ftools/Intersection.py
  5. +7 −7 python/plugins/sextante/algs/ftools/MeanCoords.py
  6. +2 −2 python/plugins/sextante/algs/ftools/SumLines.py
  7. +2 −2 python/plugins/sextante/algs/ftools/Union.py
  8. +2 −2 python/plugins/sextante/core/GeoAlgorithm.py
  9. +4 −4 python/plugins/sextante/core/SextanteUtils.py
  10. +4 −4 python/plugins/sextante/gui/BatchInputSelectionPanel.py
  11. +8 −8 python/plugins/sextante/gui/BatchProcessingDialog.py
  12. +2 −2 python/plugins/sextante/gui/SextanteToolbox.py
  13. +5 −5 python/plugins/sextante/gui/TestTools.py
  14. +3 −3 python/plugins/sextante/modeler/ModelerParameterDefinitionDialog.py
  15. +2 −2 python/plugins/sextante/parameters/ParameterRaster.py
  16. +1 −1 python/plugins/sextante/parameters/ParameterTable.py
  17. +1 −1 python/plugins/sextante/parameters/ParameterVector.py
  18. +2 −2 python/plugins/sextante/r/EditRScriptDialog.py
  19. +9 −9 python/plugins/sextante/r/RAlgorithm.py
  20. +2 −2 python/plugins/sextante/saga/SagaAlgorithm.py
  21. +1 −1 python/plugins/sextante/saga/SplitRGBBands.py
  22. +46 −47 python/plugins/sextante/tests/AlgTests.py
  23. +7 −7 python/plugins/sextante/tests/GeoAlgorithmTest.py
  24. +12 −12 python/plugins/sextante/tests/ModelerAlgorithmTest.py
  25. +20 −20 python/plugins/sextante/tests/ParametersTest.py
  26. +5 −6 python/plugins/sextante/tools/help.py
  27. +22 −0 src/app/composer/qgsatlascompositionwidget.cpp
  28. +1 −0 src/app/composer/qgsatlascompositionwidget.h
  29. +5 −5 src/app/composer/qgscomposer.cpp
  30. +98 −20 src/app/composer/qgscomposerlegendwidget.cpp
  31. +13 −0 src/app/composer/qgscomposerlegendwidget.h
  32. +1 −1 src/app/main.cpp
  33. +2 −2 src/app/qgisappinterface.cpp
  34. +1 −1 src/app/qgisappinterface.h
  35. +9 −9 src/app/qgscustomization.cpp
  36. +1 −1 src/app/qgsdiagramproperties.cpp
  37. +1 −1 src/app/qgspluginregistry.cpp
  38. +102 −98 src/app/qtmain_android.cpp
  39. +2 −0 src/core/CMakeLists.txt
  40. +13 −5 src/core/composer/qgsatlascomposition.cpp
  41. +6 −1 src/core/composer/qgsatlascomposition.h
  42. +2 −2 src/core/composer/qgscomposeritem.cpp
  43. +142 −141 src/core/composer/qgscomposerlegend.cpp
  44. +18 −38 src/core/composer/qgscomposerlegend.h
  45. +68 −17 src/core/composer/qgscomposerlegenditem.cpp
  46. +21 −4 src/core/composer/qgscomposerlegenditem.h
  47. +126 −0 src/core/composer/qgscomposerlegendstyle.cpp
  48. +82 −0 src/core/composer/qgscomposerlegendstyle.h
  49. +45 −10 src/core/composer/qgslegendmodel.cpp
  50. +3 −3 src/core/qgsfeaturerequest.cpp
  51. +2 −2 src/core/qgsmaplayer.h
  52. +32 −17 src/core/qgsogcutils.cpp
  53. +73 −73 src/core/qgsogcutils.h
  54. +3 −3 src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
  55. +1 −1 src/core/symbology-ng/qgssymbolv2.cpp
  56. +8 −8 src/gui/qgscomposerview.cpp
  57. +2 −2 src/gui/qgscomposerview.h
  58. +1 −1 src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
  59. +1 −1 src/mapserver/qgswfsserver.h
  60. +2 −2 src/plugins/heatmap/heatmap.cpp
  61. +1 −1 src/plugins/heatmap/heatmap.h
  62. +8 −8 src/providers/mssql/qgsmssqlgeometryparser.cpp
  63. +1 −1 src/providers/mssql/qgsmssqlnewconnection.cpp
  64. +7 −7 src/providers/mssql/qgsmssqlprovider.cpp
  65. +9 −9 src/ui/qgsatlascompositionwidgetbase.ui
  66. +41 −26 src/ui/qgscomposerlegendwidgetbase.ui
  67. +3 −3 tests/src/core/testqgsexpression.cpp
  68. +48 −48 tests/src/core/testqgsogcutils.cpp
@@ -5,6 +5,7 @@ class QgsComposerLegend : QgsComposerItem
{
%TypeHeaderCode
#include <qgscomposerlegend.h>
#include <qgscomposerlegendstyle.h>
%End

public:
@@ -30,33 +31,18 @@ class QgsComposerLegend : QgsComposerItem
void setTitle( const QString& t );
QString title() const;

QFont titleFont() const;
void setTitleFont( const QFont& f );

QFont groupFont() const;
void setGroupFont( const QFont& f );

QFont layerFont() const;
void setLayerFont( const QFont& f );

QFont itemFont() const;
void setItemFont( const QFont& f );
/*
QgsComposerLegendStyle style(QgsComposerLegendStyle::Style s) const;
void setStyle(QgsComposerLegendStyle::Style s, const QgsComposerLegendStyle style);
QFont styleFont( QgsComposerLegendStyle::Style s ) const;
void setStyleFont( QgsComposerLegendStyle::Style s, const QFont& f );
void setStyleMargin( QgsComposerLegendStyle::Style s, double margin );
void setStyleMargin( QgsComposerLegendStyle::Style s, QgsComposerLegendStyle::Side side, double margin );
*/

double boxSpace() const;
void setBoxSpace( double s );

double groupSpace() const;
void setGroupSpace( double s );

double layerSpace() const;
void setLayerSpace( double s );

double symbolSpace() const;
void setSymbolSpace( double s );

double iconLabelSpace() const;
void setIconLabelSpace( double s );

double symbolWidth() const;
void setSymbolWidth( double w );

@@ -1,12 +1,12 @@
class QgsGml: QObject
class QgsGml: QObject
{

%TypeHeaderCode
#include <qgsgml.h>
%End

public:

QgsGml(
const QString& typeName,
const QString& geometryAttribute,
@@ -83,7 +83,7 @@ def processAlgorithm(self, progress):
nElement += 1
inGeom = inFeat.geometry()
outFeat.setGeometry(inGeom)
attrs = inFeat.attributes()
attrs = inFeat.attributes()
attrs.append(QVariant(result))
outFeat.setAttributes(attrs)
writer.addFeature(outFeat)
@@ -66,7 +66,7 @@ def processAlgorithm(self, progress):
intersects = index.intersects( geom.boundingBox() )
for i in intersects:
request = QgsFeatureRequest().setFilterFid(i)
inFeatB = vlayerB.getFeatures(request).next()
inFeatB = vlayerB.getFeatures(request).next()
tmpGeom = QgsGeometry(inFeatB.geometry())
try:
if geom.intersects( tmpGeom ):
@@ -61,7 +61,7 @@ def processAlgorithm(self, progress):
uniqueField = self.getParameterValue(self.UID)

weightIndex = layer.fieldNameIndex(weightField)
uniqueIndex = layer.fieldNameIndex(uniqueField)
uniqueIndex = layer.fieldNameIndex(uniqueField)

fieldList = [QgsField("MEAN_X", QVariant.Double, "", 24, 15),
QgsField("MEAN_Y", QVariant.Double, "", 24, 15),
@@ -74,7 +74,7 @@ def processAlgorithm(self, progress):
current = 0
features = QGisLayers.features(layer)
total = 100.0 / float(len(features))

means = {}
for feat in features:
current += 1
@@ -89,7 +89,7 @@ def processAlgorithm(self, progress):
weight = 1.00
if clazz not in means:
means[clazz] = (0,0,0)

cx,cy, totalweight = means[clazz]
geom = QgsGeometry(feat.geometry())
geom = utils.extractPoints(geom)
@@ -98,13 +98,13 @@ def processAlgorithm(self, progress):
cy += i.y() * weight
totalweight += weight
means[clazz] = (cx, cy, totalweight)

for clazz, values in means.iteritems():
outFeat = QgsFeature()
outFeat = QgsFeature()
cx = values[0] / values[2]
cy = values[1] / values[2]
cy = values[1] / values[2]
meanPoint = QgsPoint(cx, cy)

outFeat.setGeometry(QgsGeometry.fromPoint(meanPoint))
outFeat.setAttributes([QVariant(cx), QVariant(cy), clazz])
writer.addFeature(outFeat)
@@ -70,7 +70,7 @@ def processAlgorithm(self, progress):
lengthFieldName = self.getParameterValue(self.LEN_FIELD)
countFieldName = self.getParameterValue(self.COUNT_FIELD)

polyProvider = polyLayer.dataProvider()
polyProvider = polyLayer.dataProvider()

idxLength, fieldList = utils.findOrCreateField(polyLayer, polyLayer.pendingFields(), lengthFieldName)
idxCount, fieldList = utils.findOrCreateField(polyLayer, fieldList, countFieldName)
@@ -104,7 +104,7 @@ def processAlgorithm(self, progress):
if hasIntersections:
for i in lines:
request = QgsFeatureRequest().setFilterFid(i)
ftLine = lineLayer.getFeatures(request).next()
ftLine = lineLayer.getFeatures(request).next()
tmpGeom = QgsGeometry(ftLine.geometry())
if inGeom.intersects(tmpGeom):
outGeom = inGeom.intersection(tmpGeom)
@@ -87,7 +87,7 @@ def processAlgorithm(self, progress):
for id in intersects:
count += 1
request = QgsFeatureRequest().setFilterFid(id)
inFeatB = vlayerB.getFeatures(request).next()
inFeatB = vlayerB.getFeatures(request).next()
atMapB = inFeatB.attributes()
tmpGeom = QgsGeometry( inFeatB.geometry() )

@@ -173,7 +173,7 @@ def processAlgorithm(self, progress):
else:
for id in intersects:
request = QgsFeatureRequest().setFilterFid(id)
inFeatB = vlayerA.getFeatures(request).next()
inFeatB = vlayerA.getFeatures(request).next()
atMapB = inFeatB.attributes()
tmpGeom = QgsGeometry( inFeatB.geometry() )
try:
@@ -64,7 +64,7 @@ def __init__(self):
self.provider = None

self.defineCharacteristics()

def getCopy(self):
'''returns a new instance of this algorithm, ready to be used for being executed'''
newone = copy.copy(self)
@@ -320,7 +320,7 @@ def getVisibleOutputsCount(self):
if not out.hidden:
i+=1
return i;

def getVisibleParametersCount(self):
'''returns the number of non-hidden parameters'''
i = 0;
@@ -78,12 +78,12 @@ def getTempFilename(ext):

@staticmethod
def getTempFilenameInTempFolder(basename):
'''returns a temporary filename for a given file, putting it into a temp folder but not changing its basename'''
path = SextanteUtils.tempFolder()
'''returns a temporary filename for a given file, putting it into a temp folder but not changing its basename'''
path = SextanteUtils.tempFolder()
tempFolder = os.path.join(path, str(uuid.uuid4()).replace("-",""))
mkdir(tempFolder)
mkdir(tempFolder)
filename = os.path.join(tempFolder, basename)
return filename
return filename

@staticmethod
def getNumExportedLayers():
@@ -49,7 +49,7 @@ def __init__(self, param, row, col, batchDialog, parent = None):
self.horizontalLayout.addWidget(self.pushButton)
self.setLayout(self.horizontalLayout)

def showSelectionDialog(self):
def showSelectionDialog(self):
settings = QtCore.QSettings()
text = str(self.text.text())
if os.path.isdir(text):
@@ -60,10 +60,10 @@ def showSelectionDialog(self):
path = str(settings.value( "/SextanteQGIS/LastInputPath",QtCore.QVariant("")).toString())
else:
path = ""

ret = QtGui.QFileDialog.getOpenFileNames(self, "Open file", path, self.param.getFileFilter())
if ret:
files = list(ret)
if ret:
files = list(ret)
if len(files) == 1:
settings.setValue("/SextanteQGIS/LastInputPath", os.path.dirname(str(files[0])))
self.text.setText(str(files[0]))
@@ -109,16 +109,16 @@ def headerDoubleClicked(self, col):
elif isinstance(widget, FileSelectionPanel):
widgetValue = widget.getValue()
for row in range(1, self.table.rowCount()):
self.table.cellWidget(row, col).setText(widgetValue)
self.table.cellWidget(row, col).setText(widgetValue)
elif isinstance(widget, QtGui.QLineEdit):
widgetValue = widget.text()
for row in range(1, self.table.rowCount()):
self.table.cellWidget(row, col).setText(widgetValue)
self.table.cellWidget(row, col).setText(widgetValue)
elif isinstance(widget, BatchInputSelectionPanel):
widgetValue = widget.getText()
for row in range(1, self.table.rowCount()):
self.table.cellWidget(row, col).setText(widgetValue)

else:
pass

@@ -207,13 +207,13 @@ def loadHTMLResults(self, alg, i):
def cancel(self):
self.algs = None
if self.algEx:
self.algEx.terminate()
self.table.setEnabled(True)
self.algEx.terminate()
self.table.setEnabled(True)
#self.close()

@pyqtSlot()
def finish(self, i):
if not self.stop:
if not self.stop:
if self.load[i]:
SextantePostprocessing.handleAlgorithmResults(self.algs[i], self, False)
i += 1
@@ -230,8 +230,8 @@ def error(self, msg):
QMessageBox.critical(self, "Error", msg)
SextanteLog.addToLog(SextanteLog.LOG_ERROR, msg)
if self.algEx:
self.algEx.terminate()
self.table.setEnabled(True)
self.algEx.terminate()
self.table.setEnabled(True)
#self.close()


@@ -146,9 +146,9 @@ def fillTree(self):
self.fillTreeUsingCategories()
else:
self.fillTreeUsingProviders()
self.algorithmTree.sortItems(0, Qt.AscendingOrder)
self.algorithmTree.sortItems(0, Qt.AscendingOrder)
self.addRecentAlgorithms(False)

def addRecentAlgorithms(self, updating):
showRecent = SextanteConfig.getSetting(SextanteConfig.SHOW_RECENT_ALGORITHMS)
if showRecent:
@@ -42,26 +42,26 @@ def createTest(text):
execcommand = "sextante.runalg("
i = 0
for token in tokens:
if i < alg.getVisibleParametersCount() + 1:
if i < alg.getVisibleParametersCount() + 1:
if os.path.exists(token[1:-1]):
token = os.path.basename(token[1:-1])[:-4] + "()"
token = os.path.basename(token[1:-1])[:-4] + "()"
execcommand += token + ","
else:
execcommand += "None,"
i+=1
s += "\toutputs=" + execcommand[:-1] + ")\n"

i = -1 * len(alg.outputs)
for out in alg.outputs:
for out in alg.outputs:
filename = tokens[i][1:-1]
if (filename == str(None)):
raise Exception("Cannot create unit test for that algorithm execution.\nThe output cannot be a temporary file")
raise Exception("Cannot create unit test for that algorithm execution.\nThe output cannot be a temporary file")
s+="\toutput=outputs['" + out.name + "']\n"
if isinstance(out, (OutputNumber, OutputString)):
s+="self.assertTrue(" + str(out) + ", output)\n"
if isinstance(out, OutputRaster):
dataset = gdal.Open(filename, GA_ReadOnly)
strhash = hash(str(dataset.ReadAsArray(0).tolist()))
strhash = hash(str(dataset.ReadAsArray(0).tolist()))
s+="\tself.assertTrue(os.path.isfile(output))\n"
s+="\tdataset=gdal.Open(output, GA_ReadOnly)\n"
s+="\tstrhash=hash(str(dataset.ReadAsArray(0).tolist()))\n"
@@ -204,9 +204,9 @@ def setupUi(self):
self.fileFolderCombo = QtGui.QComboBox()
self.fileFolderCombo.addItem("File")
self.fileFolderCombo.addItem("Folder")
self.horizontalLayout2.addWidget(self.fileFolderCombo)
self.horizontalLayout2.addWidget(self.fileFolderCombo)
if self.param is not None:
self.fileFolderCombo.setCurrentIndex(1 if self.param.isFolder else 0)
self.fileFolderCombo.setCurrentIndex(1 if self.param.isFolder else 0)

self.buttonBox = QtGui.QDialogButtonBox(self)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
@@ -267,7 +267,7 @@ def okPressed(self):
elif self.paramType == ModelerParameterDefinitionDialog.PARAMETER_EXTENT or isinstance(self.param, ParameterExtent):
self.param = ParameterExtent(name, description)
elif self.paramType == ModelerParameterDefinitionDialog.PARAMETER_FILE or isinstance(self.param, ParameterFile):
self.param = ParameterFile(name, description)
self.param = ParameterFile(name, description)
self.close()

def cancelPressed(self):
@@ -75,12 +75,12 @@ def setValue(self, obj):
self.value = unicode(layer.dataProvider().dataSourceUri())
return True
return os.path.exists(self.value)

def getFileFilter(self):
exts = QGisLayers.getSupportedOutputRasterLayerExtensions()
for i in range(len(exts)):
exts[i] = exts[i].upper() + " files(*." + exts[i].lower() + ")"
return ";;".join(exts)
return ";;".join(exts)

def serialize(self):
return self.__module__.split(".")[-1] + "|" + self.name + "|" + self.description +\
@@ -78,7 +78,7 @@ def getSafeExportedTable(self):
else:
self.exported = self.value
return self.exported

def getFileFilter(self,alg):
exts = ['csv', 'dbf']
for i in range(len(exts)):
@@ -83,7 +83,7 @@ def getSafeExportedLayer(self):
else:
self.exported = self.value
return self.exported

def getFileFilter(self):
exts = QGisLayers.getSupportedOutputVectorLayerExtensions()
for i in range(len(exts)):
@@ -46,7 +46,7 @@ def __init__(self, alg):
self.setupUi()
self.update = False
self.help = None

def setupUi(self):
self.resize(600,400)
self.setWindowTitle("Edit script")
@@ -82,7 +82,7 @@ def setupUi(self):

def editHelp(self):
if self.alg is None:
alg = RAlgorithm(None, unicode(self.text.toPlainText()))
alg = RAlgorithm(None, unicode(self.text.toPlainText()))
else:
alg = self.alg
dlg = HelpEditionDialog(alg)

0 comments on commit 86a246a

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