libcalamaresui: when displaying pasted URL, don't be fancy

- Just call the static method and then quit, rather
   than being careful about allocations.
This commit is contained in:
Adriaan de Groot 2019-07-30 15:28:17 +02:00
parent fac9ccde88
commit 675a35bb2e

View File

@ -239,7 +239,9 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail
msgBox->show(); msgBox->show();
cDebug() << "Calamares will quit when the dialog closes."; cDebug() << "Calamares will quit when the dialog closes.";
connect( msgBox, &QMessageBox::buttonClicked, [msgBox]( QAbstractButton* button ) { connect( msgBox, &QMessageBox::buttonClicked, [this,msgBox]( QAbstractButton* button ) {
cDebug() << "Button role:" << msgBox->buttonRole( button );
if ( button->text() != tr( "&Yes" ) ) if ( button->text() != tr( "&Yes" ) )
{ {
QApplication::quit(); QApplication::quit();
@ -255,14 +257,10 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail
pasteUrlMsg = tr( "The upload was unsuccessful. No web-paste was done." ); pasteUrlMsg = tr( "The upload was unsuccessful. No web-paste was done." );
} }
QMessageBox* pasteUrlMsgBox = new QMessageBox(); QMessageBox::critical(nullptr,
pasteUrlMsgBox->setIcon( QMessageBox::Critical ); pasteUrlTitle,
pasteUrlMsgBox->setWindowTitle( pasteUrlTitle ); pasteUrlMsg);
pasteUrlMsgBox->setStandardButtons( QMessageBox::Close ); QApplication::quit();
pasteUrlMsgBox->setText( pasteUrlMsg );
pasteUrlMsgBox->show();
connect( pasteUrlMsgBox, &QMessageBox::buttonClicked, qApp, &QApplication::quit );
} ); } );
} }