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.
This commit is contained in:
Adriaan de Groot 2017-07-04 08:14:30 -04:00 committed by Philip
parent 5be4a00f62
commit a5604aa978

View File

@ -165,22 +165,23 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail
cLog() << "- message:" << message; cLog() << "- message:" << message;
cLog() << "- details:" << details; cLog() << "- details:" << details;
QMessageBox msgBox; QMessageBox* msgBox = new QMessageBox();
msgBox.setIcon( QMessageBox::Critical ); msgBox->setIcon( QMessageBox::Critical );
msgBox.setWindowTitle( tr("Error") ); msgBox->setWindowTitle( tr("Error") );
msgBox.setText( "<strong>" + tr( "Installation Failed" ) + "</strong>" ); msgBox->setText( "<strong>" + tr( "Installation Failed" ) + "</strong>" );
msgBox.setStandardButtons( QMessageBox::Close ); msgBox->setStandardButtons( QMessageBox::Close );
msgBox->button( QMessageBox::Close )->setText( tr( "&Close" ) );
QString text = "<p>" + message + "</p>"; QString text = "<p>" + message + "</p>";
if ( !details.isEmpty() ) if ( !details.isEmpty() )
{ {
text += "<p>" + details + "</p>"; text += "<p>" + details + "</p>";
} }
msgBox.setInformativeText( text ); msgBox->setInformativeText( text );
msgBox.exec(); connect(msgBox, &QMessageBox::buttonClicked, qApp, &QApplication::quit);
cLog() << "Calamares will now quit."; cLog() << "Calamares will quit when the dialog closes.";
qApp->quit(); msgBox->show();
} }