Skip to content
Permalink
Browse files

Changed itemorder in menu to match the changes in #6665

  • Loading branch information
MieWinstrup authored and nyalldawson committed Apr 5, 2018
1 parent 40abe14 commit b57a154b4d53e7ee067cb0958094fe8395427302
Showing with 10 additions and 4 deletions.
  1. +10 −4 src/app/qgsapplayertreeviewmenuprovider.cpp
@@ -102,6 +102,11 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()

menu->addAction( actions->actionUncheckAndAllChildren( menu ) );

if ( !( mView->selectedNodes( true ).count() == 1 && idx.row() == 0 ) )
{
menu->addAction( actions->actionMoveToTop( menu ) );
}

menu->addSeparator();

if ( mView->selectedNodes( true ).count() >= 2 )
@@ -119,8 +124,6 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
connect( actionSaveAsDefinitionGroup, &QAction::triggered, QgisApp::instance(), &QgisApp::saveAsLayerDefinition );
menuExportGroup->addAction( actionSaveAsDefinitionGroup );

if ( !( mView->selectedNodes( true ).count() == 1 && idx.row() == 0 ) )
menu->addAction( actions->actionMoveToTop( menu ) );
menu->addMenu( menuExportGroup );
}
else if ( QgsLayerTree::isLayer( node ) )
@@ -169,6 +172,11 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
if ( node->parent() != mView->layerTreeModel()->rootGroup() )
menu->addAction( actions->actionMakeTopLevel( menu ) );

if ( !( mView->selectedNodes( true ).count() == 1 && idx.row() == 0 ) )
{
menu->addAction( actions->actionMoveToTop( menu ) );
}

QAction *checkAll = actions->actionCheckAndAllParents( menu );
if ( checkAll )
menu->addAction( checkAll );
@@ -296,8 +304,6 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
QgisApp *app = QgisApp::instance();
menuStyleManager->addAction( tr( "Copy Style" ), app, SLOT( copyStyle() ) );

if ( !( mView->selectedNodes( true ).count() == 1 && idx.row() == 0 ) )
menu->addAction( actions->actionMoveToTop( menu ) );
if ( app->clipboard()->hasFormat( QGSCLIPBOARD_STYLE_MIME ) )
{
menuStyleManager->addAction( tr( "Paste Style" ), app, SLOT( pasteStyle() ) );

0 comments on commit b57a154

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