Fix multiple notifications (hopefully), add screenshots

This commit is contained in:
Matti Viljanen 2019-02-11 14:03:00 +02:00
parent 03960a5636
commit c4b2ccd87b
No known key found for this signature in database
GPG key ID: CF32A1495158F888
5 changed files with 21 additions and 13 deletions

View file

@ -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
}
}
}

View file

@ -12,11 +12,12 @@
# * date Author's Name <author's email> version-release
# - Summary of changes
* Sun Feb 10 2019 Matti Viljanen (direc85) <matti.viljanen@kapsi.fi> 1.2-1
- Don't stop media playback
* Mon Feb 11 2019 Matti Viljanen (direc85) <matti.viljanen@kapsi.fi> 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) <matti.viljanen@kapsi.fi> 1.1-1
- Slider values are now saved

BIN
screenshot1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 KiB

BIN
screenshot2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

BIN
screenshot3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB