Skip to content
Permalink
Browse files

Allow automatic naming when duplicating/renaming a layout

and the naming widget is set empty
  • Loading branch information
DelazJ authored and nyalldawson committed Jun 15, 2020
1 parent e9a0c01 commit 5caa007fa68c633383b47fed2c235b0b8f84f053
Showing with 4 additions and 4 deletions.
  1. +2 −2 src/app/layout/qgslayoutdesignerdialog.cpp
  2. +2 −2 src/app/layout/qgslayoutmanagerdialog.cpp
@@ -1880,7 +1880,7 @@ void QgsLayoutDesignerDialog::addItemsFromTemplate()
void QgsLayoutDesignerDialog::duplicate()
{
QString newTitle;
if ( !QgisApp::instance()->uniqueLayoutTitle( this, newTitle, false, masterLayout()->layoutType(), tr( "%1 copy" ).arg( masterLayout()->name() ) ) )
if ( !QgisApp::instance()->uniqueLayoutTitle( this, newTitle, true, masterLayout()->layoutType(), tr( "%1 copy" ).arg( masterLayout()->name() ) ) )
{
return;
}
@@ -1943,7 +1943,7 @@ void QgsLayoutDesignerDialog::renameLayout()
{
QString currentTitle = masterLayout()->name();
QString newTitle;
if ( !QgisApp::instance()->uniqueLayoutTitle( this, newTitle, false, masterLayout()->layoutType(), currentTitle ) )
if ( !QgisApp::instance()->uniqueLayoutTitle( this, newTitle, true, masterLayout()->layoutType(), currentTitle ) )
{
return;
}
@@ -448,7 +448,7 @@ void QgsLayoutManagerDialog::duplicateClicked()
QString currentTitle = currentLayout->name();

QString newTitle;
if ( !QgisApp::instance()->uniqueLayoutTitle( this, newTitle, false, currentLayout->layoutType(), tr( "%1 copy" ).arg( currentTitle ) ) )
if ( !QgisApp::instance()->uniqueLayoutTitle( this, newTitle, true, currentLayout->layoutType(), tr( "%1 copy" ).arg( currentTitle ) ) )
{
return;
}
@@ -488,7 +488,7 @@ void QgsLayoutManagerDialog::renameClicked()

QString currentTitle = currentLayout->name();
QString newTitle;
if ( !QgisApp::instance()->uniqueLayoutTitle( this, newTitle, false, currentLayout->layoutType(), currentTitle ) )
if ( !QgisApp::instance()->uniqueLayoutTitle( this, newTitle, true, currentLayout->layoutType(), currentTitle ) )
{
return;
}

0 comments on commit 5caa007

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