From 563d4330649598c609525b7b06eb12ef9ff9d130 Mon Sep 17 00:00:00 2001 From: Joachim Schmitz Date: Mon, 19 Apr 2021 13:11:30 +0200 Subject: [PATCH 1/3] Fix #7970: Help > About... Replace link to donate page, change text, say GPL version, say build etc. and keep HTML out of translatable text as far as possible --- src/appshell/iappshellconfiguration.h | 1 + src/appshell/internal/appshellconfiguration.cpp | 9 +++++++-- src/appshell/internal/appshellconfiguration.h | 1 + src/appshell/qml/AboutDialog.qml | 13 +++++++------ src/appshell/view/aboutmodel.cpp | 13 +++++++++++-- src/appshell/view/aboutmodel.h | 1 + 6 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/appshell/iappshellconfiguration.h b/src/appshell/iappshellconfiguration.h index b8d9e2e2250e9..0abd2caf914fe 100644 --- a/src/appshell/iappshellconfiguration.h +++ b/src/appshell/iappshellconfiguration.h @@ -52,6 +52,7 @@ class IAppShellConfiguration : MODULE_EXPORT_INTERFACE virtual std::string bugReportUrl() const = 0; virtual std::string leaveFeedbackUrl() const = 0; virtual std::string museScoreUrl() const = 0; + virtual std::string museScoreForumUrl() const = 0; virtual std::string museScoreContributionUrl() const = 0; virtual std::string musicXMLLicenseUrl() const = 0; virtual std::string musicXMLLicenseDeedUrl() const = 0; diff --git a/src/appshell/internal/appshellconfiguration.cpp b/src/appshell/internal/appshellconfiguration.cpp index f46adb881a55a..2c13d7f407ed4 100644 --- a/src/appshell/internal/appshellconfiguration.cpp +++ b/src/appshell/internal/appshellconfiguration.cpp @@ -35,7 +35,7 @@ static const std::string ONLINE_HANDBOOK_URL("https://musescore.org/redirect/hel static const std::string ASK_FOR_HELP_URL("https://musescore.org/redirect/post/question?locale="); static const std::string BUG_REPORT_URL("https://musescore.org/redirect/post/bug-report?locale="); static const std::string LEAVE_FEEDBACK_URL("https://musescore.com/content/editor-feedback?"); -static const std::string MUSESCORE_URL("http://www.musescore.org/"); +static const std::string MUSESCORE_URL("https://www.musescore.org/"); static const std::string MUSICXML_LICENSE_URL("https://www.w3.org/community/about/process/final/"); static const std::string MUSICXML_LICENSE_DEED_URL("https://www.w3.org/community/about/process/fsa-deed/"); @@ -147,9 +147,14 @@ std::string AppShellConfiguration::museScoreUrl() const return MUSESCORE_URL + languageCode; } +std::string AppShellConfiguration::museScoreForumUrl() const +{ + return MUSESCORE_URL + "forum"; +} + std::string AppShellConfiguration::museScoreContributionUrl() const { - return museScoreUrl() + "/donate"; + return MUSESCORE_URL + "contribute"; } std::string AppShellConfiguration::musicXMLLicenseUrl() const diff --git a/src/appshell/internal/appshellconfiguration.h b/src/appshell/internal/appshellconfiguration.h index 92ddc54d6d788..6b6f8f3a3f894 100644 --- a/src/appshell/internal/appshellconfiguration.h +++ b/src/appshell/internal/appshellconfiguration.h @@ -58,6 +58,7 @@ class AppShellConfiguration : public IAppShellConfiguration std::string bugReportUrl() const override; std::string leaveFeedbackUrl() const override; std::string museScoreUrl() const override; + std::string museScoreForumUrl() const override; std::string museScoreContributionUrl() const override; std::string musicXMLLicenseUrl() const override; std::string musicXMLLicenseDeedUrl() const override; diff --git a/src/appshell/qml/AboutDialog.qml b/src/appshell/qml/AboutDialog.qml index 406c89f6f0415..e6f2463bf4d62 100644 --- a/src/appshell/qml/AboutDialog.qml +++ b/src/appshell/qml/AboutDialog.qml @@ -97,14 +97,15 @@ QmlDialog { StyledTextLabel { Layout.fillWidth: true text: { - var message = qsTrc("appshell", "Visit %2 for new versions and more information.
Support MuseScore with your %4.") + var message = qsTrc("appshell", "Visit %1 for new versions and more information.\nGet %2 with the program or %3 to its development.") var museScoreUrl = aboutModel.museScoreUrl() + var museScoreForumUrl = aboutModel.museScoreForumUrl() var museScoreContributionUrl = aboutModel.museScoreContributionUrl() return message - .arg(museScoreUrl.url) - .arg(museScoreUrl.displayName) - .arg(museScoreContributionUrl.url) - .arg(museScoreContributionUrl.displayName) + .arg("" + museScoreUrl.displayName + "") + .arg("" + museScoreForumUrl.displayName + "") + .arg("" + museScoreContributionUrl.displayName + "") + .replace("\n", "
") } wrapMode: Text.WordWrap maximumLineCount: 3 @@ -112,7 +113,7 @@ QmlDialog { StyledTextLabel { Layout.fillWidth: true - text: qsTrc("appshell", "Copyright © 1999-2021 MuseScore BVBA and others.\nPublished under the GNU General Public License.") + text: qsTrc("appshell", "Copyright © 1999-2021 MuseScore BVBA and others.\nPublished under the GNU General Public License version 3.") enabled: false wrapMode: Text.WordWrap maximumLineCount: 3 diff --git a/src/appshell/view/aboutmodel.cpp b/src/appshell/view/aboutmodel.cpp index 8aeeeb591a9dc..e223e9894c5a8 100644 --- a/src/appshell/view/aboutmodel.cpp +++ b/src/appshell/view/aboutmodel.cpp @@ -22,6 +22,7 @@ #include "aboutmodel.h" #include "translation.h" +#include "version.h" #include #include @@ -36,7 +37,9 @@ AboutModel::AboutModel(QObject* parent) QString AboutModel::museScoreVersion() const { - return QString::fromStdString(configuration()->museScoreVersion()); + return (mu::framework::Version::unstable() ? qtrc("appshell", + "Unstable Prerelease for %1") : "%1").arg(QString::fromStdString(configuration()-> + museScoreVersion())); } QString AboutModel::museScoreRevision() const @@ -50,10 +53,16 @@ QVariantMap AboutModel::museScoreUrl() const return makeUrl(museScoreUrl.toString(), museScoreUrl.host()); } +QVariantMap AboutModel::museScoreForumUrl() const +{ + QUrl museScoreUrl(QString::fromStdString(configuration()->museScoreForumUrl())); + return makeUrl(museScoreUrl.toString(), qtrc("appshell", "help")); +} + QVariantMap AboutModel::museScoreContributionUrl() const { QUrl museScoreUrl(QString::fromStdString(configuration()->museScoreContributionUrl())); - return makeUrl(museScoreUrl.toString(), qtrc("appshell", "contribution")); + return makeUrl(museScoreUrl.toString(), qtrc("appshell", "contribute")); } QVariantMap AboutModel::musicXMLLicenseUrl() const diff --git a/src/appshell/view/aboutmodel.h b/src/appshell/view/aboutmodel.h index 4f95e70bf11b1..7a731a5805c7e 100644 --- a/src/appshell/view/aboutmodel.h +++ b/src/appshell/view/aboutmodel.h @@ -40,6 +40,7 @@ class AboutModel : public QObject Q_INVOKABLE QString museScoreVersion() const; Q_INVOKABLE QString museScoreRevision() const; Q_INVOKABLE QVariantMap museScoreUrl() const; + Q_INVOKABLE QVariantMap museScoreForumUrl() const; Q_INVOKABLE QVariantMap museScoreContributionUrl() const; Q_INVOKABLE QVariantMap musicXMLLicenseUrl() const; From 21ded7d036dc65528f7516b8925ccf0e7c856651 Mon Sep 17 00:00:00 2001 From: Joachim Schmitz Date: Tue, 20 Apr 2021 11:13:53 +0200 Subject: [PATCH 2/3] Add hyperlink to GPL --- src/appshell/qml/AboutDialog.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/appshell/qml/AboutDialog.qml b/src/appshell/qml/AboutDialog.qml index e6f2463bf4d62..6e530461f68df 100644 --- a/src/appshell/qml/AboutDialog.qml +++ b/src/appshell/qml/AboutDialog.qml @@ -113,8 +113,13 @@ QmlDialog { StyledTextLabel { Layout.fillWidth: true - text: qsTrc("appshell", "Copyright © 1999-2021 MuseScore BVBA and others.\nPublished under the GNU General Public License version 3.") - enabled: false + text: { + var message = qsTrc("appshell", "Copyright © 1999-2021 MuseScore BVBA and others.\nPublished under the %1GNU General Public License version 3%2.") + return message + .arg("") + .arg("") + .replace("\n", "
") + } wrapMode: Text.WordWrap maximumLineCount: 3 } From a99b3b09ca44337d50a8d58c2dd64b7d28c0b296 Mon Sep 17 00:00:00 2001 From: Joachim Schmitz Date: Tue, 20 Apr 2021 13:52:40 +0200 Subject: [PATCH 3/3] Add full set of information to About box' clipboard Useful for pasting into a forum topic or issue. Same to what MuseScore 3.x provided. --- src/appshell/view/aboutmodel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/appshell/view/aboutmodel.cpp b/src/appshell/view/aboutmodel.cpp index e223e9894c5a8..0e56f8bb70201 100644 --- a/src/appshell/view/aboutmodel.cpp +++ b/src/appshell/view/aboutmodel.cpp @@ -23,6 +23,7 @@ #include "translation.h" #include "version.h" +#include "config.h" #include #include @@ -79,7 +80,10 @@ QVariantMap AboutModel::musicXMLLicenseDeedUrl() const void AboutModel::copyRevisionToClipboard() const { - QApplication::clipboard()->setText(museScoreRevision()); + QApplication::clipboard()->setText(QString( + "OS: %1, Arch.: %2, MuseScore version (%3-bit): %4-%5, revision: github-musescore-musescore-%6") + .arg(QSysInfo::prettyProductName()).arg(QSysInfo::currentCpuArchitecture()).arg(QSysInfo::WordSize) + .arg(VERSION).arg(BUILD_NUMBER).arg(MUSESCORE_REVISION)); } QVariantMap AboutModel::makeUrl(const QString& url, const QString& displayName) const