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/CredDialog.qml

64 lines
1.3 KiB
QML
Raw Permalink Normal View History

2019-10-07 15:59:55 +00:00
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
Dialog {
id: credProvider
title: i18n.tr("Authentication required")
text_user: i18n.tr("Enter user :")
text_password: i18n.tr("Enter password :")
signal validated(string user, string password)
signal canceled
function activateFocus() {
user.forceActiveFocus()
}
TextField {
id: userField
placeholderText: i18n.tr("user")
echoMode: TextInput.Password
onAccepted: passwordField.forceActiveFocus()
}
TextField {
id: passwordField
placeholderText: i18n.tr("password")
echoMode: TextInput.Password
onAccepted: okButton.clicked(text)
}
Button {
id: okButton
text: i18n.tr("Ok")
color: UbuntuColors.green
onClicked: {
validated(userField.text, passwordField.text)
userField.text = ""
passwordField.text = ""
PopupUtils.close(credProvider)
}
}
Button {
id: cancelButton
text: i18n.tr("Cancel")
color: UbuntuColors.red
onClicked: {
userField.text = ""
passwordField.text = ""
canceled()
PopupUtils.close(credProvider)
}
}
}