diff --git a/src/app/layout/qgslayoutdesignerdialog.cpp b/src/app/layout/qgslayoutdesignerdialog.cpp index 381f0d6fc3dd..a7945a00d18b 100644 --- a/src/app/layout/qgslayoutdesignerdialog.cpp +++ b/src/app/layout/qgslayoutdesignerdialog.cpp @@ -373,6 +373,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla mHorizontalRuler->setContextMenu( rulerMenu ); mVerticalRuler->setContextMenu( rulerMenu ); + connect( mLayoutMenu, &QMenu::aboutToShow, this, &QgsLayoutDesignerDialog::layoutMenuAboutToShow ); connect( mActionRefreshView, &QAction::triggered, this, &QgsLayoutDesignerDialog::refreshLayout ); connect( mActionSaveProject, &QAction::triggered, this, &QgsLayoutDesignerDialog::saveProject ); connect( mActionNewLayout, &QAction::triggered, this, &QgsLayoutDesignerDialog::newLayout ); @@ -1924,9 +1925,10 @@ void QgsLayoutDesignerDialog::addPages() void QgsLayoutDesignerDialog::showPageProperties() { - QgsLayoutItemPage *page = mLayout->pageCollection()->page( 0 ); + if ( !mLayout ) + return; - if ( page ) + if ( QgsLayoutItemPage *page = mLayout->pageCollection()->page( mView->currentPage() ) ) { showItemOptions( page, true ); } @@ -5138,3 +5140,15 @@ void QgsLayoutDesignerDialog::onItemDestroyed( QObject *item ) delete mItemPropertiesStack->takeMainPanel(); } } + +void QgsLayoutDesignerDialog::layoutMenuAboutToShow() +{ + if ( mLayout && mLayout->pageCollection()->pageCount() > 1 ) + { + mActionPageProperties->setText( tr( "Page %1 Properties…" ).arg( mView->currentPage() + 1 ) ); + } + else + { + mActionPageProperties->setText( tr( "Page Properties…" ) ); + } +} diff --git a/src/app/layout/qgslayoutdesignerdialog.h b/src/app/layout/qgslayoutdesignerdialog.h index 97325944062d..ec6a7715ec11 100644 --- a/src/app/layout/qgslayoutdesignerdialog.h +++ b/src/app/layout/qgslayoutdesignerdialog.h @@ -427,6 +427,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, public Ui::QgsLayoutDesignerB void onMapPreviewRefreshed(); void onItemAdded( QgsLayoutItem *item ); void onItemDestroyed( QObject *item ); + void layoutMenuAboutToShow(); private: