[libcalamaresui] Push upload to a more abstract API

- have a namespace Paste with just one entry point, which will handle
  untangling type &c.

This doesn't compile, but indicates the direction to take the API
main
Adriaan de Groot 4 years ago
parent efec12d001
commit 1ff854f05d

@ -142,8 +142,7 @@ ViewManager::insertViewStep( int before, ViewStep* step )
void void
ViewManager::onInstallationFailed( const QString& message, const QString& details ) ViewManager::onInstallationFailed( const QString& message, const QString& details )
{ {
QString serverType = Calamares::Branding::instance()->uploadServer( Calamares::Branding::Type ); bool shouldOfferWebPaste = Calamares::Branding::instance()->uploadServer().first != Calamares::Branding::UploadServerType::None;
bool shouldOfferWebPaste = CalamaresUtils::UploadServersList.contains( serverType );
cError() << "Installation failed:" << message; cError() << "Installation failed:" << message;
cDebug() << Logger::SubEntry << "- message:" << message; cDebug() << Logger::SubEntry << "- message:" << message;
@ -186,18 +185,10 @@ 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, serverType]( QAbstractButton* button ) { connect( msgBox, &QMessageBox::buttonClicked, [msgBox]( QAbstractButton* button ) {
if ( msgBox->buttonRole( button ) == QMessageBox::ButtonRole::YesRole ) if ( msgBox->buttonRole( button ) == QMessageBox::ButtonRole::YesRole )
{ {
QString pasteUrlMsg; QString pasteUrlMsg = CalamaresUtils::Paste::doLogUpload();
if ( serverType == "fiche" )
{
pasteUrlMsg = CalamaresUtils::ficheLogUpload( msgBox );
}
else
{
pasteUrlMsg = QString();
}
QString pasteUrlTitle = tr( "Install Log Paste URL" ); QString pasteUrlTitle = tr( "Install Log Paste URL" );
if ( pasteUrlMsg.isEmpty() ) if ( pasteUrlMsg.isEmpty() )

Loading…
Cancel
Save