From 7e4fc3e4c7427ce80a38327006cf3e29543597d0 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 23 May 2022 17:11:45 +0200 Subject: [PATCH] [welcome] Use about-message from Config - for QML, this is the easiest way to factor out the message (no convenient access to free functions, unless I bung the message into e.g. Branding where I don't think it fits very well). --- src/modules/welcome/Config.cpp | 8 ++++++++ src/modules/welcome/Config.h | 2 ++ src/modules/welcome/WelcomePage.cpp | 2 +- src/modules/welcomeq/about.qml | 19 +------------------ 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/modules/welcome/Config.cpp b/src/modules/welcome/Config.cpp index 0baadd82f..e5b2da211 100644 --- a/src/modules/welcome/Config.cpp +++ b/src/modules/welcome/Config.cpp @@ -10,6 +10,7 @@ #include "Config.h" #include "Branding.h" +#include "CalamaresAbout.h" #include "GlobalStorage.h" #include "JobQueue.h" #include "Settings.h" @@ -247,6 +248,13 @@ Config::setSupportUrl( const QString& url ) emit supportUrlChanged(); } +QString +Config::aboutMessage() const +{ + return Calamares::aboutString(); +} + + QString Config::genericWelcomeMessage() const { diff --git a/src/modules/welcome/Config.h b/src/modules/welcome/Config.h index c01bdf7e3..49d9a1b11 100644 --- a/src/modules/welcome/Config.h +++ b/src/modules/welcome/Config.h @@ -52,6 +52,7 @@ class Config : public QObject Q_PROPERTY( QString countryCode MEMBER m_countryCode NOTIFY countryCodeChanged FINAL ) Q_PROPERTY( int localeIndex READ localeIndex WRITE setLocaleIndex NOTIFY localeIndexChanged ) + Q_PROPERTY( QString aboutMessage READ aboutMessage CONSTANT FINAL ) Q_PROPERTY( QString genericWelcomeMessage MEMBER m_genericWelcomeMessage NOTIFY genericWelcomeMessageChanged FINAL ) Q_PROPERTY( QString warningMessage READ warningMessage NOTIFY warningMessageChanged FINAL ) @@ -89,6 +90,7 @@ public: QString donateUrl() const { return m_donateUrl; } void setDonateUrl( const QString& url ); + QString aboutMessage() const; QString genericWelcomeMessage() const; QString warningMessage() const; diff --git a/src/modules/welcome/WelcomePage.cpp b/src/modules/welcome/WelcomePage.cpp index d5bc286d1..5b26434a1 100644 --- a/src/modules/welcome/WelcomePage.cpp +++ b/src/modules/welcome/WelcomePage.cpp @@ -223,7 +223,7 @@ WelcomePage::showAboutBox() = Calamares::Settings::instance()->isSetupMode() ? tr( "About %1 setup" ) : tr( "About %1 installer" ); QMessageBox mb( QMessageBox::Information, title.arg( CALAMARES_APPLICATION_NAME ), - Calamares::aboutString().arg( Calamares::Branding::instance()->versionedName() ), + m_conf->aboutMessage().arg( Calamares::Branding::instance()->versionedName() ), QMessageBox::Ok, this ); Calamares::fixButtonLabels( &mb ); diff --git a/src/modules/welcomeq/about.qml b/src/modules/welcomeq/about.qml index 21050c4ea..bb7b06056 100644 --- a/src/modules/welcomeq/about.qml +++ b/src/modules/welcomeq/about.qml @@ -18,9 +18,6 @@ Item { height: parent.height focus: true - property var appName: "Calamares" - property var appVersion: "3.2.24" - Rectangle { id: textArea x: 28 @@ -44,21 +41,7 @@ Item { width: 400 height: 250 anchors.centerIn: parent - text: qsTr("

%1


- %2
- for %3


- Copyright 2014-2017 Teo Mrnjavac <teo@kde.org>
- Copyright 2017-2020 Adriaan de Groot <groot@kde.org>
- Thanks to the Calamares team - and the Calamares - translators team.

- Calamares - development is sponsored by
- Blue Systems - - Liberating Software." ) - .arg(appName) - .arg(appVersion) - .arg(Branding.string(Branding.VersionedName)) + text: config.aboutMessage.arg(Branding.string(Branding.VersionedName)) onLinkActivated: Qt.openUrlExternally(link)