Skip to content

Commit

Permalink
Show app version in debug settings
Browse files Browse the repository at this point in the history
We should find a better home for the applicationVersion property,
but this is probably okay for now.

Fixes issue #706
  • Loading branch information
blammit committed Feb 6, 2024
1 parent b053e4f commit 2879a2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pages/settings/debug/PageDebug.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Page {

GradientListView {
model: ObjectModel {

ListItem {
id: frameRateSwitch
//% "Enable frame-rate visualizer"
Expand Down Expand Up @@ -80,6 +79,11 @@ Page {
// TODO implement when venus-platform provides equivalent of QuickView.imageCacheSize()
// onClicked: Global.pageManager.pushPage("/pages/settings/debug/PageDebugMemoryQt.qml", { title: text })
}

ListTextItem {
text: "Application version"
secondaryText: Theme.applicationVersion
}
}
}
}
5 changes: 5 additions & 0 deletions src/theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Theme : public QObject
QML_NAMED_ELEMENT(ThemeBase)
Q_PROPERTY(ScreenSize screenSize READ screenSize WRITE setScreenSize NOTIFY screenSizeChanged)
Q_PROPERTY(ColorScheme colorScheme READ colorScheme WRITE setColorScheme NOTIFY colorSchemeChanged)
Q_PROPERTY(QString applicationVersion READ applicationVersion CONSTANT)

public:
enum ScreenSize {
Expand Down Expand Up @@ -94,6 +95,10 @@ class Theme : public QObject

Q_INVOKABLE bool objectHasQObjectParent(QObject *obj) const { return obj && obj->parent(); }

QString applicationVersion() const {
return QString("v%1.%2.%3").arg(PROJECT_VERSION_MAJOR).arg(PROJECT_VERSION_MINOR).arg(PROJECT_VERSION_PATCH);
};

Q_SIGNALS:
void screenSizeChanged(Victron::VenusOS::Theme::ScreenSize screenSize);
void screenSizeChanged_parameterless();
Expand Down

0 comments on commit 2879a2b

Please sign in to comment.