status-desktop/storybook/pages/AboutViewPage.qml
Lukáš Tinkl 57fc600d5e feat: Add status-go version to About screen
- Settings/About now displays the `status-go` version, read from its
`VERSION` file
- use the actual app icon, to differentiate between prod/dev version
- make the version numbers clickable, taking the user to either the
release notes (prod) or the GH commit browser (dev)
- add "Is production" switch to the About page in storybook

Closes #11424
2023-07-26 21:35:21 +02:00

75 lines
1.9 KiB
QML

import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import AppLayouts.Profile.views 1.0
import Storybook 1.0
import utils 1.0
SplitView {
Logs { id: logs }
SplitView {
orientation: Qt.Vertical
SplitView.fillWidth: true
AboutView {
SplitView.fillWidth: true
SplitView.fillHeight: true
contentWidth: parent.width
store: QtObject {
readonly property bool isProduction: ctrlProduction.checked
function checkForUpdates() {
logs.logEvent("store::checkForUpdates")
}
function getCurrentVersion() {
logs.logEvent("store::getCurrentVersion")
return isProduction ? "0.13.2" : "45784cf0c"
}
function getStatusGoVersion() {
logs.logEvent("store::getStatusGoVersion")
return "0.162.9"
}
function getReleaseNotes() {
logs.logEvent("store::getReleaseNotes")
const link = isProduction ? "https://github.com/status-im/status-desktop/releases/tag/%1" :
"https://github.com/status-im/status-desktop/commit/%1"
openLink(link.arg(getCurrentVersion()))
}
function openLink(url) {
logs.logEvent("store::openLink", ["url"], arguments)
Qt.openUrlExternally(url)
}
}
}
LogsAndControlsPanel {
id: logsAndControlsPanel
SplitView.minimumHeight: 100
SplitView.preferredHeight: 200
logsView.logText: logs.logText
}
}
Switch {
id: ctrlProduction
SplitView.minimumWidth: 300
SplitView.preferredWidth: 300
text: "Production"
checked: true
}
}