From 85a1eb95eef51041aef6f2a0660c53d82d08bc50 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 25 Jul 2021 00:08:47 +0200 Subject: [PATCH] [welcome] Some translation / label fixes - the message had been arbitrarily changed; change it back - update (warning) message when there is progress in checking the model, so it doesn't stay at "unchecked" until you change language - minor clean-ups --- src/modules/welcome/Config.cpp | 6 ++++-- src/modules/welcome/checker/ResultsListWidget.cpp | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/welcome/Config.cpp b/src/modules/welcome/Config.cpp index 28775f326..bc489d186 100644 --- a/src/modules/welcome/Config.cpp +++ b/src/modules/welcome/Config.cpp @@ -31,6 +31,8 @@ Config::Config( QObject* parent ) initLanguages(); CALAMARES_RETRANSLATE_SLOT( &Config::retranslate ); + // But also when the requirements model changes, update the messages + connect( requirementsModel(), &Calamares::RequirementsModel::progressMessageChanged, this, &Config::retranslate ); } void @@ -63,11 +65,11 @@ Config::retranslate() message = setup ? tr( "This computer does not satisfy some of the " "recommended requirements for setting up %1.
" "Setup can continue, but some features " - "might be reduced." ) + "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 reduced." ); + "might be disabled." ); } m_warningMessage = message.arg( Calamares::Branding::instance()->shortVersionedName() ); diff --git a/src/modules/welcome/checker/ResultsListWidget.cpp b/src/modules/welcome/checker/ResultsListWidget.cpp index e3ef28526..acbb48e42 100644 --- a/src/modules/welcome/checker/ResultsListWidget.cpp +++ b/src/modules/welcome/checker/ResultsListWidget.cpp @@ -127,7 +127,6 @@ ResultsListDialog::ResultsListDialog( const Calamares::RequirementsModel& model, connect( buttonBox, &QDialogButtonBox::clicked, this, &QDialog::close ); CALAMARES_RETRANSLATE_SLOT( &ResultsListDialog::retranslate ); - retranslate(); // Do it now to fill in the texts } ResultsListDialog::~ResultsListDialog() {} @@ -169,15 +168,15 @@ ResultsListWidget::ResultsListWidget( Config* config, QWidget* parent ) spacerLayout->addSpacing( paddingSize ); CalamaresUtils::unmarginLayout( spacerLayout ); - auto* explanation = new QLabel; + auto* explanation = new QLabel( m_config->warningMessage() ); explanation->setWordWrap( true ); explanation->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ); explanation->setOpenExternalLinks( false ); explanation->setObjectName( "resultsExplanation" ); - connect( explanation, &QLabel::linkActivated, this, &ResultsListWidget::linkClicked ); entriesLayout->addWidget( explanation ); connect( config, &Config::warningMessageChanged, explanation, &QLabel::setText ); + connect( explanation, &QLabel::linkActivated, this, &ResultsListWidget::linkClicked ); // Check that all are satisfied (gives warnings if not) and // all *mandatory* entries are satisfied (gives errors if not). @@ -226,7 +225,6 @@ ResultsListWidget::ResultsListWidget( Config* config, QWidget* parent ) } CALAMARES_RETRANSLATE_SLOT( &ResultsListWidget::retranslate ); - retranslate(); }