mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
We currently create several instances of the plasma-nm objects over the shell. Use a single singleton to avoid having to load it multiple times.
24 lines
854 B
QML
24 lines
854 B
QML
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
import QtQuick 2.15
|
|
|
|
import org.kde.plasma.networkmanagement as PlasmaNM
|
|
import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
|
|
|
QS.QuickSetting {
|
|
PlasmaNM.EnabledConnections {
|
|
id: enabledConnections
|
|
}
|
|
|
|
text: i18n("Wi-Fi")
|
|
status: enabledConnections.wirelessEnabled ? MobileShell.NetworkInfo.wirelessStatus.wifiSSID : ""
|
|
icon: enabledConnections.wirelessEnabled ? "network-wireless" : "network-wireless-disconnected"
|
|
settingsCommand: "plasma-open-settings kcm_mobile_wifi"
|
|
enabled: enabledConnections.wirelessEnabled
|
|
|
|
function toggle() {
|
|
MobileShell.NetworkInfo.handler.enableWireless(!enabledConnections.wirelessEnabled);
|
|
}
|
|
}
|