Commit 9d67a54a authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[nextcloud] Split QML into separate files

The code is about to become more complex and get additional states so split things up a bit
parent b4d3a8ba
/*
* Copyright 2019 (C) Rituka Patwal <ritukapatwal21@gmail.com>
* Copyright 2015 (C) Martin Klapetek <mklapetek@kde.org>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick 2.2
import org.kde.kirigami 2.5 as Kirigami
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.5
ColumnLayout {
spacing: 10
TextField {
id: serverText
placeholderText: qsTr("Server address")
Layout.fillWidth: true
}
Label {
id: errorLabel
Layout.fillWidth: true
visible: text.length > 0
text: helper.errorMessage
wrapMode: Text.WordWrap
}
BusyIndicator {
id: busy
width: Kirigami.Units.gridUnit * 2
height: width
Layout.alignment: Qt.AlignCenter
running: helper.isWorking
visible: running
}
Button {
Layout.fillWidth: true
id: loginButton
icon.name: "go-next"
text: i18n("Next")
onClicked: helper.checkServer(serverText.text)
}
}
/*
* Copyright 2019 (C) Rituka Patwal <ritukapatwal21@gmail.com>
* Copyright 2015 (C) Martin Klapetek <mklapetek@kde.org>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick 2.2
import org.kde.kirigami 2.5 as Kirigami
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.5
ColumnLayout {
Label {
text: i18n("Choose services to enable");
}
CheckBox {
id: contactsService
text: i18n("Contacts")
}
Button {
id: finishButton
Layout.fillWidth: true
text: i18n("Finish")
onClicked: {
helper.finish(contactsService.checked);
}
}
}
......@@ -25,62 +25,9 @@ Kirigami.ApplicationWindow {
Kirigami.Page {
title: i18n("Nextcloud Login")
ColumnLayout {
spacing: 10
Loader {
anchors.fill: parent
visible: !helper.isLoginComplete
TextField {
id: serverText
placeholderText: qsTr("Server address")
Layout.fillWidth: true
}
Label {
id: errorLabel
Layout.fillWidth: true
visible: text.length > 0
text: helper.errorMessage
wrapMode: Text.WordWrap
}
BusyIndicator {
id: busy
width: Kirigami.Units.gridUnit * 2
height: width
Layout.alignment: Qt.AlignCenter
running: helper.isWorking
visible: running
}
Button {
Layout.fillWidth: true
id: loginButton
icon.name: "go-next"
text: i18n("Next")
onClicked: helper.checkServer(serverText.text)
}
}
ColumnLayout {
id: services
visible: helper.isLoginComplete
Label {
text: i18n("Choose services to enable");
}
CheckBox {
id: contactsService
text: i18n("Contacts")
}
Button {
id: finishButton
Layout.fillWidth: true
text: i18n("Finish")
onClicked: {
helper.finish(contactsService.checked);
}
}
source: helper.isLoginComplete ? Qt.resolvedUrl("Services.qml") : Qt.resolvedUrl("Server.qml")
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment