Skip to content

Commit

Permalink
Update PageDebug to match new design
Browse files Browse the repository at this point in the history
Part of #1232
  • Loading branch information
DanielMcInnes committed Jan 8, 2025
1 parent 0df9388 commit e5bd854
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 53 deletions.
34 changes: 0 additions & 34 deletions pages/settings/PageSettingsGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -303,40 +303,6 @@ Page {
}
}
}

ListRadioButtonGroup {
//% "Demo mode"
text: qsTrId("settings_demo_mode")
height: implicitHeight + demoModeCaption.height
primaryLabel.anchors.verticalCenterOffset: -(demoModeCaption.height / 2)
dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Gui/DemoMode"
popDestination: undefined // don't pop page automatically.
updateDataOnClick: false // handle option clicked manually.
optionModel: [
{ display: CommonWords.disabled, value: 0 },
//% "ESS demo"
{ display: qsTrId("page_settings_demo_ess"), value: 1 },
//% "Boat/Motorhome demo 1"
{ display: qsTrId("page_settings_demo_1"), value: 2 },
//% "Boat/Motorhome demo 2"
{ display: qsTrId("page_settings_demo_2"), value: 3 },
]

PrimaryListLabel {
id: demoModeCaption

anchors {
bottom: parent.bottom
bottomMargin: Theme.geometry_listItem_content_verticalMargin
}
//% "Starting demo mode will change some settings and the user interface will be unresponsive for a moment."
text: qsTrId("settings_demo_mode_caption")
}
onOptionClicked: function(index) {
Qt.callLater(Global.main.rebuildUi)
dataItem.setValue(index)
}
}
}
}
}
72 changes: 53 additions & 19 deletions pages/settings/debug/PageDebug.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ Page {
}
}

ListText {
//% "Application version"
text: qsTrId("settings_page_debug_application_version")
secondaryText: Theme.applicationVersion
}

ListButton {
id: quitSwitch

Expand All @@ -45,6 +51,21 @@ Page {
onClicked: Qt.quit()
}

ListNavigation {
text: "Power"
onClicked: Global.pageManager.pushPage("/pages/settings/debug/PagePowerDebug.qml", { title: text })
}

ListNavigation {
text: "System data"
onClicked: Global.pageManager.pushPage("/pages/settings/debug/PageSystemData.qml", { title: text })
}

ListNavigation {
text: "Values"
onClicked: Global.pageManager.pushPage("/pages/settings/debug/PageDebugVeQItems.qml", { title: text })
}

SwitchItem {
//% "Enable frame-rate visualizer"
text: qsTrId("settings_page_debug_enable_fps_visualizer")
Expand All @@ -67,26 +88,11 @@ Page {
onClicked: Global.pauseElectronAnimations = !Global.pauseElectronAnimations
}

ListNavigation {
text: "Power"
onClicked: Global.pageManager.pushPage("/pages/settings/debug/PagePowerDebug.qml", { title: text })
}

ListNavigation {
text: "System data"
onClicked: Global.pageManager.pushPage("/pages/settings/debug/PageSystemData.qml", { title: text })
}

ListNavigation {
text: "Test"
onClicked: Global.pageManager.pushPage("/pages/settings/debug/PageSettingsDemo.qml", { title: text })
}

ListNavigation {
text: "Values"
onClicked: Global.pageManager.pushPage("/pages/settings/debug/PageDebugVeQItems.qml", { title: text })
}

// TODO implement when venus-platform provides equivalent of vePlatform.getMemInfo()
/*ListNavigation {
text: "glibc memory"
Expand All @@ -99,10 +105,38 @@ Page {
onClicked: Global.pageManager.pushPage("/pages/settings/debug/PageDebugMemoryQt.qml", { title: text })
}*/

ListText {
//% "Application version"
text: qsTrId("settings_page_debug_application_version")
secondaryText: Theme.applicationVersion
ListRadioButtonGroup {
//% "Demo mode"
text: qsTrId("settings_demo_mode")
height: implicitHeight + demoModeCaption.height
primaryLabel.anchors.verticalCenterOffset: -(demoModeCaption.height / 2)
dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Gui/DemoMode"
popDestination: undefined // don't pop page automatically.
updateDataOnClick: false // handle option clicked manually.
optionModel: [
{ display: CommonWords.disabled, value: 0 },
//% "ESS demo"
{ display: qsTrId("page_settings_demo_ess"), value: 1 },
//% "Boat/Motorhome demo 1"
{ display: qsTrId("page_settings_demo_1"), value: 2 },
//% "Boat/Motorhome demo 2"
{ display: qsTrId("page_settings_demo_2"), value: 3 },
]

PrimaryListLabel {
id: demoModeCaption

anchors {
bottom: parent.bottom
bottomMargin: Theme.geometry_listItem_content_verticalMargin
}
//% "Starting demo mode will change some settings and the user interface will be unresponsive for a moment."
text: qsTrId("settings_demo_mode_caption")
}
onOptionClicked: function(index) {
Qt.callLater(Global.main.rebuildUi)
dataItem.setValue(index)
}
}
}
}
Expand Down

0 comments on commit e5bd854

Please sign in to comment.