19 changes: 16 additions & 3 deletions src/gui/qgsprojectionselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,11 +710,18 @@ void QgsProjectionSelector::loadCrsList( QSet<QString> *crsFilter )
void QgsProjectionSelector::on_lstCoordinateSystems_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem * )
{
QgsDebugMsg( "Entered." );

if ( !current )
{
QgsDebugMsg( "no current item" );
return;
}

lstCoordinateSystems->scrollToItem( current );

// If the item has children, it's not an end node in the tree, and
// hence is just a grouping thingy, not an actual CRS.
if ( current && current->childCount() == 0 )
if ( current->childCount() == 0 )
{
// Found a real CRS
emit sridSelected( QString::number( selectedCrsId() ) );
Expand All @@ -736,8 +743,7 @@ void QgsProjectionSelector::on_lstCoordinateSystems_currentItemChanged( QTreeWid
else
{
// Not an CRS - remove the highlight so the user doesn't get too confused
if ( current )
current->setSelected( false );
current->setSelected( false );
teProjection->setText( "" );
lstRecent->clearSelection();
}
Expand All @@ -746,6 +752,13 @@ void QgsProjectionSelector::on_lstCoordinateSystems_currentItemChanged( QTreeWid
void QgsProjectionSelector::on_lstRecent_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem * )
{
QgsDebugMsg( "Entered." );

if ( !current )
{
QgsDebugMsg( "no current item" );
return;
}

lstRecent->scrollToItem( current );

QList<QTreeWidgetItem*> nodes = lstCoordinateSystems->findItems( current->text( QGIS_CRS_ID_COLUMN ), Qt::MatchExactly | Qt::MatchRecursive, QGIS_CRS_ID_COLUMN );
Expand Down
19 changes: 17 additions & 2 deletions src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget( QgsVecto
connect( btnGraduatedDelete, SIGNAL( clicked() ), this, SLOT( deleteCurrentClass() ) );
connect( btnGraduatedAdd, SIGNAL( clicked() ), this, SLOT( addClass() ) );



// initialize from previously set renderer
updateUiFromRenderer();

connect( spinGraduatedClasses, SIGNAL( valueChanged( int ) ) , this, SLOT( classifyGraduated() ) );
connect( cboGraduatedMode, SIGNAL( currentIndexChanged( int ) ) , this, SLOT( classifyGraduated() ) );
connect( cboGraduatedColorRamp, SIGNAL( currentIndexChanged( int ) ) , this, SLOT( reapplyColorRamp() ) );

// menus for data-defined rotation/size
QMenu* advMenu = new QMenu;

Expand Down Expand Up @@ -145,6 +147,7 @@ void QgsGraduatedSymbolRendererV2Widget::populateColumns()
void QgsGraduatedSymbolRendererV2Widget::graduatedColumnChanged()
{
mRenderer->setClassAttribute( cboGraduatedColumn->currentText() );
classifyGraduated();
}


Expand Down Expand Up @@ -194,13 +197,25 @@ void QgsGraduatedSymbolRendererV2Widget::classifyGraduated()
populateRanges();
}

void QgsGraduatedSymbolRendererV2Widget::reapplyColorRamp()
{
QgsVectorColorRampV2* ramp = cboGraduatedColorRamp->currentColorRamp();
if ( ramp == NULL )
return;

mRenderer->updateColorRamp( ramp );
refreshSymbolView();
}

void QgsGraduatedSymbolRendererV2Widget::changeGraduatedSymbol()
{
QgsSymbolV2SelectorDialog dlg( mGraduatedSymbol, mStyle, mLayer, this );
if ( !dlg.exec() )
return;

updateGraduatedSymbolIcon();
mRenderer->updateSymbols( mGraduatedSymbol );
refreshSymbolView();
}

void QgsGraduatedSymbolRendererV2Widget::updateGraduatedSymbolIcon()
Expand Down
1 change: 1 addition & 0 deletions src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class GUI_EXPORT QgsGraduatedSymbolRendererV2Widget : public QgsRendererV2Widget
void changeGraduatedSymbol();
void graduatedColumnChanged();
void classifyGraduated();
void reapplyColorRamp();
void rangesDoubleClicked( const QModelIndex & idx );
void rangesClicked( const QModelIndex & idx );
void changeCurrentValue( QStandardItem * item );
Expand Down
1 change: 1 addition & 0 deletions src/mapserver/qgsconfigparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ QgsConfigParser::QgsConfigParser()
, mOutputUnits( QgsMapRenderer::Millimeters )
{
setDefaultLegendSettings();
mSelectionColor = QColor( 255, 255, 0 ); //yellow opaque is default selection color
}

QgsConfigParser::~QgsConfigParser()
Expand Down
6 changes: 6 additions & 0 deletions src/mapserver/qgsconfigparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define QGSCONFIGPARSER_H

#include "qgsmaprenderer.h"
#include <QColor>
#include <QDomDocument>
#include <QFont>
#include <QList>
Expand Down Expand Up @@ -113,6 +114,9 @@ class QgsConfigParser
/**Appends service metadata to the capabilities document*/
virtual void serviceCapabilities( QDomElement& parentElement, QDomDocument& doc ) const;

QColor selectionColor() const { return mSelectionColor; }
void setSelectionColor( const QColor& c ) { mSelectionColor = c; }

protected:
/**Parser to forward not resolved requests (e.g. SLD parser based on user request might have a fallback parser with admin configuration)*/
QgsConfigParser* mFallbackParser;
Expand Down Expand Up @@ -150,6 +154,8 @@ class QgsConfigParser
double mLegendSymbolWidth;
double mLegendSymbolHeight;

QColor mSelectionColor;

/**Transforms layer extent to epsg 4326 and appends ExGeographicBoundingBox and BoundingBox elements to the layer element*/
void appendLayerBoundingBoxes( QDomElement& layerElem, QDomDocument& doc, const QgsRectangle& layerExtent, const QgsCoordinateReferenceSystem& layerCRS ) const;

Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgsprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ void QgsProjectParser::setSelectionColor()
}
}

QgsRenderer::setSelectionColor( QColor( red, green, blue, alpha ) );
mSelectionColor = QColor( red, green, blue, alpha );
}

const QgsCoordinateReferenceSystem& QgsProjectParser::projectCRS() const
Expand Down
6 changes: 3 additions & 3 deletions src/mapserver/qgsprojectparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ class QgsProjectParser: public QgsConfigParser
/**Converts a (possibly relative) path to absolute*/
QString convertToAbsolutePath( const QString& file ) const;

/**Sets global selection color from the project or yellow if not defined in project*/
void setSelectionColor();

/**Returns mapcanvas output CRS from project file*/
const QgsCoordinateReferenceSystem& projectCRS() const;

/**Returns bbox of layer in project CRS (or empty rectangle in case of error)*/
QgsRectangle layerBoundingBoxInProjectCRS( const QDomElement& layerElem ) const;

/**Reads selection color from project and sets it to QgsConfigParser::mSelectionColor*/
void setSelectionColor();
};

#endif // QGSPROJECTPARSER_H
3 changes: 3 additions & 0 deletions src/mapserver/qgswmsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,9 @@ QImage* QgsWMSServer::initializeRendering( QStringList& layersList, QStringList&
QgsDebugMsg( QString( "Number of layers to be rendered. %1" ).arg( layerIdList.count() ) );
#endif
mMapRenderer->setLayerSet( layerIdList );

//set selection color prior to each render to avoid problems with caching (selection color is a global property of QgsRenderer)
QgsRenderer::setSelectionColor( mConfigParser->selectionColor() );
return theImage;
}

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grass/modules/default.qgc
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@
<grass name="r.cost.vect"/>
<grass name="r.drain"/>
<grass name="r.shaded.relief"/>
<grass name="r.slope.aspect.slope"/>
<grass name="r.slope.aspect.aspect"/>
<grass name="r.slope"/>
<grass name="r.aspect"/>
<grass name="r.param.scale"/>
<grass name="r.texture"/>
<grass name="r.texture.bis"/>
Expand Down
Binary file added src/plugins/grass/modules/r.aspect.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/plugins/grass/modules/r.aspect.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/plugins/grass/modules/r.aspect.qgm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Create aspect raster from DEM (digital elevation model)" module="r.slope.aspect">
<option key="elevation" />
<option key="aspect" />
</qgisgrassmodule>
Binary file added src/plugins/grass/modules/r.slope.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/plugins/grass/modules/r.slope.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/plugins/grass/modules/r.slope.qgm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Create slope raster from DEM (digital elevation model)" module="r.slope.aspect">
<option key="elevation" />
<option key="slope" />
</qgisgrassmodule>
7 changes: 4 additions & 3 deletions src/plugins/grass/modules/v.random.qgm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Create random 2D/3D vector points" module="v.random">
<option key="n" answer="1" hidden="no"/>
<option key="zmin" answer="0.0" hidden="no"/>
<option key="zmax" answer="0.0" hidden="no"/>
<option key="n" />
<option key="column" advanced="yes"/>
<option key="zmin" advanced="yes"/>
<option key="zmax" advanced="yes"/>
<option key="output" />
</qgisgrassmodule>
5 changes: 5 additions & 0 deletions src/plugins/grass/modules/v.surf.bspline.qgm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<qgisgrassmodule label="Bicubic or bilinear spline interpolation with Tykhonov regularization" module="v.surf.bspline">
<option key="input"/>
<option key="sparse" />
<option key="sie" advanced="yes"/>
<option key="sin" advanced="yes"/>
<option key="method" advanced="yes"/>
<option key="lambda_i" advanced="yes"/>
<option key="output" advanced="yes"/>
<option key="raster" />
<flag key="c" />
</qgisgrassmodule>
3 changes: 2 additions & 1 deletion src/plugins/grass/modules/v.surf.idw.qgm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<qgisgrassmodule label="Inverse distance squared weighting raster interpolation based on vector points" module="v.surf.idw">
<option key="input" layeroption="layer" typemask="point,line" id="input" />
<field key="column" layer="input" type="integer,double" label="Attribute field (interpolated values)" />
<option key="npoints" />
<option key="npoints" advanced="yes" />
<option key="power" advanced="yes" />
<option key="output" />
</qgisgrassmodule>
22 changes: 18 additions & 4 deletions src/plugins/grass/modules/v.surf.rst.qgm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,22 @@
<option key="tension" />
<!--option key="smooth" /-->
<option key="elev" />
<option key="dmax" answer="5" hidden="yes" />
<option key="dmin" answer="2" hidden="yes" />
<!--option key="segmax" answer="1000" hidden="yes" /-->
<!--option key="npmin" answer="5000" hidden="yes" /-->
<option key="dmin" advanced="yes" />
<option key="dmax" advanced="yes" />
<option key="where" advanced="yes" />
<option key="slope" advanced="yes" />
<option key="aspect" advanced="yes" />
<option key="pcurv" advanced="yes" />
<option key="tcurv" advanced="yes" />
<option key="mcurv" advanced="yes" />
<option key="devi" advanced="yes" />
<option key="cvdev" advanced="yes" />
<option key="treefile" advanced="yes" />
<option key="overfile" advanced="yes" />
<option key="scolumn" advanced="yes" />
<option key="segmax" hidden="yes" />
<option key="npmin" hidden="yes" />
<option key="zmult" hidden="yes" />
<option key="theta" hidden="yes" />
<option key="scalex" hidden="yes" />
</qgisgrassmodule>
10 changes: 10 additions & 0 deletions src/providers/wms/qgswmsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ QgsWmsProvider::QgsWmsProvider( QString const &uri )
, mErrors( 0 )
, mUserName( QString::null )
, mPassword( QString::null )
, mFeatureCount( 0 )
{
// URL may contain username/password information for a WMS
// requiring authentication. In this case the URL is prefixed
Expand Down Expand Up @@ -162,6 +163,10 @@ void QgsWmsProvider::parseUri( QString uri )
}
qSort( mResolutions );
}
else if ( item.startsWith( "featureCount=" ) )
{
mFeatureCount = item.mid( 13 ).toInt();
}
else if ( item.startsWith( "url=" ) )
{
// strip the authentication information from the front of the uri
Expand Down Expand Up @@ -2954,6 +2959,11 @@ QStringList QgsWmsProvider::identifyAs( const QgsPoint& point, QString format )
setQueryItem( requestUrl, "X", QString::number( point.x() ) );
setQueryItem( requestUrl, "Y", QString::number( point.y() ) );

if( mFeatureCount > 0 )
{
setQueryItem( requestUrl, "FEATURE_COUNT", QString::number( mFeatureCount ) );
}

// X,Y in WMS 1.1.1; I,J in WMS 1.3.0
// requestUrl += QString( "&I=%1&J=%2" ).arg( point.x() ).arg( point.y() );

Expand Down
3 changes: 3 additions & 0 deletions src/providers/wms/qgswmsprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,9 @@ class QgsWmsProvider : public QgsRasterDataProvider
int mTileHeight;
QVector<double> mResolutions;

//! FEATURE_COUNT for GetFeatureInfo
int mFeatureCount;

//! whether to use hrefs from GetCapabilities (default) or
// the given base urls for GetMap and GetFeatureInfo
bool mIgnoreGetMapUrl;
Expand Down
12 changes: 8 additions & 4 deletions src/providers/wms/qgswmssourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl, bool ma

mTileWidth->setValidator( new QIntValidator( 0, 9999, this ) );
mTileHeight->setValidator( new QIntValidator( 0, 9999, this ) );
mFeatureCount->setValidator( new QIntValidator( 0, 9999, this ) );

mImageFormatGroup = new QButtonGroup;

Expand Down Expand Up @@ -470,6 +471,13 @@ void QgsWMSSourceSelect::addClicked()
.arg( item->data( Qt::UserRole + 6 ).toStringList().join( ";" ) );
}

if ( mFeatureCount->text().toInt() > 0 )
{
if( !connArgs.isEmpty() )
connArgs += ",";
connArgs += QString( "featureCount=%1" ).arg( mFeatureCount->text().toInt() );
}

if ( !connArgs.isEmpty() )
{
if ( connInfo.startsWith( "username=" ) || connInfo.startsWith( "ignoreUrl=" ) )
Expand All @@ -483,10 +491,6 @@ void QgsWMSSourceSelect::addClicked()
}
QgsDebugMsg( "crs = " + crs );

// TODO: do it without QgisApp
//QgisApp::instance()->addRasterLayer( connInfo,
// leLayerName->text().isEmpty() ? layers.join( "/" ) : leLayerName->text(),
// "wms", layers, styles, format, crs );
emit addRasterLayer( connInfo,
leLayerName->text().isEmpty() ? layers.join( "/" ) : leLayerName->text(),
"wms", layers, styles, format, crs );
Expand Down
24 changes: 19 additions & 5 deletions src/ui/qgswmssourceselectbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="leLayerName"/>
</item>
<item row="2" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="labelCoordRefSys">
<property name="text">
<string>Coordinate Reference System</string>
Expand All @@ -230,7 +230,7 @@
</property>
</widget>
</item>
<item row="2" column="2">
<item row="3" column="2">
<widget class="QPushButton" name="btnChangeSpatialRefSys">
<property name="enabled">
<bool>false</bool>
Expand All @@ -241,20 +241,34 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="mTileWidth">
</widget>
<widget class="QLineEdit" name="mTileWidth"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Tile size</string>
</property>
<property name="buddy">
<cstring>mTileWidth</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="mTileHeight">
<widget class="QLineEdit" name="mTileHeight"/>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Feature limit for GetFeatureInfo</string>
</property>
<property name="buddy">
<cstring>mFeatureCount</cstring>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="mFeatureCount"/>
</item>
</layout>
</widget>
</item>
Expand Down