Debian Codegraph @

system-settings-plugin/ProviderPluginList.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 Lomiri.OnlineAccounts.Client 0.1
22
23 ProvidersList {
24 id: root
25
26 property bool __processing: false
27
28 signal creationFinished(bool created)
29
30 enabled: !__processing
31
32 Setup {
33 id: setup
34 applicationId: "lomiri-system-settings"
35 onFinished: {
36 __processing = false
37 clearPressedButtons()
38 creationFinished("accountId" in reply && reply.accountId !== 0)
39 }
40 }
41
42 onProviderClicked: {
43 if (!__processing) {
44 __processing = true
45 setup.providerId = providerId
46 setup.exec()
47 }
48 }
49 }