Skip to content

Commit

Permalink
Fix multiple notifications (hopefully), add screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
direc85 committed Feb 11, 2019
1 parent 03960a5 commit c4b2ccd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
29 changes: 18 additions & 11 deletions qml/pages/MainPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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()
}
}
}

Expand Down Expand Up @@ -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 {
Expand All @@ -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
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions rpm/harbour-batterybuddy.changes
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
# * date Author's Name <author's email> version-release
# - Summary of changes

* Sun Feb 10 2019 Matti Viljanen (direc85) <[email protected]> 1.2-1
- Don't stop media playback
* Mon Feb 11 2019 Matti Viljanen (direc85) <[email protected]> 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) <[email protected]> 1.1-1
- Slider values are now saved
Expand Down
Binary file added screenshot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c4b2ccd

Please sign in to comment.