Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
only consider the crs of layers with geometry for automatically setti…
…ng of project crs and otfr (fixes #10510)
  • Loading branch information
jef-n committed Jun 29, 2014
1 parent 9bbefef commit 0a2948a
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -459,8 +459,8 @@ void QgisApp::validateSrs( QgsCoordinateReferenceSystem &srs )
QString myDefaultProjectionOption = mySettings.value( "/Projections/defaultBehaviour", "prompt" ).toString();
if ( myDefaultProjectionOption == "prompt" )
{
//@note this class is not a descendent of QWidget so we cant pass
//it in the ctor of the layer projection selector
// @note this class is not a descendent of QWidget so we can't pass
// it in the ctor of the layer projection selector

QgsGenericProjectionSelector *mySelector = new QgsGenericProjectionSelector();
mySelector->setMessage( srs.validationHint() ); //shows a generic message, if not specified
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposition.h
Expand Up @@ -214,7 +214,7 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene

/**Sets the snap tolerance to use when automatically snapping items during movement and resizing to guides
* and the edges and centers of other items.
* @param t snap tolerance in pixels
* @param snapTolerance snap tolerance in pixels
* @see alignmentSnapTolerance
* @note Added in QGIS 2.5
*/
Expand Down
9 changes: 7 additions & 2 deletions src/gui/layertree/qgslayertreemapcanvasbridge.cpp
Expand Up @@ -18,7 +18,7 @@
#include "qgslayertree.h"
#include "qgslayertreeutils.h"
#include "qgsmaplayer.h"

#include "qgsvectorlayer.h"
#include "qgsmapcanvas.h"

QgsLayerTreeMapCanvasBridge::QgsLayerTreeMapCanvasBridge( QgsLayerTreeGroup *root, QgsMapCanvas *canvas, QObject* parent )
Expand Down Expand Up @@ -123,7 +123,12 @@ void QgsLayerTreeMapCanvasBridge::setCanvasLayers()
{
foreach ( QgsLayerTreeLayer* layerNode, layerNodes )
{
if ( layerNode->layer() )
if ( layerNode->layer() &&
(
qobject_cast<QgsVectorLayer *>( layerNode->layer() ) == 0 ||
qobject_cast<QgsVectorLayer *>( layerNode->layer() )->geometryType() != QGis::NoGeometry
)
)
{
mCanvas->setDestinationCrs( layerNode->layer()->crs() );
mCanvas->setMapUnits( layerNode->layer()->crs().mapUnits() );
Expand Down
96 changes: 96 additions & 0 deletions src/ui/qgsoptionsbase.ui
Expand Up @@ -4633,5 +4633,101 @@
</hint>
</hints>
</connection>
<connection>
<sender>radUseGlobalProjection</sender>
<signal>toggled(bool)</signal>
<receiver>leLayerGlobalCrs</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>310</x>
<y>285</y>
</hint>
<hint type="destinationlabel">
<x>644</x>
<y>312</y>
</hint>
</hints>
</connection>
<connection>
<sender>radUseGlobalProjection</sender>
<signal>toggled(bool)</signal>
<receiver>pbnSelectProjection</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>345</x>
<y>287</y>
</hint>
<hint type="destinationlabel">
<x>717</x>
<y>303</y>
</hint>
</hints>
</connection>
<connection>
<sender>radUseProjectProjection</sender>
<signal>toggled(bool)</signal>
<receiver>leLayerGlobalCrs</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>310</x>
<y>285</y>
</hint>
<hint type="destinationlabel">
<x>644</x>
<y>312</y>
</hint>
</hints>
</connection>
<connection>
<sender>radUseProjectProjection</sender>
<signal>toggled(bool)</signal>
<receiver>pbnSelectProjection</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>345</x>
<y>287</y>
</hint>
<hint type="destinationlabel">
<x>717</x>
<y>303</y>
</hint>
</hints>
</connection>
<connection>
<sender>radPromptForProjection</sender>
<signal>toggled(bool)</signal>
<receiver>leLayerGlobalCrs</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>310</x>
<y>285</y>
</hint>
<hint type="destinationlabel">
<x>644</x>
<y>312</y>
</hint>
</hints>
</connection>
<connection>
<sender>radPromptForProjection</sender>
<signal>toggled(bool)</signal>
<receiver>pbnSelectProjection</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>345</x>
<y>287</y>
</hint>
<hint type="destinationlabel">
<x>717</x>
<y>303</y>
</hint>
</hints>
</connection>
</connections>
</ui>

0 comments on commit 0a2948a

Please sign in to comment.