// KeyPasswordDialog.qml — Modal dialog for encrypted private-key passphrase. import QtQuick import QtQuick.Controls import QtQuick.Layouts import Bobink Dialog { id: keyPasswordDialog property string keyFilePath property bool previousTryWasInvalid: false anchors.centerIn: parent implicitWidth: 400 modal: true standardButtons: Dialog.Ok | Dialog.Cancel title: "Private Key Password" onAccepted: Bobink.provideKeyPassword(passwordField.text) onOpened: { passwordField.text = ""; passwordField.forceActiveFocus(); } onRejected: Bobink.cancelKeyPassword() ColumnLayout { width: parent.width Label { Layout.fillWidth: true text: "Enter the password for:\n" + keyPasswordDialog.keyFilePath wrapMode: Text.Wrap } Label { Layout.fillWidth: true color: "red" text: "Invalid password, please try again." visible: keyPasswordDialog.previousTryWasInvalid } TextField { id: passwordField Layout.fillWidth: true echoMode: TextInput.Password placeholderText: "Password" onAccepted: keyPasswordDialog.accept() } } }