Make audio quieter, add test notification text, mabe buttons translatable
This commit is contained in:
parent
23eb888dc9
commit
746b4adbd7
1 changed files with 12 additions and 5 deletions
|
@ -28,24 +28,27 @@ Page {
|
||||||
|
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
id: alertLow
|
id: alertLow
|
||||||
audioRole: MediaPlayer.NotificationRole
|
audioRole: MediaPlayer.AlarmRole
|
||||||
|
volume: 0.5
|
||||||
autoLoad: true
|
autoLoad: true
|
||||||
source: settings.lowAlertFile
|
source: settings.lowAlertFile
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
id: alertHigh
|
id: alertHigh
|
||||||
audioRole: MediaPlayer.NotificationRole
|
audioRole: MediaPlayer.AlarmRole
|
||||||
|
volume: 0.5
|
||||||
autoLoad: true
|
autoLoad: true
|
||||||
source: settings.highAlertFile
|
source: settings.highAlertFile
|
||||||
}
|
}
|
||||||
|
|
||||||
Notification {
|
Notification {
|
||||||
id: notification
|
id: notification
|
||||||
|
property bool test: false
|
||||||
appName: qsTr("Battery Buddy")
|
appName: qsTr("Battery Buddy")
|
||||||
appIcon: "/usr/share/icons/hicolor/128x128/apps/harbour-batterybuddy.png"
|
appIcon: "/usr/share/icons/hicolor/128x128/apps/harbour-batterybuddy.png"
|
||||||
summary: qsTr("Battery charge", "Battery charge 20%") +" "+ battery.charge + "%"
|
summary: qsTr("Battery charge", "Battery charge 20%") +" "+ battery.charge + "%"
|
||||||
body: battery.charging ? qsTr("Please disconnect the charger.") : qsTr("Please connect the charger.")
|
body: test ? qsTr("This is a test.") : battery.charging ? qsTr("Please disconnect the charger.") : qsTr("Please connect the charger.")
|
||||||
previewSummary: summary
|
previewSummary: summary
|
||||||
previewBody: body
|
previewBody: body
|
||||||
}
|
}
|
||||||
|
@ -169,10 +172,12 @@ Page {
|
||||||
height: lowButton.height
|
height: lowButton.height
|
||||||
Button {
|
Button {
|
||||||
id: lowButton
|
id: lowButton
|
||||||
text: "Low"
|
text: qsTr("Discharged")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
alertLow.play()
|
alertLow.play()
|
||||||
|
notification.test = true
|
||||||
notification.publish()
|
notification.publish()
|
||||||
|
notification.test = false
|
||||||
}
|
}
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
|
@ -182,10 +187,12 @@ Page {
|
||||||
width: parent.width / 2
|
width: parent.width / 2
|
||||||
height: lowButton.height
|
height: lowButton.height
|
||||||
Button {
|
Button {
|
||||||
text: "High"
|
text: qsTr("Charged")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
alertHigh.play()
|
alertHigh.play()
|
||||||
|
notification.test = true
|
||||||
notification.publish()
|
notification.publish()
|
||||||
|
notification.test = false
|
||||||
}
|
}
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue