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

[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 {
id: busy
width: Kirigami.Units.gridUnit * 2
height: width
Layout.alignment: Qt.AlignCenter
running: helper.isWorking
visible: running
} }
}
Button { BusyIndicator {
Layout.fillWidth: true id: busy
id: loginButton anchors.centerIn: parent
icon.name: "go-next" running: helper.isWorking
text: i18n("Next") }
onClicked: helper.checkServer(serverText.text)
} footer: ToolBar {
RowLayout {
anchors.fill: parent
Button {
text: i18n("Next")
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