From 2782f5a6b03a798dda0c0f77658584abf179ec26 Mon Sep 17 00:00:00 2001 From: DavidLazarescu Date: Tue, 26 Mar 2024 18:18:29 +0100 Subject: [PATCH] Added community discord to about page --- app_info.json | 3 +- .../controllers/app_info_controller.cpp | 5 +++ .../controllers/app_info_controller.hpp | 1 + .../controllers/i_app_info_controller.hpp | 2 ++ src/presentation/settings/MAboutPage.qml | 35 ++++++++++++------- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/app_info.json b/app_info.json index 957f7b24a..fc129fba1 100644 --- a/app_info.json +++ b/app_info.json @@ -6,5 +6,6 @@ "newsWebsite": "https://librumreader.com/news", "companyEmail": "contact@librumreader.com", "githubLink": "https://github.com/Librum-Reader/Librum", - "feedbackLink": "https://forms.gle/bzmMgN4ucmtzAM1XA" + "feedbackLink": "https://forms.gle/bzmMgN4ucmtzAM1XA", + "discord": "https://discord.gg/3jevn8N9K3" } diff --git a/src/adapters/controllers/app_info_controller.cpp b/src/adapters/controllers/app_info_controller.cpp index d108ccc80..d97634737 100644 --- a/src/adapters/controllers/app_info_controller.cpp +++ b/src/adapters/controllers/app_info_controller.cpp @@ -89,6 +89,11 @@ QString AppInfoController::getFeedbackLink() const return m_appInfoService->getInfo("feedbackLink"); } +QString AppInfoController::getDiscord() const +{ + return m_appInfoService->getInfo("discord"); +} + QString AppInfoController::getCurrentQtVersion() const { return qVersion(); diff --git a/src/adapters/controllers/app_info_controller.hpp b/src/adapters/controllers/app_info_controller.hpp index 41fbada65..a7ccc68f5 100644 --- a/src/adapters/controllers/app_info_controller.hpp +++ b/src/adapters/controllers/app_info_controller.hpp @@ -30,6 +30,7 @@ class ADAPTERS_EXPORT AppInfoController : public IAppInfoController QString getCompanyEmail() const override; QString getGithubLink() const override; QString getFeedbackLink() const override; + QString getDiscord() const override; QString getCurrentQtVersion() const override; QString getOperatingSystem() const override; void updateApplication() override; diff --git a/src/adapters/interfaces/controllers/i_app_info_controller.hpp b/src/adapters/interfaces/controllers/i_app_info_controller.hpp index 600baacc1..f330da4af 100644 --- a/src/adapters/interfaces/controllers/i_app_info_controller.hpp +++ b/src/adapters/interfaces/controllers/i_app_info_controller.hpp @@ -26,6 +26,7 @@ class ADAPTERS_EXPORT IAppInfoController : public QObject Q_PROPERTY(QString companyEmail READ getCompanyEmail CONSTANT) Q_PROPERTY(QString githubLink READ getGithubLink CONSTANT) Q_PROPERTY(QString feedbackLink READ getFeedbackLink CONSTANT) + Q_PROPERTY(QString discord READ getDiscord CONSTANT) Q_PROPERTY(QString currentQtVersion READ getCurrentQtVersion CONSTANT) Q_PROPERTY(QString operatingSystem READ getOperatingSystem CONSTANT) Q_PROPERTY(int systemFontSize READ getSystemFontSize CONSTANT) @@ -50,6 +51,7 @@ class ADAPTERS_EXPORT IAppInfoController : public QObject virtual QString getCompanyEmail() const = 0; virtual QString getGithubLink() const = 0; virtual QString getFeedbackLink() const = 0; + virtual QString getDiscord() const = 0; virtual QString getCurrentQtVersion() const = 0; virtual QString getOperatingSystem() const = 0; virtual double getSystemFontSize() const = 0; diff --git a/src/presentation/settings/MAboutPage.qml b/src/presentation/settings/MAboutPage.qml index 2dee922c4..5eb1b026b 100644 --- a/src/presentation/settings/MAboutPage.qml +++ b/src/presentation/settings/MAboutPage.qml @@ -149,48 +149,58 @@ MFlickWrapper { Label { Layout.topMargin: 18 //: Keep it capitalized - text: qsTr("COMPANY NAME") + text: qsTr("WEBSITE") color: Style.colorLightText font.pointSize: Fonts.size10dot25 font.weight: Font.Bold } Label { - Layout.topMargin: 1 - text: AppInfoController.companyName + text: AppInfoController.website color: Style.colorBasePurple font.pointSize: Fonts.size13dot5 + opacity: websiteLinkArea.pressed ? 0.8 : 1 + + MouseArea { + id: websiteLinkArea + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + + onClicked: Qt.openUrlExternally( + AppInfoController.website) + } } Label { Layout.topMargin: 12 //: Keep it capitalized - text: qsTr("WEBSITE") + text: qsTr("CONTACT") color: Style.colorLightText font.pointSize: Fonts.size10dot25 font.weight: Font.Bold } Label { - text: AppInfoController.website + Layout.topMargin: 1 + text: AppInfoController.companyEmail color: Style.colorBasePurple + opacity: emailLinkArea.pressed ? 0.8 : 1 font.pointSize: Fonts.size13dot5 - opacity: websiteLinkArea.pressed ? 0.8 : 1 MouseArea { - id: websiteLinkArea + id: emailLinkArea anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: Qt.openUrlExternally( - AppInfoController.website) + "mailto:" + AppInfoController.companyEmail) } } Label { Layout.topMargin: 12 //: Keep it capitalized - text: qsTr("CONTACT") + text: qsTr("DISCORD") color: Style.colorLightText font.pointSize: Fonts.size10dot25 font.weight: Font.Bold @@ -198,18 +208,17 @@ MFlickWrapper { Label { Layout.topMargin: 1 - text: AppInfoController.companyEmail + text: AppInfoController.discord color: Style.colorBasePurple - opacity: emailLinkArea.pressed ? 0.8 : 1 font.pointSize: Fonts.size13dot5 MouseArea { - id: emailLinkArea + id: discordLinkArea anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: Qt.openUrlExternally( - "mailto:" + AppInfoController.companyEmail) + AppInfoController.discord) } }