2023-03-14 02:26:52 +00:00
|
|
|
/*
|
|
|
|
|
SPDX-FileCopyrightText: 2020 Tobias Fella <fella@posteo.de>
|
|
|
|
|
|
|
|
|
|
SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import QtQuick 2.6
|
|
|
|
|
import QtQuick.Layouts 1.2
|
|
|
|
|
import QtQuick.Controls 2.2 as Controls
|
|
|
|
|
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
|
|
|
|
|
import org.kde.kirigami 2.10 as Kirigami
|
|
|
|
|
import org.kde.kcm 1.2
|
|
|
|
|
|
|
|
|
|
SimpleKCM {
|
|
|
|
|
|
|
|
|
|
PlasmaNM.Handler {
|
|
|
|
|
id: handler
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-14 14:36:05 +00:00
|
|
|
PlasmaNM.WirelessStatus {
|
|
|
|
|
id: wirelessStatus
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-14 02:26:52 +00:00
|
|
|
Kirigami.FormLayout {
|
|
|
|
|
Controls.Switch {
|
|
|
|
|
id: hotspotToggle
|
|
|
|
|
Kirigami.FormData.label: i18n("Enabled:")
|
2023-03-14 14:36:05 +00:00
|
|
|
checked: wirelessStatus.hotspotSSID.length !== 0
|
2023-03-14 02:26:52 +00:00
|
|
|
onToggled: {
|
|
|
|
|
if (hotspotToggle.checked) {
|
2023-03-14 14:36:05 +00:00
|
|
|
handler.createHotspot();
|
2023-03-14 02:26:52 +00:00
|
|
|
} else {
|
2023-03-14 14:36:05 +00:00
|
|
|
handler.stopHotspot();
|
2023-03-14 02:26:52 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Controls.TextField {
|
|
|
|
|
id: hotspotName
|
|
|
|
|
Kirigami.FormData.label: i18n("SSID:")
|
|
|
|
|
text: PlasmaNM.Configuration.hotspotName
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Kirigami.PasswordField {
|
|
|
|
|
id: hotspotPassword
|
|
|
|
|
Kirigami.FormData.label: i18n("Password:")
|
|
|
|
|
text: PlasmaNM.Configuration.hotspotPassword
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Controls.Button {
|
|
|
|
|
text: i18n("Save")
|
|
|
|
|
onClicked: {
|
|
|
|
|
PlasmaNM.Configuration.hotspotName = hotspotName.text
|
|
|
|
|
PlasmaNM.Configuration.hotspotPassword = hotspotPassword.text
|
|
|
|
|
if (hotspotToggle.checked) {
|
|
|
|
|
handler.stopHotspot()
|
|
|
|
|
handler.createHotspot()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|