Commit 8d3be496 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[nextcloud] Use pages for wizard steps

It allows for custom titles for each step or no title at all for the web login page.
It allows for custom padding for each page. We don't want padding for the web login page.
parent e0544392
......@@ -10,35 +10,40 @@ import org.kde.kirigami 2.5 as Kirigami
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.5
ColumnLayout {
spacing: 10
Kirigami.Page {
title: i18n("Nextcloud Login")
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
}
ColumnLayout {
spacing: 10
anchors.fill: parent
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)
Button {
Layout.fillWidth: true
id: loginButton
icon.name: "go-next"
text: i18n("Next")
onClicked: helper.checkServer(serverText.text)
}
}
}
......@@ -10,23 +10,25 @@ import org.kde.kirigami 2.5 as Kirigami
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.5
ColumnLayout {
Kirigami.Page {
Label {
text: i18n("Choose services to enable");
}
title: i18n("Choose services to enable")
CheckBox {
id: contactsService
text: i18n("Contacts")
}
Button {
id: finishButton
Layout.fillWidth: true
text: i18n("Finish")
ColumnLayout {
anchors.fill: parent
CheckBox {
id: contactsService
text: i18n("Contacts")
}
Button {
id: finishButton
Layout.fillWidth: true
text: i18n("Finish")
onClicked: {
helper.finish(contactsService.checked);
onClicked: {
helper.finish(contactsService.checked);
}
}
}
}
......@@ -12,7 +12,17 @@ import QtWebEngine 1.10
import org.kde.kirigami 2.5 as Kirigami
WebEngineView {
url: helper.loginUrl
profile: helper.webengineProfile
Kirigami.Page {
globalToolBarStyle: Kirigami.ApplicationHeaderStyle.None
leftPadding: 0
rightPadding: 0
topPadding: 0
bottomPadding: 0
WebEngineView {
anchors.fill: parent
url: helper.loginUrl
profile: helper.webengineProfile
}
}
......@@ -14,31 +14,20 @@ import org.kde.kaccounts.nextcloud 1.0
Kirigami.ApplicationWindow {
id: ncAccountRoot
objectName: "_root"
width: Kirigami.Units.gridUnit * 25
height: Kirigami.Units.gridUnit * 15
pageStack.initialPage: mainPageComponent
pageStack.initialPage: Qt.resolvedUrl("Server.qml");
Component {
id: mainPageComponent
Connections {
target: helper
Kirigami.Page {
title: i18n("Nextcloud Login")
Loader {
anchors.fill: parent
source: {
switch (helper.state) {
case NextcloudController.ServerUrl:
return Qt.resolvedUrl("Server.qml");
case NextcloudController.WebLogin:
return Qt.resolvedUrl("WebLogin.qml")
case NextcloudController.Services:
return Qt.resolvedUrl("Services.qml")
}
}
function onStateChanged() {
if (helper.state === NextcloudController.WebLogin) {
ncAccountRoot.pageStack.replace(Qt.resolvedUrl("WebLogin.qml"))
} else if (helper.state === NextcloudController.Services) {
ncAccountRoot.pageStack.replace(Qt.resolvedUrl("Services.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