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-09-23 23:27:13 +00:00
|
|
|
import org.kde.plasma.networkmanagement as PlasmaNM
|
2023-03-17 02:44:36 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
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
|
|
|
|
|
|
|
|
|
|
PlasmaNM.Handler {
|
|
|
|
|
id: nmHandler
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-01 17:30:33 +00:00
|
|
|
PlasmaNM.WirelessStatus {
|
|
|
|
|
id: wirelessStatus
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-28 12:32:37 +00:00
|
|
|
text: i18n("Hotspot")
|
|
|
|
|
icon: "network-wireless-hotspot"
|
|
|
|
|
|
2023-03-01 17:30:33 +00:00
|
|
|
enabled: wirelessStatus.hotspotSSID.length !== 0
|
|
|
|
|
status: enabled ? 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) {
|
|
|
|
|
nmHandler.createHotspot();
|
|
|
|
|
} else {
|
|
|
|
|
nmHandler.stopHotspot();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|