Skip to content

Commit

Permalink
ListSwitch UI interaction code should use onClicked not onCheckedChanged
Browse files Browse the repository at this point in the history
Part of #1818
  • Loading branch information
MikeTrahearn-Qinetic committed Jan 29, 2025
1 parent 074ac78 commit e3f787e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/listitems/ListChargeSchedule.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/DvccCommonSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
4 changes: 2 additions & 2 deletions pages/settings/PageSettingsGsm.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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("")
}
Expand All @@ -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("")
Expand Down
4 changes: 2 additions & 2 deletions pages/settings/PageSettingsHub4Peakshaving.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e3f787e

Please sign in to comment.