| 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 1.3 |
| 21 |
import Lomiri.Components.ListItems 1.3 as ListItem |
| 22 |
import Lomiri.Components.Popups 1.3 |
| 23 |
import SSO.OnlineAccounts 0.1 |
| 24 |
|
| 25 |
Column { |
| 26 |
id: root |
| 27 |
|
| 28 |
property var __account: account |
| 29 |
|
| 30 |
signal finished |
| 31 |
|
| 32 |
anchors.left: parent.left |
| 33 |
anchors.right: parent.right |
| 34 |
|
| 35 |
ListItem.SingleValue { |
| 36 |
text: i18n.dtr("lomiri-online-accounts", "ID") |
| 37 |
value: account.displayName |
| 38 |
} |
| 39 |
|
| 40 |
ServiceSwitches { |
| 41 |
account: __account |
| 42 |
enabled: __account.enabled |
| 43 |
opacity: enabled ? 1 : 0.5 |
| 44 |
} |
| 45 |
|
| 46 |
ListItem.SingleControl { |
| 47 |
control: Button { |
| 48 |
text: i18n.dtr("lomiri-online-accounts", "Remove account…") |
| 49 |
width: parent.width - units.gu(4) |
| 50 |
onClicked: PopupUtils.open(removalConfirmationComponent) |
| 51 |
} |
| 52 |
showDivider: false |
| 53 |
} |
| 54 |
|
| 55 |
Component { |
| 56 |
id: removalConfirmationComponent |
| 57 |
RemovalConfirmation { |
| 58 |
accountName: __account.provider.displayName |
| 59 |
onClosed: { |
| 60 |
if (confirmed) { |
| 61 |
console.log("Removing account...") |
| 62 |
account.removed.connect(root.finished) |
| 63 |
account.remove(Account.RemoveCredentials) |
| 64 |
} |
| 65 |
} |
| 66 |
} |
| 67 |
} |
| 68 |
} |