Skip to content
Permalink
Browse files

use new signal/slot connetion and minor fixes: followup 3d7a460

  • Loading branch information
slarosa committed Mar 19, 2018
1 parent f6f7027 commit 53244d17b44709e1cc197f68647303e95436231d
Showing with 19 additions and 9 deletions.
  1. +2 −3 src/app/qgisapp.cpp
  2. +13 −5 src/app/qgsapplayertreeviewmenuprovider.cpp
  3. +4 −1 src/ui/qgisapp.ui
@@ -1913,8 +1913,8 @@ void QgisApp::createActions()
connect( mActionPasteAsNewMemoryVector, &QAction::triggered, this, [ = ] { pasteAsNewMemoryVector(); } );
connect( mActionCopyStyle, &QAction::triggered, this, [ = ] { copyStyle(); } );
connect( mActionPasteStyle, &QAction::triggered, this, [ = ] { pasteStyle(); } );
connect( mActionCopyLayer, &QAction::triggered, this, [ = ] { copyLayer(); } );
connect( mActionPasteLayer, &QAction::triggered, this, [ = ] { pasteLayer(); } );
connect( mActionCopyLayer, &QAction::triggered, this, &QgisApp::copyLayer );
connect( mActionPasteLayer, &QAction::triggered, this, &QgisApp::pasteLayer );
connect( mActionAddFeature, &QAction::triggered, this, &QgisApp::addFeature );
connect( mActionCircularStringCurvePoint, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mCircularStringCurvePoint ); } );
connect( mActionCircularStringRadius, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mCircularStringRadius ); } );
@@ -8603,7 +8603,6 @@ void QgisApp::pasteLayer()

if ( !loaded )
{
QgsDebugMsg( errorMessage );
messageBar()->pushMessage( tr( "Error pasting layer" ), errorMessage, Qgis::Warning );
}
}
@@ -56,11 +56,15 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
{
// global menu
menu->addAction( actions->actionAddGroup( menu ) );
menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionEditPaste.svg" ) ),
tr( "Paste Layer/Group" ), QgisApp::instance(), SLOT( pasteLayer() ) );

menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionExpandTree.svg" ) ), tr( "&Expand All" ), mView, SLOT( expandAll() ) );
menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionCollapseTree.svg" ) ), tr( "&Collapse All" ), mView, SLOT( collapseAll() ) );
menu->addSeparator();
if ( QgisApp::instance()->clipboard()->hasFormat( QGSCLIPBOARD_MAPLAYER_MIME ) )
{
QAction *actionPasteLayerOrGroup = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionEditPaste.svg" ) ), tr( "Paste Layer/Group" ), menu );
connect( actionPasteLayerOrGroup, &QAction::triggered, QgisApp::instance(), &QgisApp::pasteLayer );
menu->addAction( actionPasteLayerOrGroup );
}

// TODO: update drawing order
}
@@ -97,7 +101,9 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
menu->addAction( tr( "Copy Group" ), QgisApp::instance(), SLOT( copyLayer() ) );
if ( QgisApp::instance()->clipboard()->hasFormat( QGSCLIPBOARD_MAPLAYER_MIME ) )
{
menu->addAction( tr( "Paste Layer/Group" ), QgisApp::instance(), SLOT( pasteLayer() ) );
QAction *actionPasteLayerOrGroup = new QAction( tr( "Paste Layer/Group" ), menu );
connect( actionPasteLayerOrGroup, &QAction::triggered, QgisApp::instance(), &QgisApp::pasteLayer );
menu->addAction( actionPasteLayerOrGroup );
}

menu->addAction( tr( "Save As Layer Definition File…" ), QgisApp::instance(), SLOT( saveAsLayerDefinition() ) );
@@ -215,7 +221,9 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
}

menu->addSeparator();
menu->addAction( tr( "Copy Layer" ), QgisApp::instance(), SLOT( copyLayer() ) );
QAction *actionCopyLayer = new QAction( tr( "Copy Layer" ), menu );
connect( actionCopyLayer, &QAction::triggered, QgisApp::instance(), &QgisApp::copyLayer );
menu->addAction( actionCopyLayer );

if ( vlayer )
{
@@ -3001,7 +3001,10 @@ Acts on currently active editable layer</string>
<normaloff>:/images/themes/default/mActionEditPaste.svg</normaloff>:/images/themes/default/mActionEditPaste.svg</iconset>
</property>
<property name="text">
<string>Paste Layer</string>
<string>Paste Layer/Group</string>
</property>
<property name="toolTip">
<string>Paste Layer/Group</string>
</property>
</action>
</widget>

0 comments on commit 53244d1

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