From 2adde0fcca34a0537afb218b3061e0427b074807 Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Sat, 7 Mar 2020 06:38:09 +0100 Subject: [PATCH] Settings dialog About section: Show minimal version info - Application name, version number, OS Example: Nextcloud Desktop Client Version 2.6.4 (macOS) - Keep previous version info in new method Theme::aboutDetails() Signed-off-by: Michael Schuster --- src/libsync/theme.cpp | 18 ++++++++++++++++++ src/libsync/theme.h | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index fde29c416..48ceb5f93 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -336,6 +336,24 @@ QString Theme::gitSHA1() const } QString Theme::about() const +{ + // Shorten Qt's OS name: "macOS Mojave (10.14)" -> "macOS" + QStringList osStringList = Utility::platformName().split(QLatin1Char(' ')); + QString osName = osStringList.at(0); + + QString devString; + //: Example text: "

Nextcloud Desktop Client

" (%1 is the application name) + devString = tr("

%1 Desktop Client

") + .arg(APPLICATION_NAME); + + devString += tr("

Version %1. For more information please click here.

") + .arg(QString::fromLatin1(MIRALL_STRINGIFY(MIRALL_VERSION)) + QString(" (%1)").arg(osName)) + .arg(helpUrl()); + + return devString; +} + +QString Theme::aboutDetails() const { QString devString; devString = tr("

Version %1. For more information please click here.

") diff --git a/src/libsync/theme.h b/src/libsync/theme.h index 12a643d00..2d0657648 100644 --- a/src/libsync/theme.h +++ b/src/libsync/theme.h @@ -205,6 +205,11 @@ public: */ virtual QString about() const; + /** + * Legal notice dialog version detail contents + */ + virtual QString aboutDetails() const; + /** * Define if the systray icons should be using mono design */