2023-02-28 12:32:37 +00:00
|
|
|
// SPDX-FileCopyrightText: 2022 Yari Polla <skilvingr@gmail.com>
|
|
|
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
|
|
|
|
|
|
import QtQuick 2.15
|
|
|
|
|
|
2023-03-17 02:44:36 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
2025-04-23 09:57:48 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
2023-02-28 12:32:37 +00:00
|
|
|
|
2023-03-17 02:44:36 +00:00
|
|
|
QS.QuickSetting {
|
2023-02-28 12:32:37 +00:00
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
text: i18n("Hotspot")
|
|
|
|
|
icon: "network-wireless-hotspot"
|
|
|
|
|
|
2025-04-23 09:57:48 +00:00
|
|
|
enabled: MobileShell.NetworkInfo.wirelessStatus.hotspotSSID.length !== 0
|
|
|
|
|
status: enabled ? MobileShell.NetworkInfo.wirelessStatus.hotspotSSID : ""
|
2023-02-28 12:32:37 +00:00
|
|
|
|
2023-03-20 10:56:06 +00:00
|
|
|
settingsCommand: "plasma-open-settings kcm_mobile_hotspot"
|
2023-02-28 12:32:37 +00:00
|
|
|
function toggle() {
|
|
|
|
|
if (!enabled) {
|
2025-04-23 09:57:48 +00:00
|
|
|
MobileShell.NetworkInfo.handler.createHotspot();
|
2023-02-28 12:32:37 +00:00
|
|
|
} else {
|
2025-04-23 09:57:48 +00:00
|
|
|
MobileShell.NetworkInfo.handler.stopHotspot();
|
2023-02-28 12:32:37 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|