summaryrefslogtreecommitdiffstats
path: root/applications/kube-accounts/Maildir.qml
blob: 0c7cadb2647754114e6dc3ce1a2b8fcfc40f663d (plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.0

import org.kde.akonadi2.settings 1.0 as Settings

Item {
    id: root

    height: 150
    width: 600

    Settings.Maildir {
        id: maildir
    }

    ColumnLayout {
        anchors {
            fill: parent
            margins: 10
        }

    GridLayout {
        id: mainContent

        Layout.fillWidth: true

        rows: 2
        columns: 3

        Label {
            text: "Name:"
        }

        TextField {

            Layout.fillWidth: true

            placeholderText: "Enter a name to identify the resource"
            text: maildir.name
        }

        Label {

        }

        Label {
            text: "Location:"
        }

        TextField {

            Layout.fillWidth: true

            placeholderText: "Click on the folder button to enter the location"
            text: maildir.folderUrl

            enabled: false
        }

        Button {
            iconName: "folder"

            onClicked:  {
                fileDialog.visible = true
            }

            FileDialog {
                id: fileDialog
                title: "Please choose the maildir folder"
                folder: shortcuts.home

                selectFolder: true

                onAccepted: {
                    maildir.folderUrl = fileDialog.fileUrl
                    visible: false
                }
                onRejected: {
                    visible: false
                }
            }
        }
    }

    RowLayout {
        id: buttons

        Layout.alignment: Qt.AlignRight

        Button {
            text: "Create Resource"
        }
        Button {
            text: "Cancel"
        }
    }
    }
}