Fix device logout dialog

This commit is contained in:
Tobias Fella
2023-11-03 22:06:14 +00:00
parent 52e2d636b9
commit 1cf891f845

View File

@@ -59,26 +59,33 @@ FormCard.FormCardPage {
visible: !root.connection visible: !root.connection
} }
property Kirigami.OverlaySheet passwordSheet: Kirigami.OverlaySheet { property Kirigami.Dialog passwordSheet: Kirigami.Dialog {
id: passwordSheet id: passwordSheet
property string deviceId property string deviceId
preferredWidth: Kirigami.Units.gridUnit * 24
title: i18n("Remove device") title: i18n("Remove device")
Kirigami.FormLayout {
QQC2.TextField { standardButtons: QQC2.Dialog.Cancel
FormCard.FormCard {
FormCard.FormTextFieldDelegate {
id: passwordField id: passwordField
Kirigami.FormData.label: i18n("Password:") label: i18n("Password:")
echoMode: TextInput.Password echoMode: TextInput.Password
} }
QQC2.Button { }
text: i18n("Confirm") customFooterActions: [
onClicked: { Kirigami.Action {
text: i18nc("As in 'Remove this device'", "Remove")
icon.name: "delete"
onTriggered: {
devicesModel.logout(passwordSheet.deviceId, passwordField.text) devicesModel.logout(passwordSheet.deviceId, passwordField.text)
passwordField.text = "" passwordField.text = ""
passwordSheet.close() passwordSheet.close()
} }
} }
} ]
} }
} }