From 8dff0511fe539b29c2077c954c5ab358f811976a Mon Sep 17 00:00:00 2001 From: Mike Trahearn Date: Fri, 17 Jan 2025 11:31:58 +1000 Subject: [PATCH] ListSwitch UI interaction code should use onClicked not onCheckedChanged Part of #1818 --- components/listitems/ListChargeSchedule.qml | 2 +- pages/settings/DvccCommonSettings.qml | 2 +- pages/settings/PageSettingsGsm.qml | 4 ++-- pages/settings/PageSettingsHub4Peakshaving.qml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/listitems/ListChargeSchedule.qml b/components/listitems/ListChargeSchedule.qml index 25f669da9..cd7055768 100644 --- a/components/listitems/ListChargeSchedule.qml +++ b/components/listitems/ListChargeSchedule.qml @@ -115,7 +115,7 @@ ListNavigation { text: CommonWords.enabled checked: itemDay.isValid && itemDay.value >= 0 checkable: true - onCheckedChanged: { + onClicked: { if (checked ^ itemDay.value >= 0) { itemDay.setValue(toggleDay(itemDay.value)) } diff --git a/pages/settings/DvccCommonSettings.qml b/pages/settings/DvccCommonSettings.qml index 5c8ae0fcf..f3a4ece45 100644 --- a/pages/settings/DvccCommonSettings.qml +++ b/pages/settings/DvccCommonSettings.qml @@ -17,7 +17,7 @@ Column { text: qsTrId("settings_dvcc_dvcc") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Services/Bol" - onCheckedChanged: { + onClicked: { if (dataItem.isValid && !checked) { //% "Make sure to also reset the VE.Bus system after disabling DVCC" Global.showToastNotification(VenusOS.Notification_Info, qsTrId("settings_dvcc_switch_reset_vebus_after_disabling_dvcc")) diff --git a/pages/settings/PageSettingsGsm.qml b/pages/settings/PageSettingsGsm.qml index 594f42dff..bc1e8424a 100644 --- a/pages/settings/PageSettingsGsm.qml +++ b/pages/settings/PageSettingsGsm.qml @@ -168,7 +168,7 @@ Page { text: qsTrId("page_settings_gsm_use_default_apn") checked: apnSetting.value === "" checkable: true - onCheckedChanged: { + onClicked: { if (apnSetting.isValid && checked) { apnSetting.setValue("") } @@ -194,7 +194,7 @@ Page { text: qsTrId("page_settings_gsm_use_authentication") checked: authUser.value !== "" && authPass.value !== "" checkable: true - onCheckedChanged: { + onClicked: { if (!checked) { authUser.dataItem.setValue("") authPass.dataItem.setValue("") diff --git a/pages/settings/PageSettingsHub4Peakshaving.qml b/pages/settings/PageSettingsHub4Peakshaving.qml index bd08b2844..8e5917449 100644 --- a/pages/settings/PageSettingsHub4Peakshaving.qml +++ b/pages/settings/PageSettingsHub4Peakshaving.qml @@ -87,7 +87,7 @@ Page { checkable: true checked: systemAcInputLimit.value >= 0 enabled: userHasWriteAccess && withoutGridMeterItem.value === 0 && overruledShoreLimit.seen - onCheckedChanged: { + onClicked: { if (checked && systemAcInputLimit.value < 0) { systemAcInputLimit.setValue(40) } else if (!checked && systemAcInputLimit.value >= 0) { @@ -128,7 +128,7 @@ Page { checkable: true checked: systemAcExportLimit.value >= 0 enabled: userHasWriteAccess && withoutGridMeterItem.value === 0 - onCheckedChanged: { + onClicked: { if (checked && systemAcExportLimit.value < 0) { systemAcExportLimit.setValue(40) } else if (!checked && systemAcExportLimit.value >= 0) {