Skip to content
Permalink
Browse files

Auto-select newly duplicated layers in layer tree

  • Loading branch information
nyalldawson committed Mar 19, 2018
1 parent 20d9427 commit 11fc287b4850c6da5cf71b6a6695fbd44b522046
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/app/qgisapp.cpp
@@ -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

1 comment on commit 11fc287

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn commented on 11fc287 Mar 19, 2018

Ahh, nice.

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