File: Server.qml

package info (click to toggle)
kaccounts-providers 4%3A20.12.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 868 kB
  • sloc: cpp: 676; makefile: 3; sh: 3
file content (73 lines) | stat: -rw-r--r-- 1,795 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 *  SPDX-FileCopyrightText: 2019 Rituka Patwal <ritukapatwal21@gmail.com>
 *  SPDX-FileCopyrightText: 2015 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

Kirigami.Page {
    title: i18n("Nextcloud Login")

    header: Kirigami.InlineMessage {
        type: Kirigami.MessageType.Error
        text: helper.errorMessage
        visible: text.length > 0
    }

    Column {

        width: parent.width
        height: childrenRect.height
        anchors.centerIn: parent
        visible: !busy.running

        Kirigami.Icon {
            source: "kaccounts-nextcloud"
            width: Kirigami.Units.gridUnit * 6
            height: width
            anchors.horizontalCenter: form.horizontalCenter
        }

        Item {
            width: 1
            height: Kirigami.Units.gridUnit
        }

        Kirigami.FormLayout {
            id: form
            width: parent.width

            TextField {
                id: serverText
                placeholderText: "https://nextcloud.provider.com"
                Kirigami.FormData.label: i18n("Server address:")
            }
        }
    }

    BusyIndicator {
        id: busy
        anchors.centerIn: parent
        running: helper.isWorking
    }

    footer: ToolBar {
         RowLayout {
            anchors.fill: parent

            Button {
                text: i18n("Next")
                Layout.alignment: Qt.AlignRight
                enabled: serverText.text.length > 0 // TODO Do a more thorough validation of the URL
                onClicked: {
                    helper.checkServer(serverText.text)
                }
            }
         }
    }
}