mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
The implementation of do-not-disturb broke after the port to our own notification popups. Since the notification widget is quite deep in the ActionDrawer, just implement the DBus listening directly in NotificationsWidget. Also add the missing pulseAudio object in NotificationPopupProvider to implement notification inhibition.
39 lines
948 B
QML
39 lines
948 B
QML
/*
|
|
SPDX-FileCopyrightText: 2017, 2019 Kai Uwe Broulik <kde@privat.broulik.de>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
*/
|
|
|
|
import QtQuick 2.2
|
|
|
|
import org.kde.plasma.private.volume 0.1
|
|
|
|
QtObject {
|
|
id: pulseAudio
|
|
|
|
readonly property string notificationStreamId: "sink-input-by-media-role:event"
|
|
|
|
property QtObject notificationStream
|
|
|
|
property QtObject instantiator: Instantiator {
|
|
model: StreamRestoreModel {}
|
|
|
|
delegate: QtObject {
|
|
readonly property string name: Name
|
|
readonly property bool muted: Muted
|
|
|
|
function mute() {
|
|
Muted = true
|
|
}
|
|
function unmute() {
|
|
Muted = false
|
|
}
|
|
}
|
|
|
|
onObjectAdded: (index, object) => {
|
|
if (object.name === notificationStreamId) {
|
|
notificationStream = object;
|
|
}
|
|
}
|
|
}
|
|
}
|