shift-shell/kcms/hotspot/ui/main.qml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
2.1 KiB
QML
Raw Normal View History

// SPDX-FileCopyrightText: 2020 Tobias Fella <fella@posteo.de>
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: LGPL-2.0-or-later
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls as Controls
import org.kde.plasma.networkmanagement as PlasmaNM
import org.kde.kirigami as Kirigami
import org.kde.kcmutils
2023-09-21 17:30:04 +00:00
import org.kde.kirigamiaddons.formcard as FormCard
SimpleKCM {
id: root
leftPadding: 0
rightPadding: 0
2023-09-21 17:30:04 +00:00
topPadding: 0
bottomPadding: 0
2023-03-14 14:36:05 +00:00
2023-09-21 17:30:04 +00:00
data: [
PlasmaNM.Handler {
id: handler
2023-09-21 17:30:04 +00:00
},
PlasmaNM.WirelessStatus {
id: wirelessStatus
}
2023-09-21 17:30:04 +00:00
]
2023-09-21 17:30:04 +00:00
ColumnLayout {
spacing: 0
2023-09-21 17:30:04 +00:00
FormCard.FormCard {
Layout.topMargin: Kirigami.Units.gridUnit
2023-09-21 17:30:04 +00:00
FormCard.FormSwitchDelegate {
id: hotspotToggle
text: i18n("Hotspot")
description: i18n("Whether the wireless hotspot is enabled.");
2023-09-21 17:30:04 +00:00
checked: wirelessStatus.hotspotSSID.length !== 0
2023-09-21 17:30:04 +00:00
onToggled: {
if (hotspotToggle.checked) {
handler.createHotspot();
} else {
handler.stopHotspot();
}
}
}
}
2023-09-21 17:30:04 +00:00
FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing
2023-09-21 17:30:04 +00:00
FormCard.FormTextFieldDelegate {
label: i18n("Hotspot SSID")
enabled: !hotspotToggle.checked
text: PlasmaNM.Configuration.hotspotName
onTextChanged: PlasmaNM.Configuration.hotspotName = text
}
2023-09-21 17:30:04 +00:00
FormCard.FormDelegateSeparator {}
2023-09-21 17:30:04 +00:00
FormCard.FormTextFieldDelegate {
label: i18n("Hotspot Password")
enabled: !hotspotToggle.checked
echoMode: TextInput.Password
text: PlasmaNM.Configuration.hotspotPassword
onTextChanged: PlasmaNM.Configuration.hotspotPassword = text
}
}
}
}