Skip to content
Permalink
Browse files

[layouts] hide atlas/report items in the window right-click menu

  • Loading branch information
nirvn committed Feb 19, 2018
1 parent 8fd35c3 commit 699567173f0cc57f820de05316432c719f7f9c62
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/app/layout/qgslayoutdesignerdialog.cpp
@@ -793,6 +793,11 @@ QMenu *QgsLayoutDesignerDialog::createPopupMenu()
menu->addAction( panelstitle );
Q_FOREACH ( QAction *a, panels )
{
if ( ( a == mAtlasDock->toggleViewAction() && !dynamic_cast< QgsPrintLayout * >( mMasterLayout ) ) ||
( a == mReportDock->toggleViewAction() && !dynamic_cast< QgsReport * >( mMasterLayout ) ) )
{
a->setVisible( false );
}
menu->addAction( a );
}
menu->addSeparator();
@@ -805,6 +810,11 @@ QMenu *QgsLayoutDesignerDialog::createPopupMenu()
std::sort( toolbars.begin(), toolbars.end(), cmpByText_ );
Q_FOREACH ( QAction *a, toolbars )
{
if ( ( a == mAtlasToolbar->toggleViewAction() && !dynamic_cast< QgsPrintLayout * >( mMasterLayout ) ) ||
( a == mReportToolbar->toggleViewAction() && !dynamic_cast< QgsReport * >( mMasterLayout ) ) )
{
a->setVisible( false );
}
menu->addAction( a );
}
}
@@ -851,6 +861,7 @@ void QgsLayoutDesignerDialog::setMasterLayout( QgsMasterLayoutInterface *layout
delete mMenuAtlas;
mMenuAtlas = nullptr;
mAtlasToolbar->hide();
mToolbarMenu->removeAction( mAtlasToolbar->toggleViewAction() );
}

if ( dynamic_cast< QgsReport * >( layout ) )
@@ -867,6 +878,7 @@ void QgsLayoutDesignerDialog::setMasterLayout( QgsMasterLayoutInterface *layout
delete mMenuReport;
mMenuReport = nullptr;
mReportToolbar->hide();
mToolbarMenu->removeAction( mReportToolbar->toggleViewAction() );
}

updateActionNames( mMasterLayout->layoutType() );

0 comments on commit 6995671

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