mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-08 01:56:17 +00:00
mobile-widgets/qml: use strongly typed units in QML
Change Settings and DivePlannerSetup to use the strongly typed enums Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
25a5be0fe9
commit
75fe59b0da
2 changed files with 8 additions and 8 deletions
|
@ -10,9 +10,9 @@ import org.kde.kirigami 2.4 as Kirigami
|
||||||
Kirigami.ScrollablePage {
|
Kirigami.ScrollablePage {
|
||||||
title: qsTr("Dive planner setup")
|
title: qsTr("Dive planner setup")
|
||||||
|
|
||||||
property string speedUnit: (PrefUnits.length === "meters") ? qsTr("m/min") : qsTr("ft/min")
|
property string speedUnit: (Backend.length === Enums.METERS) ? qsTr("m/min") : qsTr("ft/min")
|
||||||
Connections {
|
Connections {
|
||||||
target: PrefUnits
|
target: Backend
|
||||||
onLengthChanged: {
|
onLengthChanged: {
|
||||||
spinAscrate75.value = Planner.ascrate75
|
spinAscrate75.value = Planner.ascrate75
|
||||||
spinAscrate50.value = Planner.ascrate50
|
spinAscrate50.value = Planner.ascrate50
|
||||||
|
|
|
@ -353,11 +353,11 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
SsrfSwitch {
|
SsrfSwitch {
|
||||||
id: imperialButton
|
id: imperialButton
|
||||||
checked: PrefUnits.unit_system === "imperial"
|
checked: Backend.unit_system === Enums.IMPERIAL
|
||||||
enabled: PrefUnits.unit_system === "metric"
|
enabled: Backend.unit_system === Enums.METRIC
|
||||||
Layout.preferredWidth: gridWidth * 0.25
|
Layout.preferredWidth: gridWidth * 0.25
|
||||||
onClicked: {
|
onClicked: {
|
||||||
PrefUnits.unit_system = "imperial"
|
Backend.unit_system = Enums.IMPERIAL
|
||||||
manager.changesNeedSaving()
|
manager.changesNeedSaving()
|
||||||
manager.refreshDiveList()
|
manager.refreshDiveList()
|
||||||
}
|
}
|
||||||
|
@ -368,11 +368,11 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
SsrfSwitch {
|
SsrfSwitch {
|
||||||
id: metricButtton
|
id: metricButtton
|
||||||
checked: PrefUnits.unit_system === "metric"
|
checked: Backend.unit_system === Enums.METRIC
|
||||||
enabled: PrefUnits.unit_system === "imperial"
|
enabled: Backend.unit_system === Enums.IMPERIAL
|
||||||
Layout.preferredWidth: gridWidth * 0.25
|
Layout.preferredWidth: gridWidth * 0.25
|
||||||
onClicked: {
|
onClicked: {
|
||||||
PrefUnits.unit_system = "metric"
|
Backend.unit_system = Enums.METRIC
|
||||||
manager.changesNeedSaving()
|
manager.changesNeedSaving()
|
||||||
manager.refreshDiveList()
|
manager.refreshDiveList()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue