Fix battery 100% full, but app not alerting, minor cleanup
This commit is contained in:
parent
960750f2a7
commit
1b3920ef03
2 changed files with 7 additions and 10 deletions
|
@ -14,6 +14,10 @@ TARGET = harbour-batterybuddy
|
|||
|
||||
CONFIG += sailfishapp
|
||||
|
||||
HEADERS += \
|
||||
src/battery.h \
|
||||
src/settings.h
|
||||
|
||||
SOURCES += src/harbour-batterybuddy.cpp \
|
||||
src/battery.cpp \
|
||||
src/settings.cpp
|
||||
|
@ -54,7 +58,3 @@ CONFIG += sailfishapp_i18n
|
|||
# following TRANSLATIONS line. And also do not forget to
|
||||
# modify the localized app name in the the .desktop file.
|
||||
TRANSLATIONS += translations/*.ts
|
||||
|
||||
HEADERS += \
|
||||
src/battery.h \
|
||||
src/settings.h
|
||||
|
|
|
@ -58,11 +58,12 @@ Page {
|
|||
running: true
|
||||
repeat: true
|
||||
onTriggered: {
|
||||
if(battery.charge <= settings.lowerLimit && battery.charging === false) {
|
||||
if(battery.charge <= settings.lowerLimit && battery.state === "discharging") {
|
||||
alertLow.play()
|
||||
notification.publish()
|
||||
}
|
||||
else if(battery.charge >= settings.upperLimit && battery.charging === true) {
|
||||
else if(battery.charge >= settings.upperLimit &&
|
||||
(battery.state === "charging" && battery.charging === true) || (battery.state === "idle" && battery.charging === false)) {
|
||||
alertHigh.play()
|
||||
notification.publish()
|
||||
}
|
||||
|
@ -104,10 +105,8 @@ Page {
|
|||
x: Theme.paddingLarge
|
||||
text: qsTr("Battery status")
|
||||
color: Theme.highlightColor
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
}
|
||||
DetailItem {
|
||||
//pixelSize: Theme.fontSizeMedium
|
||||
label: qsTr("Charge level:")+"\n"
|
||||
+qsTr("Charging:")+"\n"
|
||||
+qsTr("Battery state:")
|
||||
|
@ -119,7 +118,6 @@ Page {
|
|||
x: Theme.paddingLarge
|
||||
text: qsTr("Alert levels")
|
||||
color: Theme.highlightColor
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
}
|
||||
Label {
|
||||
x: Theme.paddingLarge*2
|
||||
|
@ -156,7 +154,6 @@ Page {
|
|||
x: Theme.paddingLarge
|
||||
text: qsTr("Alert tests")
|
||||
color: Theme.highlightColor
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
}
|
||||
Label {
|
||||
x: Theme.paddingLarge*2
|
||||
|
|
Loading…
Reference in a new issue