This repository has been archived on 2024-05-25. You can view files and clone it, but cannot push or open issues or pull requests.
UTPass/qml/dialogs/PassphraseDialog.qml

51 lines
1011 B
QML
Raw Normal View History

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