summaryrefslogtreecommitdiffstats
path: root/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2016-06-21 23:40:34 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2016-06-21 23:40:34 +0200
commit90d914e10aaa037819526e545ea9606f440adc82 (patch)
tree1da9bcce6088eb3e4dc276f4288f3541b235cda7 /accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
parented23447fe0a163b6a9dfc5c0eb5560257231086c (diff)
downloadkube-90d914e10aaa037819526e545ea9606f440adc82.tar.gz
kube-90d914e10aaa037819526e545ea9606f440adc82.zip
almost pixelpefect maildir settings
Diffstat (limited to 'accounts/maildir/package/contents/ui/MaildirAccountSettings.qml')
-rw-r--r--accounts/maildir/package/contents/ui/MaildirAccountSettings.qml236
1 files changed, 123 insertions, 113 deletions
diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
index fab2aa27..cd966dd1 100644
--- a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
+++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
@@ -28,155 +28,165 @@ import org.kube.accounts.maildir 1.0 as MaildirAccount
28 28
29 29
30Item { 30Item {
31 id: root
32
33 property string accountId 31 property string accountId
34 property string accountName
35 property string icon
36
37 anchors.fill: parent
38 32
39 MaildirAccount.MaildirSettings { 33 MaildirAccount.MaildirSettings {
40 id: maildirSettings 34 id: maildirSettings
41 accountIdentifier: accountId 35 accountIdentifier: accountId
42 } 36 }
43 37
44 GridLayout { 38 anchors.fill: parent
45 id: gridLayout
46 39
40 Item {
47 anchors { 41 anchors {
48 fill: parent 42 fill: parent
49 margins: Kirigami.Units.largeSpacing 43 margins: Kirigami.Units.largeSpacing * 2
50 } 44 }
51 45
52 columns: 2 46 Kirigami.Heading {
47 id: heading
48 text: "Add your Maildir archive"
53 49
54 Kirigami.Label { 50 color: Kirigami.Theme.highlightColor
55 Layout.columnSpan: 2
56 Layout.fillWidth: true
57 text: "General:"
58 } 51 }
59 52
60 Kirigami.Label { text: "Account Name" } 53 Label {
61 TextField { 54 id: subHeadline
62 id: name
63 placeholderText: accountName
64 Layout.fillWidth: true
65 text: maildirSettings.accountName
66 onTextChanged: { maildirSettings.accountName = text; root.accountName = text; }
67 }
68 55
69 Kirigami.Label { text: "User Name" } 56 anchors {
70 TextField { 57 left: heading.left
71 placeholderText: "Your Name" 58 top: heading.bottom
72 Layout.fillWidth: true 59 }
73 text: maildirSettings.userName
74 onTextChanged: { maildirSettings.userName = text; }
75 }
76 60
77 Kirigami.Label { text: "Email Address" } 61 width: parent.width
78 TextField {
79 placeholderText: "Your EMail Address"
80 Layout.fillWidth: true
81 text: maildirSettings.emailAddress
82 onTextChanged: { maildirSettings.emailAddress = text; }
83 }
84 62
85 Kirigami.Label { 63 text: "To let Kube access your maildir archive, add the path to your archive and give the account a title that will be displayed inside Kube"
86 Layout.columnSpan: 2 64 //TODO wait for kirgami theme disabled text color
87 Layout.fillWidth: true 65 opacity: 0.5
88 text: "Maildir:" 66 wrapMode: Text.Wrap
89 } 67 }
90 68
91 Kirigami.Label { text: "Path" } 69 GridLayout {
92 RowLayout { 70 anchors {
71 top:subHeadline.bottom
72 bottom: parent.bottom
73 left: parent.left
74 right: parent.right
75 topMargin: Kirigami.Units.largeSpacing * 2
76 bottomMargin: Kirigami.Units.largeSpacing * 2
77 }
78
79 columns: 2
80 columnSpacing: Kirigami.Units.largeSpacing
81 rowSpacing: Kirigami.Units.largeSpacing
82
83 Kirigami.Label {
84 text: "Display tilte"
85 Layout.alignment: Qt.AlignRight
86 }
93 TextField { 87 TextField {
94 id: path
95 placeholderText: "path"
96 Layout.fillWidth: true 88 Layout.fillWidth: true
97 text: maildirSettings.path 89
98 onTextChanged: { maildirSettings.path = text; } 90 text: maildirSettings.accountName
99 validator: maildirSettings.pathValidator 91 onTextChanged: {
100 Rectangle { 92 maildirSettings.accountName = text
101 anchors.fill: parent
102 opacity: 0.2
103 color: path.acceptableInput ? "green" : "yellow"
104 } 93 }
105 } 94 }
106 95
107 Button { 96 Kirigami.Label {
108 iconName: "folder" 97 text: "Path"
109 onClicked: { 98 Layout.alignment: Qt.AlignRight
110 fileDialogComponent.createObject(parent); 99 }
100 RowLayout {
101 Layout.fillWidth: true
102
103 TextField {
104 id: path
105 Layout.fillWidth: true
106
107 text: maildirSettings.path
108 onTextChanged: {
109 maildirSettings.path = text
110 }
111 validator: maildirSettings.pathValidator
112
113 Rectangle {
114 anchors.fill: parent
115 opacity: 0.2
116 color: "yellow"
117 visible: path.acceptableInput == false
118 }
111 } 119 }
112 120
113 Component { 121 Button {
114 id: fileDialogComponent 122 iconName: "folder"
115 FileDialog { 123
116 id: fileDialog 124 onClicked: {
117 visible: true 125 fileDialogComponent.createObject(parent)
118 title: "Please choose the maildir folder" 126 }
119 127
120 selectFolder: true 128 Component {
129 id: fileDialogComponent
130 FileDialog {
131 id: fileDialog
121 132
122 onAccepted: { 133 visible: true
123 maildirSettings.path = fileDialog.fileUrl 134 title: "Choose the maildir folder"
124 } 135
125 onRejected: { 136 selectFolder: true
137
138 onAccepted: {
139 maildirSettings.path = fileDialog.fileUrl
140 }
126 } 141 }
127 } 142 }
128 } 143 }
129 } 144 }
130 }
131
132 Kirigami.Label {
133 Layout.columnSpan: 2
134 Layout.fillWidth: true
135 text: "Smtp:"
136 }
137
138 Kirigami.Label { text: "Username" }
139 TextField {
140 placeholderText: "Username"
141 Layout.fillWidth: true
142 text: maildirSettings.smtpUsername
143 onTextChanged: { maildirSettings.smtpUsername = text; }
144 }
145 145
146 Label { text: "Password" } 146 Label {
147 TextField { 147 text: ""
148 placeholderText: "Password" 148 }
149 Layout.fillWidth: true 149 CheckBox {
150 text: maildirSettings.smtpPassword 150 text: "Read only"
151 onTextChanged: { maildirSettings.smtpPassword = text; } 151 }
152 }
153 152
154 Kirigami.Label { text: "Server" } 153 Label {
155 TextField { 154 text: ""
156 id: server 155 Layout.fillHeight: true
157 placeholderText: "smtps://mainserver.example.net:465" 156 }
158 Layout.fillWidth: true 157 Label {
159 text: maildirSettings.smtpServer 158 text: ""
160 onTextChanged: { maildirSettings.smtpServer = text; }
161 validator: maildirSettings.smtpServerValidator
162 Rectangle {
163 anchors.fill: parent
164 opacity: 0.2
165 color: server.acceptableInput ? "green" : "yellow"
166 } 159 }
167 }
168 160
169 Button { 161 Label {
170 text: "Save" 162 text: ""
171 onClicked: {
172 maildirSettings.save();
173 } 163 }
174 } 164 Item {
175 Button { 165 Layout.fillWidth: true
176 text: "Remove" 166
177 onClicked: { 167 Button {
178 maildirSettings.remove(); 168 text: "Delete"
169
170 onClicked: {
171 maildirSettings.remove()
172 root.closeDialog()
173 }
174 }
175
176 Button {
177 id: saveButton
178
179 anchors.right: parent.right
180
181 text: "Save"
182
183 onClicked: {
184 focus: true
185 maildirSettings.save()
186 root.closeDialog()
187 }
188 }
179 } 189 }
180 } 190 }
181 } 191 }
182} 192} \ No newline at end of file