1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-01-26 00:26:40 +00:00
UTPass/qml/dialogs/PassphraseDialog.qml

50 lines
1018 B
QML
Raw Normal View History

import Lomiri.Components 1.3
import Lomiri.Components.Popups 1.3
2025-01-10 15:28:42 +01:00
import QtQuick 2.4
2019-09-20 21:29:39 +02:00
Dialog {
id: passphraseProvider
signal validated(string passphrase)
2025-01-10 15:28:42 +01:00
signal canceled()
2019-09-20 21:29:39 +02:00
function activateFocus() {
2025-01-10 15:28:42 +01:00
passphraseField.forceActiveFocus();
2019-09-20 21:29:39 +02:00
}
2025-01-10 15:28:42 +01:00
title: i18n.tr("Authentication required")
text: i18n.tr("Enter passphrase:")
2019-09-20 21:29:39 +02:00
TextField {
id: passphraseField
placeholderText: i18n.tr("passphrase")
echoMode: TextInput.Password
onAccepted: okButton.clicked(text)
}
Button {
id: okButton
text: i18n.tr("Ok")
color: LomiriColors.green
2019-09-20 21:29:39 +02:00
onClicked: {
2025-01-10 15:28:42 +01:00
validated(passphraseField.text);
passphraseField.text = "";
PopupUtils.close(passphraseProvider);
2019-09-20 21:29:39 +02:00
}
}
Button {
id: cancelButton
2025-01-10 15:28:42 +01:00
text: i18n.tr("Cancel")
color: LomiriColors.red
2019-09-20 21:29:39 +02:00
onClicked: {
2025-01-10 15:28:42 +01:00
canceled();
PopupUtils.close(passphraseProvider);
2019-09-20 21:29:39 +02:00
}
}
2025-01-10 15:28:42 +01:00
2019-09-20 21:29:39 +02:00
}