Skip to content

Commit

Permalink
Allow automatic naming when duplicating/renaming a layout
Browse files Browse the repository at this point in the history
and the naming widget is set empty
  • Loading branch information
DelazJ authored and nyalldawson committed Jun 15, 2020
1 parent e9a0c01 commit 5caa007
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/layout/qgslayoutmanagerdialog.cpp
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 5caa007

Please sign in to comment.