diff --git a/resources/qml/Main.qml b/resources/qml/Main.qml index 604a846..b74bfe9 100644 --- a/resources/qml/Main.qml +++ b/resources/qml/Main.qml @@ -2,25 +2,47 @@ import QtQuick import QtQuick.Controls Window { - width: 640 - height: 480 + width: 720 + height: 420 visible: true - title: qsTr("Mein Navidrome Client") + title: "Navidrome Client" Column { anchors.centerIn: parent - spacing: 20 + spacing: 12 + width: parent.width * 0.75 - Text { - text: "Hallo Navidrome!" - font.pixelSize: 24 - anchors.horizontalCenter: parent.horizontalCenter + TextField { + id: hostField + placeholderText: "Host, z.B. https://navidrome.example.de" + text: "https://navidrome.timvandenboom.eth64.de" + } + TextField { + id: userField + placeholderText: "User" + text: "nils" + } + TextField { + id: passField + placeholderText: "Passwort" + echoMode: TextInput.Password } Button { - text: "Klick mich" - anchors.horizontalCenter: parent.horizontalCenter - onClicked: console.log("Button gedrückt!") + text: "Verbindung testen (ping)" + onClicked: apiClient.ping(hostField.text, userField.text, passField.text) + } + + Label { + text: apiClient.lastStatus + wrapMode: Text.WordWrap + } + } + + Connections { + target: apiClient + function onPingFinished(ok, message) { + console.log("pingFinished:", ok, message) } } }