Debian Codegraph @

system-settings-plugin/AccountEditPage.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 1.3
21 import SSO.OnlineAccounts 0.1
22 import Lomiri.OnlineAccounts.Plugin 1.0
23
24 Page {
25 id: root
26
27 property var accountHandle
28
29 signal finished
30
31 header: PageHeader {
32 id: header
33 title: account.provider.displayName
34 flickable: flick
35 property string iconSource: account.provider.iconName.indexOf("/") === 0 ?
36 account.provider.iconName: "image://theme/" + account.provider.iconName
37 contents: Row {
38 anchors.fill: parent
39 spacing: units.gu(1)
40 LomiriShape {
41 height: Math.min(units.gu(4), parent.height - units.gu(1))
42 width: height
43 anchors.verticalCenter: parent.verticalCenter
44 source: Image { source: iconSource}
45 }
46 Label {
47 text: header.title
48 anchors.verticalCenter: parent.verticalCenter
49 }
50 }
51 }
52
53 Account {
54 id: account
55 objectHandle: accountHandle
56 }
57
58 Flickable {
59 id: flick
60 anchors.fill: parent
61 contentHeight: options.height
62
63 Options {
64 id: options
65 onFinished: {
66 root.finished()
67 }
68 }
69 }
70 }