mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-11 00:04:27 -04:00
layer removal action depends on selected layers and not the current layer
git-svn-id: http://svn.osgeo.org/qgis/trunk@14447 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
030f658ccd
commit
5291238ded
@ -2058,6 +2058,8 @@ void QgisApp::setupConnections()
|
||||
// connect legend signals
|
||||
connect( mMapLegend, SIGNAL( currentLayerChanged( QgsMapLayer * ) ),
|
||||
this, SLOT( activateDeactivateLayerRelatedActions( QgsMapLayer * ) ) );
|
||||
connect( mMapLegend, SIGNAL( itemSelectionChanged() ),
|
||||
this, SLOT( legendLayerSelectionChanged() ) );
|
||||
connect( mMapLegend, SIGNAL( zOrderChanged() ),
|
||||
this, SLOT( markDirty() ) );
|
||||
|
||||
@ -5837,10 +5839,13 @@ void QgisApp::selectionChanged( QgsMapLayer *layer )
|
||||
activateDeactivateLayerRelatedActions( layer );
|
||||
}
|
||||
|
||||
void QgisApp::legendLayerSelectionChanged( void )
|
||||
{
|
||||
mActionRemoveLayer->setEnabled( mMapLegend && mMapLegend->selectedLayers().size() > 0 );
|
||||
}
|
||||
|
||||
void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
|
||||
{
|
||||
mActionRemoveLayer->setEnabled( mMapLegend && mMapLegend->selectedItems().size() > 0 );
|
||||
|
||||
if( !layer )
|
||||
{
|
||||
mActionSelect->setEnabled( false );
|
||||
|
@ -436,6 +436,9 @@ class QgisApp : public QMainWindow
|
||||
//! update default action of toolbutton
|
||||
void toolButtonActionTriggered( QAction * );
|
||||
|
||||
//! layer selection changed
|
||||
void legendLayerSelectionChanged( void );
|
||||
|
||||
protected:
|
||||
|
||||
//! Handle state changes (WindowTitleChange)
|
||||
|
Loading…
x
Reference in New Issue
Block a user