mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-01 09:18:07 +00:00
kcms/hotspot: Change UX to use a dialog rather than direct textfields
Otherwise it's not obvious to the user whether the changes were saved.
This commit is contained in:
parent
8d564014b5
commit
bcc553325c
1 changed files with 57 additions and 12 deletions
|
|
@ -26,6 +26,43 @@ SimpleKCM {
|
||||||
|
|
||||||
PlasmaNM.WirelessStatus {
|
PlasmaNM.WirelessStatus {
|
||||||
id: wirelessStatus
|
id: wirelessStatus
|
||||||
|
},
|
||||||
|
|
||||||
|
Kirigami.PromptDialog {
|
||||||
|
id: hotspotDialog
|
||||||
|
title: i18n("Configure Hotspot")
|
||||||
|
standardButtons: Kirigami.PromptDialog.Save | Kirigami.PromptDialog.Cancel
|
||||||
|
|
||||||
|
onOpened: {
|
||||||
|
hotspotSsidField.text = PlasmaNM.Configuration.hotspotName;
|
||||||
|
hotspotPasswordField.text = PlasmaNM.Configuration.hotspotPassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
onAccepted: {
|
||||||
|
PlasmaNM.Configuration.hotspotName = hotspotSsidField.text;
|
||||||
|
PlasmaNM.Configuration.hotspotPassword = hotspotPasswordField.text;
|
||||||
|
|
||||||
|
// these properties need to be manually updated since they're not NOTIFYable
|
||||||
|
hotspotSSIDText.description = PlasmaNM.Configuration.hotspotName;
|
||||||
|
hotspotPasswordText.description = PlasmaNM.Configuration.hotspotPassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
Controls.Label {
|
||||||
|
text: i18n('Hotspot SSID:')
|
||||||
|
}
|
||||||
|
Controls.TextField {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
id: hotspotSsidField
|
||||||
|
}
|
||||||
|
Controls.Label {
|
||||||
|
text: i18n('Hotspot Password:')
|
||||||
|
}
|
||||||
|
Controls.TextField {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
id: hotspotPasswordField
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -38,7 +75,7 @@ SimpleKCM {
|
||||||
FormCard.FormSwitchDelegate {
|
FormCard.FormSwitchDelegate {
|
||||||
id: hotspotToggle
|
id: hotspotToggle
|
||||||
text: i18n("Hotspot")
|
text: i18n("Hotspot")
|
||||||
description: i18n("Whether the wireless hotspot is enabled.");
|
description: i18n("Share your internet connection with other devices as a Wi-Fi network.");
|
||||||
|
|
||||||
checked: wirelessStatus.hotspotSSID.length !== 0
|
checked: wirelessStatus.hotspotSSID.length !== 0
|
||||||
|
|
||||||
|
|
@ -52,25 +89,33 @@ SimpleKCM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FormCard.FormHeader {
|
||||||
|
title: i18n("Settings")
|
||||||
|
}
|
||||||
|
|
||||||
FormCard.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||||
Layout.bottomMargin: Kirigami.Units.largeSpacing
|
Layout.bottomMargin: Kirigami.Units.largeSpacing
|
||||||
|
|
||||||
FormCard.FormTextFieldDelegate {
|
FormCard.FormTextDelegate {
|
||||||
label: i18n("Hotspot SSID")
|
id: hotspotSSIDText
|
||||||
enabled: !hotspotToggle.checked
|
text: i18n("Hotspot SSID")
|
||||||
text: PlasmaNM.Configuration.hotspotName
|
description: PlasmaNM.Configuration.hotspotName
|
||||||
onTextChanged: PlasmaNM.Configuration.hotspotName = text
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FormCard.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
FormCard.FormTextFieldDelegate {
|
FormCard.FormTextDelegate {
|
||||||
label: i18n("Hotspot Password")
|
id: hotspotPasswordText
|
||||||
enabled: !hotspotToggle.checked
|
text: i18n("Hotspot Password")
|
||||||
echoMode: TextInput.Password
|
description: PlasmaNM.Configuration.hotspotPassword
|
||||||
text: PlasmaNM.Configuration.hotspotPassword
|
}
|
||||||
onTextChanged: PlasmaNM.Configuration.hotspotPassword = text
|
|
||||||
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
|
text: i18n('Configure')
|
||||||
|
onClicked: hotspotDialog.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue