Debian Codegraph @

online-accounts-plugins/lib/module/qml5/OAuthMain.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
23 Item {
24 id: root
25
26 property url creationComponentUrl: Qt.resolvedUrl("OAuth.qml")
27 property url editingComponentUrl: Qt.resolvedUrl("Options.qml")
28 property Component creationComponent: null
29 property Component editingComponent: null
30
31 property alias source: loader.source
32
33 signal finished
34
35 anchors.fill: parent
36
37 Loader {
38 id: loader
39 anchors.fill: parent
40 source: sourceComponent === null ? (account.accountId != 0 ? editingComponentUrl : creationComponentUrl) : ""
41 sourceComponent: account.accountId != 0 ? editingComponent : creationComponent
42
43 Connections {
44 target: loader.item
45 onFinished: root.finished()
46 }
47 }
48 }