Added Save As TAS project file overwrite warning dialog for Qt GUI.

This commit is contained in:
mjbudd77 2022-01-04 20:55:03 -05:00
parent 734ec96269
commit 975632856f
1 changed files with 18 additions and 0 deletions

View File

@ -1684,6 +1684,24 @@ bool TasEditorWindow::saveProjectAs(bool save_compact)
{
return false;
}
QFileInfo fi( filename );
if ( fi.exists() )
{
int ret;
std::string msg;
msg = "Pre-existing TAS project file will be overwritten:\n\n" +
fi.fileName().toStdString() + "\n\nReplace file?";
ret = QMessageBox::warning( this, QObject::tr("Overwrite Warning"),
QString::fromStdString(msg), QMessageBox::Yes | QMessageBox::No, QMessageBox::No );
if ( ret == QMessageBox::No )
{
return false;
}
}
//qDebug() << "selected file path : " << filename.toUtf8();
project.renameProject( filename.toStdString().c_str(), true);