diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index 6923cba..780469c 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -59,6 +59,16 @@ Page { previewSummary: summary previewBody: body urgency: Notification.Critical + function republish() { + if(replacesId > 0) + close() + publish() + } + function republishTest() { + test = true + republish() + test = false + } } Timer { @@ -69,15 +79,16 @@ Page { onTriggered: { if(battery.charge <= settings.lowerLimit && battery.state === "discharging") { alertLow.play() - notification.publish() + notification.republish() } else if(battery.charge >= settings.upperLimit && (battery.state === "charging" && battery.charging === true) || (battery.state === "idle" && battery.charging === false)) { alertHigh.play() - notification.publish() + notification.republish() } - else + else if(notification.replacesId > 0) { notification.close() + } } } @@ -179,14 +190,12 @@ Page { height: lowButton.height Button { id: lowButton + anchors.centerIn: parent text: qsTr("Discharged") onClicked: { alertLow.play() - notification.test = true - notification.publish() - notification.test = false + notification.republishTest() } - anchors.centerIn: parent } } Item { @@ -195,13 +204,11 @@ Page { height: lowButton.height Button { text: qsTr("Charged") + anchors.centerIn: parent onClicked: { alertHigh.play() - notification.test = true - notification.publish() - notification.test = false + notification.republishTest() } - anchors.centerIn: parent } } } diff --git a/rpm/harbour-batterybuddy.changes b/rpm/harbour-batterybuddy.changes index 0e363f4..643b16e 100644 --- a/rpm/harbour-batterybuddy.changes +++ b/rpm/harbour-batterybuddy.changes @@ -12,11 +12,12 @@ # * date Author's Name version-release # - Summary of changes -* Sun Feb 10 2019 Matti Viljanen (direc85) 1.2-1 -- Don't stop media playback +* Mon Feb 11 2019 Matti Viljanen (direc85) 1.2-1 +- Alert doesn't stop media playback - Add battery graphic - Redesign cover page - Poll changes more often +- Fix multiple notifications (hopefully) * Tue Jan 8 2019 Matti Viljanen (direc85) 1.1-1 - Slider values are now saved diff --git a/screenshot1.png b/screenshot1.png new file mode 100644 index 0000000..79b0b4e Binary files /dev/null and b/screenshot1.png differ diff --git a/screenshot2.png b/screenshot2.png new file mode 100644 index 0000000..b930314 Binary files /dev/null and b/screenshot2.png differ diff --git a/screenshot3.png b/screenshot3.png new file mode 100644 index 0000000..3f6ba3b Binary files /dev/null and b/screenshot3.png differ