Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/global/PulseAudio.qml
- This file was moved from applets/notifications/package/contents/config/config.qml.
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright 2014 Kai Uwe Broulik <kde@privat.broulik.de> | 2 | * Copyright 2017, 2019 Kai Uwe Broulik <kde@privat.broulik.de> | ||
3 | * | 3 | * | ||
4 | * This program is free software; you can redistribute it and/or | 4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License as | 5 | * modify it under the terms of the GNU General Public License as | ||
6 | * published by the Free Software Foundation; either version 2 of | 6 | * published by the Free Software Foundation; either version 2 of | ||
7 | * the License or (at your option) version 3 or any later version | 7 | * the License or (at your option) version 3 or any later version | ||
8 | * accepted by the membership of KDE e.V. (or its successor approved | 8 | * accepted by the membership of KDE e.V. (or its successor approved | ||
9 | * by the membership of KDE e.V.), which shall act as a proxy | 9 | * by the membership of KDE e.V.), which shall act as a proxy | ||
10 | * defined in Section 14 of version 3 of the license. | 10 | * defined in Section 14 of version 3 of the license. | ||
11 | * | 11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | 12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. | ||
16 | * | 16 | * | ||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/> | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/> | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.2 | ||
22 | 22 | | |||
23 | import org.kde.plasma.configuration 2.0 | 23 | import org.kde.plasma.private.volume 0.1 | ||
24 | 24 | | |||
25 | ConfigModel { | 25 | QtObject { | ||
26 | ConfigCategory { | 26 | id: pulseAudio | ||
27 | name: i18n("Information") | 27 | | ||
28 | icon: "preferences-desktop-notification-bell" | 28 | readonly property string notificationStreamId: "sink-input-by-media-role:event" | ||
29 | source: "configNotifications.qml" | 29 | | ||
30 | property QtObject notificationStream | ||||
31 | | ||||
32 | property QtObject instantiator: Instantiator { | ||||
33 | model: StreamRestoreModel {} | ||||
34 | | ||||
35 | delegate: QtObject { | ||||
36 | readonly property string name: Name | ||||
37 | readonly property bool muted: Muted | ||||
38 | | ||||
39 | function mute() { | ||||
40 | Muted = true | ||||
41 | } | ||||
42 | function unmute() { | ||||
43 | Muted = false | ||||
44 | } | ||||
45 | } | ||||
46 | | ||||
47 | onObjectAdded: { | ||||
48 | if (object.name === notificationStreamId) { | ||||
49 | notificationStream = object; | ||||
50 | } | ||||
51 | } | ||||
30 | } | 52 | } | ||
31 | } | 53 | } |