battery: send notifications via dbus instead of internal service or notify-send
This commit is contained in:
parent
88f14b26cd
commit
2acb4e70ad
3 changed files with 21 additions and 31 deletions
|
|
@ -48,33 +48,6 @@ QtObject {
|
|||
dnd = !dnd;
|
||||
}
|
||||
|
||||
// Internal notifications - no D-Bus roundtrip needed
|
||||
property int _nextInternalId: -1
|
||||
|
||||
function send(summary, body, urgency, appIcon) {
|
||||
const id = _nextInternalId--;
|
||||
const item = _itemComp.createObject(root, {
|
||||
id: id,
|
||||
summary: summary,
|
||||
body: body || "",
|
||||
appName: "nova-shell",
|
||||
appIcon: appIcon || "",
|
||||
image: "",
|
||||
hints: {},
|
||||
urgency: urgency ?? NotificationUrgency.Normal,
|
||||
actions: [],
|
||||
time: Date.now(),
|
||||
popup: true
|
||||
});
|
||||
|
||||
_byId[id] = item;
|
||||
list = [item, ...list];
|
||||
|
||||
const timeout = Modules.notifications.timeout || 3000;
|
||||
item._expireTimer.interval = urgency === NotificationUrgency.Critical ? timeout * 3 : timeout;
|
||||
item._expireTimer.running = true;
|
||||
}
|
||||
|
||||
function _changed() {
|
||||
list = list.slice();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue