2
* Copyright 2016 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
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 Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by Jonas G. Drange <jonas.drange@canonical.com>
20
import Ubuntu.Components 1.3
21
import Ubuntu.Components.Popups 1.3
22
import Ubuntu.Components.Themes.Ambiance 1.3
27
property string templateId
29
signal requestDeletion(string templateId)
30
signal requestRename(string templateId, string name)
32
function deletionFailed() {
33
PopupUtils.open(deletionFailed);
38
objectName: "templateHeader"
39
title: nameInput.text.length > 0 ? nameInput.text : name
61
topMargin: units.gu(2)
63
boundsBehavior: (contentHeight > root.height) ?
64
Flickable.DragAndOvershootBounds :
65
Flickable.StopAtBounds
66
contentHeight: contentItem.childrenRect.height
78
anchors.left: parent.left
79
anchors.right: parent.right
80
text: i18n.dtr("ubuntu-settings-components", "Fingerprint Name")
81
font.weight: Font.Light
86
objectName: "nameInput"
87
anchors.left: parent.left
88
anchors.right: parent.right
89
inputMethodHints: Qt.ImhNoPredictiveText
90
style: TextFieldStyle {}
94
requestRename(templateId, text)
98
requestRename(templateId, text);
106
objectName: "templateDelete"
107
text: i18n.dtr("ubuntu-settings-components", "Delete Fingerprint")
109
root.state = "deleting";
110
requestDeletion(templateId)
121
id: deletionFailedDialog
122
objectName: "fingerprintDeletionFailedDialog"
123
text: i18n.dtr("ubuntu-settings-components",
124
"Sorry, the fingerprint could not be deleted.")
127
objectName: "fingerprintDeleteionFailedOk"
128
onClicked: PopupUtils.close(deletionFailedDialog)
129
text: i18n.dtr("ubuntu-settings-components", "OK")