feat: sound alerts for battery and pomodoro (#2223)

This commit is contained in:
end-4
2025-10-19 21:37:25 +02:00
committed by GitHub
5 changed files with 107 additions and 10 deletions
@@ -245,6 +245,7 @@ Singleton {
property JsonObject battery: JsonObject {
property int low: 20
property int critical: 5
property int full: 101
property bool automaticSuspend: true
property int suspend: 3
}
@@ -418,13 +419,18 @@ Singleton {
}
}
property JsonObject sounds: JsonObject {
property bool battery: false
property bool pomodoro: false
property string theme: "freedesktop"
}
property JsonObject time: JsonObject {
// https://doc.qt.io/qt-6/qtime.html#toString
property string format: "hh:mm"
property string shortDateFormat: "dd/MM"
property string dateFormat: "ddd, dd/MM"
property JsonObject pomodoro: JsonObject {
property string alertSound: ""
property int breakTime: 300
property int cyclesBeforeLongBreak: 4
property int focus: 1500
@@ -113,6 +113,20 @@ ContentPage {
}
}
}
ConfigRow {
uniform: true
ConfigSpinBox {
icon: "charger"
text: Translation.tr("Full warning")
value: Config.options.battery.full
from: 0
to: 101
stepSize: 5
onValueChanged: {
Config.options.battery.full = value;
}
}
}
}
ContentSection {
@@ -241,6 +255,30 @@ ContentPage {
}
}
ContentSection {
icon: "notification_sound"
title: Translation.tr("Sounds")
ConfigRow {
uniform: true
ConfigSwitch {
buttonIcon: "battery_android_full"
text: Translation.tr("Battery")
checked: Config.options.sounds.battery
onCheckedChanged: {
Config.options.sounds.battery = checked;
}
}
ConfigSwitch {
buttonIcon: "av_timer"
text: Translation.tr("Pomodoro")
checked: Config.options.sounds.pomodoro
onCheckedChanged: {
Config.options.sounds.pomodoro = checked;
}
}
}
}
ContentSection {
icon: "nest_clock_farsight_analog"
title: Translation.tr("Time")