shift-shell/quicksettings/donotdisturb/contents/ui/main.qml
Devin Lin f25840bfc2 mobileshellstate: Move to DBus API instead of trying to use shared QML context
This also allows us to trigger behaviour from other processes that import mobileshell
2023-03-19 18:32:52 -07:00

20 lines
596 B
QML

/*
* SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick
import org.kde.plasma.private.mobileshell.state as MobileShellState
import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
QS.QuickSetting {
text: i18n("Do Not Disturb")
icon: enabled ? "notifications-disabled" : "notifications"
status: ""
enabled: MobileShellState.ShellDBusClient.doNotDisturb
function toggle() {
MobileShellState.ShellDBusClient.doNotDisturb = !MobileShellState.ShellDBusClient.doNotDisturb;
}
}