From 75fe59b0da4d15c2e63c070f6f561805af86e5d9 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Sun, 19 Jan 2020 10:06:51 +0100 Subject: mobile-widgets/qml: use strongly typed units in QML Change Settings and DivePlannerSetup to use the strongly typed enums Signed-off-by: jan Iversen Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DivePlannerSetup.qml | 4 ++-- mobile-widgets/qml/Settings.qml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qml/DivePlannerSetup.qml b/mobile-widgets/qml/DivePlannerSetup.qml index d16d02778..7eddd507f 100644 --- a/mobile-widgets/qml/DivePlannerSetup.qml +++ b/mobile-widgets/qml/DivePlannerSetup.qml @@ -10,9 +10,9 @@ import org.kde.kirigami 2.4 as Kirigami Kirigami.ScrollablePage { 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 { - target: PrefUnits + target: Backend onLengthChanged: { spinAscrate75.value = Planner.ascrate75 spinAscrate50.value = Planner.ascrate50 diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml index 29a3f271e..1759b8e8a 100644 --- a/mobile-widgets/qml/Settings.qml +++ b/mobile-widgets/qml/Settings.qml @@ -353,11 +353,11 @@ Kirigami.ScrollablePage { } SsrfSwitch { id: imperialButton - checked: PrefUnits.unit_system === "imperial" - enabled: PrefUnits.unit_system === "metric" + checked: Backend.unit_system === Enums.IMPERIAL + enabled: Backend.unit_system === Enums.METRIC Layout.preferredWidth: gridWidth * 0.25 onClicked: { - PrefUnits.unit_system = "imperial" + Backend.unit_system = Enums.IMPERIAL manager.changesNeedSaving() manager.refreshDiveList() } @@ -368,11 +368,11 @@ Kirigami.ScrollablePage { } SsrfSwitch { id: metricButtton - checked: PrefUnits.unit_system === "metric" - enabled: PrefUnits.unit_system === "imperial" + checked: Backend.unit_system === Enums.METRIC + enabled: Backend.unit_system === Enums.IMPERIAL Layout.preferredWidth: gridWidth * 0.25 onClicked: { - PrefUnits.unit_system = "metric" + Backend.unit_system = Enums.METRIC manager.changesNeedSaving() manager.refreshDiveList() } -- cgit v1.2.3-70-g09d2