Changeset View
Changeset View
Standalone View
Standalone View
plugins/nextcloud-ui/package/contents/ui/main.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2019 (C) Rituka Patwal <ritukapatwal21@gmail.com> | ||||
3 | * Copyright 2015 (C) Martin Klapetek <mklapetek@kde.org> | ||||
4 | * | ||||
5 | * This program is free software; you can redistribute it and/or modify | ||||
6 | * it under the terms of the GNU Library General Public License as | ||||
7 | * published by the Free Software Foundation; either version 2 or | ||||
8 | * (at your option) any later version. | ||||
9 | * | ||||
10 | * This program is distributed in the hope that it will be useful, | ||||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
13 | * GNU Library General Public License for more details | ||||
14 | * | ||||
15 | * You should have received a copy of the GNU Library General Public | ||||
16 | * License along with this program; if not, write to the | ||||
17 | * Free Software Foundation, Inc., | ||||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
19 | */ | ||||
20 | | ||||
21 | import QtQuick 2.2 | ||||
22 | import org.kde.kirigami 2.5 as Kirigami | ||||
23 | import QtQuick.Layouts 1.12 | ||||
24 | import QtQuick.Controls 2.5 | ||||
25 | | ||||
26 | Kirigami.ApplicationWindow { | ||||
27 | id: ncAccountRoot | ||||
28 | objectName: "_root" | ||||
29 | | ||||
30 | width: Kirigami.Units.gridUnit * 25 | ||||
31 | height: Kirigami.Units.gridUnit * 15 | ||||
32 | | ||||
33 | pageStack.initialPage: mainPageComponent | ||||
34 | | ||||
35 | Component { | ||||
36 | id: mainPageComponent | ||||
37 | | ||||
38 | Kirigami.Page { | ||||
39 | title: i18n("Nextcloud Login") | ||||
40 | | ||||
41 | ColumnLayout { | ||||
42 | spacing: 10 | ||||
43 | anchors.fill: parent | ||||
44 | | ||||
45 | visible: !helper.isLoginComplete | ||||
46 | | ||||
47 | TextField { | ||||
48 | id: serverText | ||||
49 | placeholderText: qsTr("Server address") | ||||
50 | Layout.fillWidth: true | ||||
51 | } | ||||
52 | Label { | ||||
53 | id: errorLabel | ||||
54 | Layout.fillWidth: true | ||||
55 | visible: text.length > 0 | ||||
56 | text: helper.errorMessage | ||||
57 | wrapMode: Text.WordWrap | ||||
58 | } | ||||
59 | BusyIndicator { | ||||
60 | id: busy | ||||
61 | width: Kirigami.Units.gridUnit * 2 | ||||
62 | height: width | ||||
63 | Layout.alignment: Qt.AlignCenter | ||||
64 | running: helper.isWorking | ||||
65 | visible: running | ||||
66 | } | ||||
67 | | ||||
68 | Button { | ||||
69 | Layout.fillWidth: true | ||||
70 | id: loginButton | ||||
71 | icon.name: "go-next" | ||||
72 | text: i18n("Next") | ||||
73 | onClicked: helper.checkServer(serverText.text) | ||||
74 | } | ||||
75 | } | ||||
76 | ColumnLayout { | ||||
77 | id: services | ||||
78 | visible: helper.isLoginComplete | ||||
79 | | ||||
80 | Label { | ||||
81 | text: i18n("Choose services to enable"); | ||||
82 | } | ||||
83 | | ||||
84 | CheckBox { | ||||
85 | id: contactsService | ||||
86 | text: i18n("Contacts") | ||||
87 | } | ||||
88 | Button { | ||||
89 | id: finishButton | ||||
90 | Layout.fillWidth: true | ||||
91 | text: i18n("Finish") | ||||
92 | | ||||
93 | onClicked: { | ||||
94 | helper.finish(contactsService.checked); | ||||
95 | } | ||||
96 | } | ||||
97 | } | ||||
98 | } | ||||
99 | } | ||||
100 | } |