2
* This file is part of Checkbox
4
* Copyright 2015 Canonical Ltd.
7
* - Maciej Kisielewski <maciej.kisielewski@canonical.com>
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; version 3.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
import Ubuntu.Components 1.1
23
import Ubuntu.Components.Popups 0.1
25
/*! \brief Password prompt dialog.
28
This component is a prompt for user's password.
34
This alias aids the process of popping up the dialog.
35
Usage: PopupUtils.open(passwordDialog.dialogComponent);
37
property alias dialogComponent: component
39
signal passwordEntered(string password)
40
signal dialogCancelled
47
title: i18n.tr("Enter password")
53
placeholderText: i18n.tr("password")
54
echoMode: TextInput.Password
55
onAccepted: okButton.clicked(text)
61
color: UbuntuColors.green
63
PopupUtils.close(dialog);
64
// once qml pam authentication goes live, we might want to
65
// check if the password is correct in some QML-ish manner
66
passwordEntered(passwordBox.text);
67
passwordBox.text = "";
72
text: i18n.tr("Cancel")
73
color: UbuntuColors.red
75
passwordBox.text = "";
76
PopupUtils.close(dialog);
81
Component.onCompleted: {
82
// let user type in password without tapping on
84
passwordBox.forceActiveFocus();