Debian Codegraph @

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

raw ◀ ▶
Source reconstructed at patch state 1 of 2 — not the installed (fully patched) source.
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
26 signal canceled()
27 signal accepted()
28
29 title: {
30 if (contacts.length == 0) {
31 return i18n.dtr("lomiri-addressbook-app", "No contact selected.")
32 } else if (contacts.length == 1) {
33 return contacts[0].displayLabel.label
34 } else {
35 return i18n.dtr("lomiri-addressbook-app", "Multiple contacts")
36 }
37 }
38 text: {
39 if (contacts.length == 1) {
40 return i18n.dtr("lomiri-addressbook-app", "Are you sure that you want to remove this contact?")
41 } else {
42 return i18n.dtr("lomiri-addressbook-app", "Are you sure that you want to remove all selected contacts?")
43 }
44 }
45
46 Label {
47 anchors {
48 left: parent.left
49 right: parent.right
50 margins: units.gu(1)
51 }
52 text: i18n.tr("Note that removed contacts are not deleted from the database. Use \"Purge\" in Settings to clean them definitely.")
53 fontSize: "small"
54 wrapMode: Label.WordWrap
55 }
56
57 Button {
58 id: acceptButton
59 objectName: "removeContactsDialog.Yes"
60 anchors {
61 left: parent.left
62 right: parent.right
63 margins: units.gu(1)
64 }
65 text: i18n.dtr("lomiri-addressbook-app", "Remove")
66 color: theme.palette.normal.negative
67 action: Action {
68 shortcut: "return"
69 onTriggered: accepted()
70 }
71 }
72
73 Button {
74 id: cancelButton
75 objectName: "removeContactsDialog.No"
76 anchors {
77 left: parent.left
78 right: parent.right
79 margins: units.gu(1)
80 }
81 text: i18n.dtr("lomiri-addressbook-app", "Cancel")
82 action: Action {
83 shortcut: "esc"
84 onTriggered: canceled()
85 }
86 }
87 }