~larryprice/acolyterm/release-0.1

« back to all changes in this revision

Viewing changes to src/app/qml/AuthenticationDialog.qml

  • Committer: Tarmac
  • Author(s): Larry Price
  • Date: 2016-06-22 16:14:21 UTC
  • mfrom: (210.1.5 acolyterm)
  • Revision ID: tarmac-20160622161421-cnyw0bjrpdig3238
Use pkexec to run default terminal and remove dependency on pam. Fixes: https://bugs.launchpad.net/bugs/1593399.

Approved by Libertine CI Bot, Larry Price.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2014 Canonical Ltd
3
 
 *
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.
7
 
 *
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.
12
 
 *
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/>.
15
 
 *
16
 
 * Authored by: Arto Jalkanen <ajalkane@gmail.com>
17
 
 */
18
 
import QtQuick 2.4
19
 
import Ubuntu.Components 1.3
20
 
import Ubuntu.Components.Popups 1.3
21
 
 
22
 
Dialog {
23
 
    id: root
24
 
 
25
 
    title: i18n.tr("Authentication required")
26
 
 
27
 
    text: i18n.tr("Enter passcode or passphrase:")
28
 
 
29
 
    signal passwordEntered(string password)
30
 
    signal dialogCanceled
31
 
 
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)
35
 
    Timer {
36
 
        interval: 1
37
 
        running: true
38
 
        onTriggered: passwordField.forceActiveFocus()
39
 
    }
40
 
 
41
 
    Component.onCompleted: {
42
 
        passwordField.forceActiveFocus();
43
 
    }
44
 
 
45
 
    TextField {
46
 
        id: passwordField
47
 
        objectName: "inputField"
48
 
        placeholderText: i18n.tr("passcode or passphrase")
49
 
        echoMode: TextInput.Password
50
 
 
51
 
        onAccepted: okButton.clicked(text)
52
 
    }
53
 
 
54
 
    Button {
55
 
        id: okButton
56
 
        objectName: "okButton"
57
 
 
58
 
        text: i18n.tr("OK")
59
 
        color: UbuntuColors.green
60
 
 
61
 
        onClicked: {
62
 
            passwordEntered(passwordField.text)
63
 
            passwordField.text = "";
64
 
        }
65
 
    }
66
 
 
67
 
    Button {
68
 
        id: cancelButton
69
 
        objectName: "cancelButton"
70
 
        text: i18n.tr("Cancel")
71
 
 
72
 
        color: UbuntuColors.red
73
 
 
74
 
        onClicked: {
75
 
            dialogCanceled();
76
 
        }
77
 
    }
78
 
}