feat(AboutViewPage): display the runtime Qt version in Settings/About

- it's easier to make sure and detect what users are using, esp. when
they report bugs
- with a clickable link to the release notes
This commit is contained in:
Lukáš Tinkl 2024-08-12 21:05:13 +02:00 committed by Lukáš Tinkl
parent 1ba6a065ab
commit 3c18ac0f7a
7 changed files with 56 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import StatusQ.Core 0.1
import AppLayouts.Profile.views 1.0
import Storybook 1.0
@ -37,6 +38,10 @@ SplitView {
return "0.162.9"
}
function qtRuntimeVersion() {
return SystemUtils.qtRuntimeVersion()
}
function getReleaseNotes() {
logs.logEvent("store::getReleaseNotes")
const link = isProduction ? "https://github.com/status-im/status-desktop/releases/tag/%1" :

View File

@ -122,6 +122,7 @@ add_library(StatusQ SHARED
include/StatusQ/submodelproxymodel.h
include/StatusQ/sumaggregator.h
include/StatusQ/undefinedfilter.h
include/StatusQ/systemutilsinternal.h
include/StatusQ/writableproxymodel.h
src/QClipboardProxy.cpp
src/aggregator.cpp
@ -152,6 +153,7 @@ add_library(StatusQ SHARED
src/stringutilsinternal.cpp
src/submodelproxymodel.cpp
src/sumaggregator.cpp
src/systemutilsinternal.cpp
src/undefinedfilter.cpp
src/writableproxymodel.cpp

View File

@ -0,0 +1,12 @@
#pragma once
#include <QObject>
class SystemUtilsInternal : public QObject
{
Q_OBJECT
public:
explicit SystemUtilsInternal(QObject *parent = nullptr);
Q_INVOKABLE QString qtRuntimeVersion() const;
};

View File

@ -29,6 +29,7 @@
#include "StatusQ/submodelproxymodel.h"
#include "StatusQ/sumaggregator.h"
#include "StatusQ/undefinedfilter.h"
#include "StatusQ/systemutilsinternal.h"
#include "StatusQ/writableproxymodel.h"
#include "wallet/managetokenscontroller.h"
@ -94,6 +95,11 @@ public:
return new StringUtilsInternal(engine);
});
qmlRegisterSingletonType<SystemUtilsInternal>(
"StatusQ.Core", 0, 1, "SystemUtils", [](QQmlEngine*, QJSEngine*) {
return new SystemUtilsInternal;
});
qmlRegisterSingletonType<PermissionUtilsInternal>(
"StatusQ.Internal", 0, 1, "PermissionUtils", [](QQmlEngine*, QJSEngine*) {
return new PermissionUtilsInternal;

View File

@ -0,0 +1,9 @@
#include "StatusQ/systemutilsinternal.h"
SystemUtilsInternal::SystemUtilsInternal(QObject *parent)
: QObject{parent}
{}
QString SystemUtilsInternal::qtRuntimeVersion() const {
return qVersion();
}

View File

@ -356,6 +356,10 @@ StatusSectionLayout {
return root.store.getStatusGoVersion()
}
function qtRuntimeVersion() {
return SystemUtils.qtRuntimeVersion()
}
function getReleaseNotes() {
const link = isProduction ? "https://github.com/status-im/status-desktop/releases/tag/%1" :
"https://github.com/status-im/status-desktop/commit/%1"

View File

@ -85,7 +85,7 @@ SettingsContentBase {
font.bold: true
normalColor: Theme.palette.directColor1
text: root.store.getStatusGoVersion()
onClicked: root.store.openLink("https://github.com/status-im/status-go/tree/v%1".arg(root.store.getStatusGoVersion()))
onClicked: root.store.openLink("https://github.com/status-im/status-go/tree/%1".arg(root.store.getStatusGoVersion()))
}
StatusBaseText {
@ -96,6 +96,23 @@ SettingsContentBase {
Item { width: 1; height: 17}
StatusLinkText {
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: 17
font.bold: true
normalColor: Theme.palette.directColor1
text: root.store.qtRuntimeVersion()
onClicked: root.store.openLink("https://github.com/qt/qtreleasenotes/blob/dev/qt/%1/release-note.md".arg(text))
}
StatusBaseText {
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: Style.current.additionalTextSize
text: qsTr("Qt Version")
}
Item { width: 1; height: 17}
StatusButton {
anchors.horizontalCenter: parent.horizontalCenter
size: StatusBaseButton.Size.Small