Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FEATURE] multi-layer identify
git-svn-id: http://svn.osgeo.org/qgis/trunk@11572 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 5, 2009
1 parent ddd64be commit 92bb2a3
Show file tree
Hide file tree
Showing 13 changed files with 705 additions and 796 deletions.
3 changes: 3 additions & 0 deletions python/core/qgsrect.sip
Expand Up @@ -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
Expand Down
30 changes: 18 additions & 12 deletions src/app/qgisapp.cpp
Expand Up @@ -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" ) );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
}
}
}
}
Expand Down

0 comments on commit 92bb2a3

Please sign in to comment.