Skip to content
Permalink
Browse files

[FEATURE] multi-layer identify

git-svn-id: http://svn.osgeo.org/qgis/trunk@11572 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Sep 5, 2009
1 parent ddd64be commit 92bb2a31174160a66e1c0cb6cc76c937ff162d9e
@@ -64,6 +64,9 @@ class QgsRectangle
//! return true when rectangle contains other rectangle
//! @note added in version 1.1
bool contains( const QgsRectangle& rect ) const;
//! return true when rectangle contains a point
//! @note added in version 1.3
bool contains( const QgsPoint& p ) const;
//! expand the rectangle so that covers both the original rectangle and the given rectangle
void combineExtentWith(QgsRectangle *rect);
//! expand the rectangle so that covers both the original rectangle and the given point
@@ -767,7 +767,7 @@ void QgisApp::createActions()
shortcuts->registerAction( mActionIdentify, tr( "Ctrl+Shift+I", "Click on features to identify them" ) );
mActionIdentify->setStatusTip( tr( "Click on features to identify them" ) );
connect( mActionIdentify, SIGNAL( triggered() ), this, SLOT( identify() ) );
mActionIdentify->setEnabled( false );
mActionIdentify->setEnabled( QSettings().value( "/Map/identifyMode", 0 ).toInt() != 0 );

mActionMeasure = new QAction( getThemeIcon( "mActionMeasure.png" ), tr( "Measure Line " ), this );
shortcuts->registerAction( mActionMeasure, tr( "Ctrl+Shift+M", "Measure a Line" ) );
@@ -5542,7 +5542,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
if ( !layer )
{
mActionSelect->setEnabled( false );
mActionIdentify->setEnabled( false );
mActionIdentify->setEnabled( QSettings().value( "/Map/identifyMode", 0 ).toInt() != 0 );
mActionZoomActualSize->setEnabled( false );
mActionOpenTable->setEnabled( false );
mActionToggleEditing->setEnabled( false );
@@ -5785,18 +5785,24 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
//Enable the Identify tool ( GDAL datasets draw without a provider )
//but turn off if data provider exists and has no Identify capabilities
mActionIdentify->setEnabled( true );
const QgsRasterLayer* vlayer = dynamic_cast<const QgsRasterLayer*>( layer );
const QgsRasterDataProvider* dprovider = vlayer->dataProvider();
if ( dprovider )

QSettings settings;
int identifyMode = settings.value( "/Map/identifyMode", 0 ).toInt();
if ( identifyMode == 0 )
{
// does provider allow the identify map tool?
if ( dprovider->capabilities() & QgsRasterDataProvider::Identify )
{
mActionIdentify->setEnabled( TRUE );
}
else
const QgsRasterLayer *rlayer = dynamic_cast<const QgsRasterLayer*>( layer );
const QgsRasterDataProvider* dprovider = rlayer->dataProvider();
if ( dprovider )
{
mActionIdentify->setEnabled( FALSE );
// does provider allow the identify map tool?
if ( dprovider->capabilities() & QgsRasterDataProvider::Identify )
{
mActionIdentify->setEnabled( true );
}
else
{
mActionIdentify->setEnabled( false );
}
}
}
}

0 comments on commit 92bb2a3

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