From 8ee2375ee69b372da816e0c442616c16431398fd Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 1 Apr 2019 05:54:35 -0400 Subject: [PATCH] [welcome] Adjust welcome message to setup-mode --- src/modules/welcome/WelcomePage.cpp | 21 ++++++++++--- .../welcome/checker/ResultsListWidget.cpp | 31 +++++++++++++------ 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/src/modules/welcome/WelcomePage.cpp b/src/modules/welcome/WelcomePage.cpp index 9260f27a3..7d86567d7 100644 --- a/src/modules/welcome/WelcomePage.cpp +++ b/src/modules/welcome/WelcomePage.cpp @@ -28,6 +28,7 @@ #include "utils/Retranslator.h" #include "modulesystem/ModuleManager.h" +#include "Settings.h" #include "ViewManager.h" #include @@ -62,8 +63,18 @@ WelcomePage::WelcomePage( QWidget* parent ) << *Calamares::Branding::VersionedName; CALAMARES_RETRANSLATE( - ui->mainText->setText( (Calamares::Branding::instance()->welcomeStyleCalamares() ? tr( "

Welcome to the Calamares installer for %1.

" ) : tr( "

Welcome to the %1 installer.

" )) - .arg( *Calamares::Branding::VersionedName ) ); + QString message; + + if ( Calamares::Settings::instance()->isSetupMode() ) + message = Calamares::Branding::instance()->welcomeStyleCalamares() + ? tr( "

Welcome to the Calamares setup program for %1.

" ) + : tr( "

Welcome to %1 setup.

" ); + else + message = Calamares::Branding::instance()->welcomeStyleCalamares() + ? tr( "

Welcome to the Calamares installer for %1.

" ) + : tr( "

Welcome to the %1 installer.

" ); + + ui->mainText->setText( message.arg( *Calamares::Branding::VersionedName ) ); ui->retranslateUi( this ); ) @@ -74,9 +85,11 @@ WelcomePage::WelcomePage( QWidget* parent ) connect( ui->aboutButton, &QPushButton::clicked, this, [ this ] { + QString title = Calamares::Settings::instance()->isSetupMode() + ? tr( "About %1 setup" ) + : tr( "About %1 installer" ); QMessageBox mb( QMessageBox::Information, - tr( "About %1 installer" ) - .arg( CALAMARES_APPLICATION_NAME ), + title.arg( CALAMARES_APPLICATION_NAME ), tr( "

%1


" "%2
" diff --git a/src/modules/welcome/checker/ResultsListWidget.cpp b/src/modules/welcome/checker/ResultsListWidget.cpp index 5908e4bf5..9c3e3f0cd 100644 --- a/src/modules/welcome/checker/ResultsListWidget.cpp +++ b/src/modules/welcome/checker/ResultsListWidget.cpp @@ -22,6 +22,7 @@ #include "ResultWidget.h" #include "Branding.h" +#include "Settings.h" #include "utils/CalamaresUtilsGui.h" #include "utils/Retranslator.h" #include "widgets/FixedAspectRatioLabel.h" @@ -91,11 +92,16 @@ ResultsListWidget::init( const Calamares::RequirementsList& checkEntries ) if ( !requirementsSatisfied ) { CALAMARES_RETRANSLATE( - textLabel->setText( tr( "This computer does not satisfy the minimum " - "requirements for installing %1.
" - "Installation cannot continue. " - "Details..." ) - .arg( *Calamares::Branding::ShortVersionedName ) ); + QString message = Calamares::Settings::instance()->isSetupMode() + ? tr( "This computer does not satisfy the minimum " + "requirements for setting up %1.
" + "Setup cannot continue. " + "Details..." ) + : tr( "This computer does not satisfy the minimum " + "requirements for installing %1.
" + "Installation cannot continue. " + "Details..." ); + textLabel->setText( message.arg( *Calamares::Branding::ShortVersionedName ) ); ) textLabel->setOpenExternalLinks( false ); connect( textLabel, &QLabel::linkActivated, @@ -108,11 +114,16 @@ ResultsListWidget::init( const Calamares::RequirementsList& checkEntries ) else { CALAMARES_RETRANSLATE( - textLabel->setText( tr( "This computer does not satisfy some of the " - "recommended requirements for installing %1.
" - "Installation can continue, but some features " - "might be disabled." ) - .arg( *Calamares::Branding::ShortVersionedName ) ); + QString message = Calamares::Settings::instance()->isSetupMode() + ? tr( "This computer does not satisfy some of the " + "recommended requirements for setting up %1.
" + "Setup can continue, but some features " + "might be disabled." ) + : tr( "This computer does not satisfy some of the " + "recommended requirements for installing %1.
" + "Installation can continue, but some features " + "might be disabled." ); + textLabel->setText( message.arg( *Calamares::Branding::ShortVersionedName ) ); ) } }