tPassphraseRequester.qml - sailfish-safe - Sailfish frontend for safe(1)
(HTM) git clone git://git.z3bra.org/sailfish-safe.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
tPassphraseRequester.qml (1504B)
---
1 /*
2 * Copyright (C) 2019 Daniel Vrátil <dvratil@kde.org>
3 * 2021 Willy Goiffon <contact@z3bra.org>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19 import QtQuick 2.0
20 import Sailfish.Silica 1.0
21 import harbour.safe 0.1
22
23
24 Dialog {
25 id: dlg
26
27 property var model
28 property var currentIndex
29
30 DialogHeader {
31 }
32
33 PasswordField {
34 id: passwordField
35
36 anchors {
37 centerIn: parent
38 left: parent.left
39 right: parent.right
40 leftMargin: Theme.horizontalPageMargin
41 rightMargin: Theme.horizontalPageMargin
42 }
43
44 focus: true
45 placeholderText: "Master password"
46 EnterKey.iconSource: "image://theme/icom-m-enter-accept"
47 EnterKey.onClicked: dlg.accept()
48 }
49
50 onRejected: model.cancel()
51 onAccepted: model.setPassphrase(passwordField.text)
52 }