From a5604aa97841cac0fa00826f160ae96db19f2456 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 4 Jul 2017 08:14:30 -0400 Subject: [PATCH] FinishedPage: no modal pop-ups in a slot Switch the failure popup to non-modal, and quit the application when the pop-up is closed. This allows signals to be delivered to other slots connected to JobQueue::failed. --- src/libcalamaresui/ViewManager.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index ad433d2fa..efdc3a3fe 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -165,22 +165,23 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail cLog() << "- message:" << message; cLog() << "- details:" << details; - QMessageBox msgBox; - msgBox.setIcon( QMessageBox::Critical ); - msgBox.setWindowTitle( tr("Error") ); - msgBox.setText( "" + tr( "Installation Failed" ) + "" ); - msgBox.setStandardButtons( QMessageBox::Close ); + QMessageBox* msgBox = new QMessageBox(); + msgBox->setIcon( QMessageBox::Critical ); + msgBox->setWindowTitle( tr("Error") ); + msgBox->setText( "" + tr( "Installation Failed" ) + "" ); + msgBox->setStandardButtons( QMessageBox::Close ); + msgBox->button( QMessageBox::Close )->setText( tr( "&Close" ) ); QString text = "

" + message + "

"; if ( !details.isEmpty() ) { text += "

" + details + "

"; } - msgBox.setInformativeText( text ); + msgBox->setInformativeText( text ); - msgBox.exec(); - cLog() << "Calamares will now quit."; - qApp->quit(); + connect(msgBox, &QMessageBox::buttonClicked, qApp, &QApplication::quit); + cLog() << "Calamares will quit when the dialog closes."; + msgBox->show(); }