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
2019-10-07 18:18:50 +02:00

52 lines
1.0 KiB
QML

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: {
passphraseField.text = ""
canceled()
PopupUtils.close(passphraseProvider)
}
}
}