Debian Codegraph @

online-accounts-plugins/lib/module/qml6/RemovalConfirmation.qml

raw
1 /*
2 * Copyright (C) 2013-2015 Canonical Ltd.
3 *
4 * Contact: Alberto Mardegan <[email protected]>
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 3, as published
8 * by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranties of
12 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13 * PURPOSE. See the GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 import QtQuick 2.9
20 import Lomiri.Components
21 import Lomiri.Components.Popups
22
23 Dialog {
24 id: root
25
26 property string accountName
27 property bool confirmed: false
28
29 signal closed
30
31 title: i18n.dtr("lomiri-online-accounts", "Remove account")
32 text: i18n.dtr("lomiri-online-accounts", "The %1 account will be removed only from your phone. You can add it again later.").arg(accountName)
33
34 onVisibleChanged: if (!visible) closed()
35
36 Button {
37 text: i18n.dtr("lomiri-online-accounts", "Remove")
38 color: theme.palette.normal.negative
39 onClicked: setConfirmed(true)
40 }
41
42 Button {
43 text: i18n.dtr("lomiri-online-accounts", "Cancel")
44 onClicked: setConfirmed(false)
45 }
46
47 function setConfirmed(isConfirmed) {
48 confirmed = isConfirmed
49 PopupUtils.close(root)
50 }
51 }