mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-02 17:54:45 +00:00
quicksettings: add hotspot quicksetting
This commit is contained in:
parent
6d1aeae654
commit
d37324ee43
3 changed files with 70 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ plasma_install_package(keyboardtoggle org.kde.plasma.quicksetting.keyboardtoggle
|
||||||
plasma_install_package(mobiledata org.kde.plasma.quicksetting.mobiledata quicksettings)
|
plasma_install_package(mobiledata org.kde.plasma.quicksetting.mobiledata quicksettings)
|
||||||
plasma_install_package(settingsapp org.kde.plasma.quicksetting.settingsapp quicksettings)
|
plasma_install_package(settingsapp org.kde.plasma.quicksetting.settingsapp quicksettings)
|
||||||
plasma_install_package(wifi org.kde.plasma.quicksetting.wifi quicksettings)
|
plasma_install_package(wifi org.kde.plasma.quicksetting.wifi quicksettings)
|
||||||
|
plasma_install_package(hotspot org.kde.plasma.quicksetting.hotspot quicksettings)
|
||||||
add_subdirectory(flashlight)
|
add_subdirectory(flashlight)
|
||||||
add_subdirectory(nightcolor)
|
add_subdirectory(nightcolor)
|
||||||
add_subdirectory(powermenu)
|
add_subdirectory(powermenu)
|
||||||
|
|
|
||||||
46
quicksettings/hotspot/contents/ui/main.qml
Normal file
46
quicksettings/hotspot/contents/ui/main.qml
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
// SPDX-FileCopyrightText: 2022 Yari Polla <skilvingr@gmail.com>
|
||||||
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||||
|
|
||||||
|
import QtQuick 2.15
|
||||||
|
|
||||||
|
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
|
||||||
|
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
||||||
|
|
||||||
|
MobileShell.QuickSetting {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
readonly property string defaultStatus: i18n("Tap to enable hotspot")
|
||||||
|
|
||||||
|
PlasmaNM.Handler {
|
||||||
|
id: nmHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
text: i18n("Hotspot")
|
||||||
|
icon: "network-wireless-hotspot"
|
||||||
|
|
||||||
|
enabled: false
|
||||||
|
status: defaultStatus
|
||||||
|
|
||||||
|
function toggle() {
|
||||||
|
if (!enabled) {
|
||||||
|
nmHandler.createHotspot();
|
||||||
|
} else {
|
||||||
|
nmHandler.stopHotspot();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: nmHandler
|
||||||
|
|
||||||
|
function onHotspotCreated() {
|
||||||
|
root.enabled = true;
|
||||||
|
root.status = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function onHotspotDisabled() {
|
||||||
|
root.enabled = false;
|
||||||
|
root.status = defaultStatus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
23
quicksettings/hotspot/metadata.json
Normal file
23
quicksettings/hotspot/metadata.json
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"KPlugin": {
|
||||||
|
"Authors": [
|
||||||
|
{
|
||||||
|
"Email": "skilvingr@gmail.com",
|
||||||
|
"Name": "Yari Polla",
|
||||||
|
"Name[x-test]": "xxYari Pollaxx"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Description": "Hotspot quick setting for Plasma Mobile",
|
||||||
|
"Description[x-test]": "xxHotspot quick setting for Plasma Mobilexx",
|
||||||
|
"Icon": "network-wireless-hotspot",
|
||||||
|
"Id": "org.kde.plasma.quicksetting.hotspot",
|
||||||
|
"License": "GPL-2.0+",
|
||||||
|
"Name": "Hotspot",
|
||||||
|
"Name[x-test]": "xxHotspotxx",
|
||||||
|
"ServiceTypes": [
|
||||||
|
"KPackage/GenericQML"
|
||||||
|
],
|
||||||
|
"Version": "0.1",
|
||||||
|
"Website": "https://kde.org"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue