Fix button logic
This commit is contained in:
parent
cc52212eb5
commit
c5dbb6d6a3
2 changed files with 14 additions and 3 deletions
|
@ -132,7 +132,10 @@ Page {
|
|||
id: resumeButton
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: qsTr("Resume")
|
||||
onClicked: battery.chargingEnabled = true
|
||||
onClicked: {
|
||||
battery.chargingEnabled = true
|
||||
settings.limitEnabled = false
|
||||
}
|
||||
enabled: !battery.chargingEnabled
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +145,10 @@ Page {
|
|||
id: pauseButton
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: qsTr("Pause")
|
||||
onClicked: battery.chargingEnabled = false
|
||||
onClicked: {
|
||||
battery.chargingEnabled = false
|
||||
settings.limitEnabled = false
|
||||
}
|
||||
enabled: battery.chargingEnabled
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,12 @@ import "../components"
|
|||
Page {
|
||||
id: settingsPage
|
||||
|
||||
onStatusChanged: {
|
||||
if(status === PageStatus.Activating) {
|
||||
autoStopCharging.checked = settings.notificationsEnabled
|
||||
}
|
||||
}
|
||||
|
||||
SilicaFlickable {
|
||||
anchors.fill: parent
|
||||
contentHeight: header.height + settingsColumn.height + Theme.horizontalPageMargin
|
||||
|
@ -60,7 +66,6 @@ Page {
|
|||
text: qsTr("Stop charging when limit reached")
|
||||
description: qsTr("This option stops charging when battery has reached the percentage set in Charging limit value, and resumes charging when charge has decreased below Continue charge limit value. Generally a value close to the Charging limit value is recommened, such as 80% and 75%.")
|
||||
onCheckedChanged: settings.limitEnabled = checked
|
||||
Component.onCompleted: checked = settings.limitEnabled
|
||||
}
|
||||
|
||||
MySlider {
|
||||
|
|
Loading…
Reference in a new issue