Debian Codegraph @

src/imports/Lomiri/AddressBook/Base/RemoveContactsDialog.qml

raw ◀ ▶
2 Debian patches touch this file
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 as published by
6 * the Free Software Foundation; version 3.
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
17 import QtQuick 2.4
18 import Lomiri.Components 1.3
19 import Lomiri.Components.Popups 1.3
20
21 Dialog {
22 objectName: "removeContactsDialog"
23
24 property var contacts: []
•25 property alias buttonsVisibility: buttons.visible
26
27 signal canceled()
28 signal accepted()
29
30 title: {
31 if (contacts.length == 0) {
32 return i18n.dtr("lomiri-addressbook-app", "No contact selected.")
33 } else if (contacts.length == 1) {
34 return contacts[0].displayLabel.label
35 } else {
36 return i18n.dtr("lomiri-addressbook-app", "Multiple contacts")
37 }
38 }
39 text: {
40 if (contacts.length == 1) {
41 return i18n.dtr("lomiri-addressbook-app", "Are you sure that you want to remove this contact?")
42 } else {
43 return i18n.dtr("lomiri-addressbook-app", "Are you sure that you want to remove all selected contacts?")
44 }
45 }
46
•47 Label {
48 anchors {
49 left: parent.left
50 right: parent.right
51 margins: units.gu(1)
52 }
53 text: i18n.tr("Note that removed contacts are not deleted from the database. Use \"Purge\" in Settings to clean them definitely.")
54 fontSize: "small"
55 wrapMode: Label.WordWrap
56 }
57
•58 Column {
59 id: buttons
60 spacing: units.gu(2)
61 anchors {
62 left: parent.left
63 right: parent.right
64 margins: units.gu(1)
65 }
•66 Button {
67 id: acceptButton
68 objectName: "removeContactsDialog.Yes"
69 anchors {
70 left: parent.left
71 right: parent.right
72 }
73 text: i18n.dtr("lomiri-addressbook-app", "Remove")
74 color: theme.palette.normal.negative
75 action: Action {
76 shortcut: "return"
77 onTriggered: accepted()
78 }
79 }
80
•81 Button {
82 id: cancelButton
83 objectName: "removeContactsDialog.No"
84 anchors {
85 left: parent.left
86 right: parent.right
87 }
88 text: i18n.dtr("lomiri-addressbook-app", "Cancel")
89 action: Action {
90 shortcut: "esc"
91 onTriggered: canceled()
92 }
93 }
94 }
95 }