when renaming or duplicating project, prefill original project name

This commit is contained in:
Jan Caha 2025-05-15 22:10:01 +02:00 committed by Nyall Dawson
parent a1bec1c0f9
commit 02a9fca1eb

View File

@ -824,7 +824,7 @@ void QgsPostgresDataItemGuiProvider::exportProjectToFile( QgsPGProjectItem *proj
void QgsPostgresDataItemGuiProvider::renameProject( QgsPGProjectItem *projectItem, QgsDataItemGuiContext context )
{
QgsNewNameDialog dlg( tr( "project “%1”" ).arg( projectItem->name() ) );
QgsNewNameDialog dlg( tr( "project “%1”" ).arg( projectItem->name() ), projectItem->name() );
dlg.setWindowTitle( tr( "Rename Project" ) );
if ( dlg.exec() != QDialog::Accepted || dlg.name() == projectItem->name() )
return;
@ -893,7 +893,7 @@ void QgsPostgresDataItemGuiProvider::deleteProject( QgsPGProjectItem *projectIte
void QgsPostgresDataItemGuiProvider::duplicateProject( QgsPGProjectItem *projectItem, QgsDataItemGuiContext context )
{
QgsNewNameDialog dlg( tr( "Project “%1”" ).arg( projectItem->name() ) );
QgsNewNameDialog dlg( tr( "Project “%1”" ).arg( projectItem->name() ), projectItem->name() );
dlg.setWindowTitle( tr( "Duplicate Project" ) );
if ( dlg.exec() != QDialog::Accepted || dlg.name() == projectItem->name() )
return;