| 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 |
|
| 22 |
Flickable { |
| 23 |
id: root |
| 24 |
property var accountsModel |
| 25 |
contentHeight: contentItem.childrenRect.height |
| 26 |
boundsBehavior: Flickable.StopAtBounds |
| 27 |
|
| 28 |
Column { |
| 29 |
anchors.left: parent.left |
| 30 |
anchors.right: parent.right |
| 31 |
|
| 32 |
ListView { |
| 33 |
anchors.left: parent.left |
| 34 |
anchors.right: parent.right |
| 35 |
interactive: false |
| 36 |
height: contentHeight |
| 37 |
model: accountsModel |
| 38 |
|
| 39 |
delegate: AccountItem { |
| 40 |
ListView.delayRemove: running |
| 41 |
titleText: providerName |
| 42 |
subtitleText: displayName |
| 43 |
accountHandle: model.accountHandle |
| 44 |
globalServiceHandle: accountServiceHandle |
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
ListItem { |
| 49 |
SlotsLayout { |
| 50 |
mainSlot: Button { |
| 51 |
text: i18n.dtr(domain, "Add account…") |
| 52 |
width: parent.width - units.gu(4) |
| 53 |
onClicked: pageStack.addPageToNextColumn(mainAccountsPage, newAccountPage) |
| 54 |
} |
| 55 |
} |
| 56 |
divider.visible: false |
| 57 |
} |
| 58 |
|
| 59 |
AddAccountLabel {} |
| 60 |
} |
| 61 |
|
| 62 |
Component { |
| 63 |
id: newAccountPage |
| 64 |
NewAccountPage {} |
| 65 |
} |
| 66 |
} |