File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2058,6 +2058,8 @@ void QgisApp::setupConnections()
2058
2058
// connect legend signals
2059
2059
connect ( mMapLegend , SIGNAL ( currentLayerChanged ( QgsMapLayer * ) ),
2060
2060
this , SLOT ( activateDeactivateLayerRelatedActions ( QgsMapLayer * ) ) );
2061
+ connect ( mMapLegend , SIGNAL ( itemSelectionChanged () ),
2062
+ this , SLOT ( legendLayerSelectionChanged () ) );
2061
2063
connect ( mMapLegend , SIGNAL ( zOrderChanged () ),
2062
2064
this , SLOT ( markDirty () ) );
2063
2065
@@ -5837,10 +5839,13 @@ void QgisApp::selectionChanged( QgsMapLayer *layer )
5837
5839
activateDeactivateLayerRelatedActions ( layer );
5838
5840
}
5839
5841
5840
- void QgisApp::activateDeactivateLayerRelatedActions ( QgsMapLayer* layer )
5842
+ void QgisApp::legendLayerSelectionChanged ( void )
5841
5843
{
5842
- mActionRemoveLayer ->setEnabled ( mMapLegend && mMapLegend ->selectedItems ().size () > 0 );
5844
+ mActionRemoveLayer ->setEnabled ( mMapLegend && mMapLegend ->selectedLayers ().size () > 0 );
5845
+ }
5843
5846
5847
+ void QgisApp::activateDeactivateLayerRelatedActions ( QgsMapLayer* layer )
5848
+ {
5844
5849
if ( !layer )
5845
5850
{
5846
5851
mActionSelect ->setEnabled ( false );
Original file line number Diff line number Diff line change @@ -436,6 +436,9 @@ class QgisApp : public QMainWindow
436
436
// ! update default action of toolbutton
437
437
void toolButtonActionTriggered ( QAction * );
438
438
439
+ // ! layer selection changed
440
+ void legendLayerSelectionChanged ( void );
441
+
439
442
protected:
440
443
441
444
// ! Handle state changes (WindowTitleChange)
You can’t perform that action at this time.
0 commit comments