summaryrefslogtreecommitdiffstats
path: root/accounts/maildir
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-22 15:56:21 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-22 15:57:44 +0100
commit5ca3a769c0b0c93cfcbf6134937b32eed52e2fc2 (patch)
treebaae5147722bdef26a1a8dc99ff6a020a782bcc9 /accounts/maildir
parentcb2b1a35e14031f15155243aee12fc862cb65ebf (diff)
downloadkube-5ca3a769c0b0c93cfcbf6134937b32eed52e2fc2.tar.gz
kube-5ca3a769c0b0c93cfcbf6134937b32eed52e2fc2.zip
Removed Create/Edit*.qml and controllers, added gmail plugin
The current settings plugin could potentially be replaced by a proper controller, but what we have works so that's low priority.
Diffstat (limited to 'accounts/maildir')
-rw-r--r--accounts/maildir/package/contents/ui/MaildirAccountSettings.qml124
1 files changed, 24 insertions, 100 deletions
diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
index a5d35d5c..b768979a 100644
--- a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
+++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
@@ -1,5 +1,6 @@
1/* 1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
3 4
4 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
@@ -17,108 +18,76 @@
17*/ 18*/
18 19
19import QtQuick 2.4 20import QtQuick 2.4
20import QtQuick.Controls 1.4 21import QtQuick.Controls 1.4 as Controls
22import QtQuick.Controls 2.0 as Controls2
21import QtQuick.Layouts 1.1 23import QtQuick.Layouts 1.1
22import QtQuick.Dialogs 1.0 24import QtQuick.Dialogs 1.0 as Dialogs
23 25
24import org.kde.kirigami 1.0 as Kirigami 26import org.kde.kirigami 1.0 as Kirigami
25 27
26import org.kube.framework.settings 1.0 as KubeSettings 28import org.kube.framework.settings 1.0 as KubeSettings
27import org.kube.accounts.maildir 1.0 as MaildirAccount 29import org.kube.accounts.maildir 1.0 as MaildirAccount
28 30
29
30Item { 31Item {
31 property string accountId 32 property string accountId
33 property string heading: "Add your Maildir archive"
34 property string subheadline: "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."
32 35
33 MaildirAccount.MaildirSettings { 36 MaildirAccount.MaildirSettings {
34 id: maildirSettings 37 id: maildirSettings
35 accountIdentifier: accountId 38 accountIdentifier: accountId
39 accountType: "maildir"
40 }
41
42 function save(){
43 maildirSettings.save()
36 } 44 }
37 45
38 anchors.fill: parent 46 function remove(){
47 maildirSettings.remove()
48 }
39 49
40 Item { 50 Item {
41 anchors { 51 anchors {
42 fill: parent 52 fill: parent
43 margins: Kirigami.Units.largeSpacing * 2
44 }
45
46 Kirigami.Heading {
47 id: heading
48 text: "Add your Maildir archive"
49
50 color: Kirigami.Theme.highlightColor
51 }
52
53 Label {
54 id: subHeadline
55
56 anchors {
57 left: heading.left
58 top: heading.bottom
59 }
60
61 width: parent.width
62
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"
64 //TODO wait for kirgami theme disabled text color
65 opacity: 0.5
66 wrapMode: Text.Wrap
67 } 53 }
68 54
69 GridLayout { 55 GridLayout {
70 anchors { 56 anchors {
71 top:subHeadline.bottom 57 fill: parent
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 } 58 }
78
79 columns: 2 59 columns: 2
80 columnSpacing: Kirigami.Units.largeSpacing 60 columnSpacing: Kirigami.Units.largeSpacing
81 rowSpacing: Kirigami.Units.largeSpacing 61 rowSpacing: Kirigami.Units.largeSpacing
82 62
83 Kirigami.Label { 63 Controls.Label {
84 text: "Title of account" 64 text: "Title of Account"
85 Layout.alignment: Qt.AlignRight 65 Layout.alignment: Qt.AlignRight
86 } 66 }
87 TextField { 67 Controls.TextField {
88 Layout.fillWidth: true 68 Layout.fillWidth: true
89 69 placeholderText: "E.g. \"Work\", \"Home\" that will be displayed in Kube as name"
90 text: maildirSettings.accountName 70 text: maildirSettings.accountName
91 onTextChanged: { 71 onTextChanged: {
92 maildirSettings.accountName = text 72 maildirSettings.accountName = text
93 } 73 }
94 } 74 }
95 75
96 Kirigami.Label { 76 Controls2.Label {
97 text: "Path" 77 text: "Path"
98 Layout.alignment: Qt.AlignRight 78 Layout.alignment: Qt.AlignRight
99 } 79 }
100 RowLayout { 80 RowLayout {
101 Layout.fillWidth: true 81 Layout.fillWidth: true
102 82
103 TextField { 83 Controls.TextField {
104 id: path 84 id: path
105 Layout.fillWidth: true 85 Layout.fillWidth: true
106 86 enabled: false
107 text: maildirSettings.path 87 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 }
119 } 88 }
120 89
121 Button { 90 Controls.Button {
122 iconName: "folder" 91 iconName: "folder"
123 92
124 onClicked: { 93 onClicked: {
@@ -127,7 +96,7 @@ Item {
127 96
128 Component { 97 Component {
129 id: fileDialogComponent 98 id: fileDialogComponent
130 FileDialog { 99 Dialogs.FileDialog {
131 id: fileDialog 100 id: fileDialog
132 101
133 visible: true 102 visible: true
@@ -142,51 +111,6 @@ Item {
142 } 111 }
143 } 112 }
144 } 113 }
145
146 Label {
147 text: ""
148 }
149 CheckBox {
150 text: "Read only"
151 }
152
153 Label {
154 text: ""
155 Layout.fillHeight: true
156 }
157 Label {
158 text: ""
159 }
160
161 Label {
162 text: ""
163 }
164 Item {
165 Layout.fillWidth: true
166
167 Button {
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 }
189 }
190 } 114 }
191 } 115 }
192} 116}