Qt/MappingWindow: Make message boxes modal

This commit is contained in:
spycrab 2019-03-03 16:19:50 +01:00
parent 103cb430f4
commit 1ba810901d
1 changed files with 3 additions and 0 deletions

View File

@ -161,6 +161,7 @@ void MappingWindow::OnDeleteProfilePressed()
{ {
QMessageBox error(this); QMessageBox error(this);
error.setIcon(QMessageBox::Critical); error.setIcon(QMessageBox::Critical);
error.setWindowModality(Qt::WindowModal);
error.setWindowTitle(tr("Error")); error.setWindowTitle(tr("Error"));
error.setText(tr("The profile '%1' does not exist").arg(profile_name)); error.setText(tr("The profile '%1' does not exist").arg(profile_name));
error.exec(); error.exec();
@ -170,6 +171,7 @@ void MappingWindow::OnDeleteProfilePressed()
QMessageBox confirm(this); QMessageBox confirm(this);
confirm.setIcon(QMessageBox::Warning); confirm.setIcon(QMessageBox::Warning);
confirm.setWindowModality(Qt::WindowModal);
confirm.setWindowTitle(tr("Confirm")); confirm.setWindowTitle(tr("Confirm"));
confirm.setText(tr("Are you sure that you want to delete '%1'?").arg(profile_name)); confirm.setText(tr("Are you sure that you want to delete '%1'?").arg(profile_name));
confirm.setInformativeText(tr("This cannot be undone!")); confirm.setInformativeText(tr("This cannot be undone!"));
@ -186,6 +188,7 @@ void MappingWindow::OnDeleteProfilePressed()
QMessageBox result(this); QMessageBox result(this);
result.setIcon(QMessageBox::Information); result.setIcon(QMessageBox::Information);
result.setWindowModality(Qt::WindowModal);
result.setWindowTitle(tr("Success")); result.setWindowTitle(tr("Success"));
result.setText(tr("Successfully deleted '%1'.").arg(profile_name)); result.setText(tr("Successfully deleted '%1'.").arg(profile_name));
} }