diff --git a/harbour-batterybuddy.pro b/harbour-batterybuddy.pro index aa4b3f7..61b65e6 100644 --- a/harbour-batterybuddy.pro +++ b/harbour-batterybuddy.pro @@ -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 diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index 089212c..5e575cd 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -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