Debian Codegraph @

system-settings-plugin/MainPage.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 SystemSettings 1.0
21 import Lomiri.Components 1.3
22 import SSO.OnlineAccounts 0.1
23
24 ItemPage {
25 id: mainAccountsPage
26
27 property string domain: "lomiri-system-settings-online-accounts"
28
29 objectName: "accountsPage"
30
31 title: i18n.dtr(domain, "Accounts")
32
33 flickable: accountsPage.visible ? accountsPage : noAccountsPage
34
35 AccountServiceModel {
36 id: accountsModel
37 service: "global"
38 includeDisabled: true
39 }
40
41 AccountsPage {
42 id: accountsPage
43 anchors.fill: parent
44 accountsModel: accountsModel
45 visible: accountsModel.count > 0
46 }
47
48 NoAccountsPage {
49 id: noAccountsPage
50 anchors.fill: parent
51 accountsModel: accountsModel
52 visible: !accountsPage.visible
53 }
54 }