2
* Copyright (C) 2014 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Arto Jalkanen <ajalkane@gmail.com>
19
import Ubuntu.Components 1.3
20
import Ubuntu.Components.Popups 1.3
25
title: i18n.tr("Authentication required")
27
text: i18n.tr("Enter passcode or passphrase:")
29
signal passwordEntered(string password)
32
// Due to several different things forcing focus
33
// on creation, we simply create this timer to
34
// work around that (see bugs #1488481 and #1499994)
38
onTriggered: passwordField.forceActiveFocus()
41
Component.onCompleted: {
42
passwordField.forceActiveFocus();
47
objectName: "inputField"
48
placeholderText: i18n.tr("passcode or passphrase")
49
echoMode: TextInput.Password
51
onAccepted: okButton.clicked(text)
56
objectName: "okButton"
59
color: UbuntuColors.green
62
passwordEntered(passwordField.text)
63
passwordField.text = "";
69
objectName: "cancelButton"
70
text: i18n.tr("Cancel")
72
color: UbuntuColors.red