2022-09-10 16:41:08 +00:00
|
|
|
/*
|
|
|
|
|
* SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
2022-11-11 16:21:12 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
|
2023-03-17 02:44:36 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
2022-09-10 16:41:08 +00:00
|
|
|
|
2023-03-17 02:44:36 +00:00
|
|
|
QS.QuickSetting {
|
2022-09-10 16:41:08 +00:00
|
|
|
text: i18n("Do Not Disturb")
|
2022-09-10 17:56:01 +00:00
|
|
|
icon: enabled ? "notifications-disabled" : "notifications"
|
2022-09-10 16:41:08 +00:00
|
|
|
status: ""
|
2022-11-11 16:21:12 +00:00
|
|
|
enabled: MobileShellState.TopPanelControls.notificationsWidget && MobileShellState.TopPanelControls.notificationsWidget.doNotDisturbModeEnabled
|
|
|
|
|
available: MobileShellState.TopPanelControls.notificationsWidget
|
2022-09-10 16:41:08 +00:00
|
|
|
|
|
|
|
|
function toggle() {
|
2022-11-11 16:21:12 +00:00
|
|
|
if (MobileShellState.TopPanelControls.notificationsWidget) {
|
|
|
|
|
MobileShellState.TopPanelControls.notificationsWidget.toggleDoNotDisturbMode();
|
2022-09-10 16:41:08 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|