Skip to content

Commit d4d122b

Browse files
author
jef
committed
[FEATURE] multi-layer identify
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11572 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 032b743 commit d4d122b

13 files changed

+705
-796
lines changed

python/core/qgsrect.sip

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ class QgsRectangle
6464
//! return true when rectangle contains other rectangle
6565
//! @note added in version 1.1
6666
bool contains( const QgsRectangle& rect ) const;
67+
//! return true when rectangle contains a point
68+
//! @note added in version 1.3
69+
bool contains( const QgsPoint& p ) const;
6770
//! expand the rectangle so that covers both the original rectangle and the given rectangle
6871
void combineExtentWith(QgsRectangle *rect);
6972
//! expand the rectangle so that covers both the original rectangle and the given point

src/app/qgisapp.cpp

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ void QgisApp::createActions()
767767
shortcuts->registerAction( mActionIdentify, tr( "Ctrl+Shift+I", "Click on features to identify them" ) );
768768
mActionIdentify->setStatusTip( tr( "Click on features to identify them" ) );
769769
connect( mActionIdentify, SIGNAL( triggered() ), this, SLOT( identify() ) );
770-
mActionIdentify->setEnabled( false );
770+
mActionIdentify->setEnabled( QSettings().value( "/Map/identifyMode", 0 ).toInt() != 0 );
771771

772772
mActionMeasure = new QAction( getThemeIcon( "mActionMeasure.png" ), tr( "Measure Line " ), this );
773773
shortcuts->registerAction( mActionMeasure, tr( "Ctrl+Shift+M", "Measure a Line" ) );
@@ -5542,7 +5542,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
55425542
if ( !layer )
55435543
{
55445544
mActionSelect->setEnabled( false );
5545-
mActionIdentify->setEnabled( false );
5545+
mActionIdentify->setEnabled( QSettings().value( "/Map/identifyMode", 0 ).toInt() != 0 );
55465546
mActionZoomActualSize->setEnabled( false );
55475547
mActionOpenTable->setEnabled( false );
55485548
mActionToggleEditing->setEnabled( false );
@@ -5785,18 +5785,24 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
57855785
//Enable the Identify tool ( GDAL datasets draw without a provider )
57865786
//but turn off if data provider exists and has no Identify capabilities
57875787
mActionIdentify->setEnabled( true );
5788-
const QgsRasterLayer* vlayer = dynamic_cast<const QgsRasterLayer*>( layer );
5789-
const QgsRasterDataProvider* dprovider = vlayer->dataProvider();
5790-
if ( dprovider )
5788+
5789+
QSettings settings;
5790+
int identifyMode = settings.value( "/Map/identifyMode", 0 ).toInt();
5791+
if ( identifyMode == 0 )
57915792
{
5792-
// does provider allow the identify map tool?
5793-
if ( dprovider->capabilities() & QgsRasterDataProvider::Identify )
5794-
{
5795-
mActionIdentify->setEnabled( TRUE );
5796-
}
5797-
else
5793+
const QgsRasterLayer *rlayer = dynamic_cast<const QgsRasterLayer*>( layer );
5794+
const QgsRasterDataProvider* dprovider = rlayer->dataProvider();
5795+
if ( dprovider )
57985796
{
5799-
mActionIdentify->setEnabled( FALSE );
5797+
// does provider allow the identify map tool?
5798+
if ( dprovider->capabilities() & QgsRasterDataProvider::Identify )
5799+
{
5800+
mActionIdentify->setEnabled( true );
5801+
}
5802+
else
5803+
{
5804+
mActionIdentify->setEnabled( false );
5805+
}
58005806
}
58015807
}
58025808
}

0 commit comments

Comments
 (0)