Commit 12e83a96 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[nextcloud] Rework server url UI

Use a FormLayout
Use InlineMessage to report errors
Hide controls when showing BusyIndicator
parent cd595b91
...@@ -13,37 +13,39 @@ import QtQuick.Controls 2.5 ...@@ -13,37 +13,39 @@ import QtQuick.Controls 2.5
Kirigami.Page { Kirigami.Page {
title: i18n("Nextcloud Login") title: i18n("Nextcloud Login")
ColumnLayout { header: Kirigami.InlineMessage {
spacing: 10 type: Kirigami.MessageType.Error
anchors.fill: parent text: helper.errorMessage
visible: text.length > 0
}
Kirigami.FormLayout {
anchors.centerIn: parent
visible: !busy.running
TextField { TextField {
id: serverText id: serverText
placeholderText: qsTr("Server address") placeholderText: "https://nextcloud.provider.com"
Layout.fillWidth: true Kirigami.FormData.label: i18n("Server address:")
} }
Label {
id: errorLabel
Layout.fillWidth: true
visible: text.length > 0
text: helper.errorMessage
wrapMode: Text.WordWrap
} }
BusyIndicator { BusyIndicator {
id: busy id: busy
width: Kirigami.Units.gridUnit * 2 anchors.centerIn: parent
height: width
Layout.alignment: Qt.AlignCenter
running: helper.isWorking running: helper.isWorking
visible: running
} }
footer: ToolBar {
RowLayout {
anchors.fill: parent
Button { Button {
Layout.fillWidth: true
id: loginButton
icon.name: "go-next"
text: i18n("Next") text: i18n("Next")
onClicked: helper.checkServer(serverText.text) Layout.alignment: Qt.AlignRight
onClicked: {
helper.checkServer(serverText.text)
}
}
} }
} }
} }
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