mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Auto-select newly duplicated layers in layer tree
This commit is contained in:
parent
20d9427c26
commit
11fc287b48
@ -9231,6 +9231,7 @@ void QgisApp::duplicateLayers( const QList<QgsMapLayer *> &lyrList )
|
||||
|
||||
freezeCanvases();
|
||||
QgsMapLayer *dupLayer = nullptr;
|
||||
QgsMapLayer *newSelection = nullptr;
|
||||
QString layerDupName, unSppType;
|
||||
QList<QgsMessageBarItem *> msgBars;
|
||||
|
||||
@ -9327,10 +9328,17 @@ void QgisApp::duplicateLayers( const QList<QgsMapLayer *> &lyrList )
|
||||
messageBar()->pushMessage( errMsg,
|
||||
tr( "Cannot copy style to duplicated layer." ),
|
||||
Qgis::Critical, messageTimeout() );
|
||||
|
||||
if ( !newSelection )
|
||||
newSelection = dupLayer;
|
||||
}
|
||||
|
||||
dupLayer = nullptr;
|
||||
|
||||
// auto select first new duplicate layer
|
||||
if ( newSelection )
|
||||
setActiveLayer( newSelection );
|
||||
|
||||
freezeCanvases( false );
|
||||
|
||||
// display errors in message bar after duplication of layers
|
||||
|
Loading…
x
Reference in New Issue
Block a user