summaryrefslogtreecommitdiffstats
path: root/accounts/maildir/package/contents/ui/AccountSettings.qml
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-12-18 20:32:57 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-12-18 20:37:06 +0100
commit1f62cf29d038e1dfd9bd56505ecaae10ca14b60b (patch)
tree724b2d4f979c06b5033ca86e3271b3a345a1cc30 /accounts/maildir/package/contents/ui/AccountSettings.qml
parent321488dfe88fc3d60b35f3b5b8075adbabf93d29 (diff)
downloadkube-1f62cf29d038e1dfd9bd56505ecaae10ca14b60b.tar.gz
kube-1f62cf29d038e1dfd9bd56505ecaae10ca14b60b.zip
Accounts without kpackage
Diffstat (limited to 'accounts/maildir/package/contents/ui/AccountSettings.qml')
-rw-r--r--accounts/maildir/package/contents/ui/AccountSettings.qml107
1 files changed, 107 insertions, 0 deletions
diff --git a/accounts/maildir/package/contents/ui/AccountSettings.qml b/accounts/maildir/package/contents/ui/AccountSettings.qml
new file mode 100644
index 00000000..0fb87810
--- /dev/null
+++ b/accounts/maildir/package/contents/ui/AccountSettings.qml
@@ -0,0 +1,107 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18*/
19
20import QtQuick 2.4
21import QtQuick.Controls 1.4 as Controls
22import QtQuick.Layouts 1.1
23import QtQuick.Dialogs 1.0 as Dialogs
24import org.kube.framework 1.0 as Kube
25import org.kube.accounts.maildir 1.0 as MaildirAccount
26
27Item {
28 property string accountId
29 property string heading: qsTr("Add your Maildir archive")
30 property string subheadline: qsTr("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.")
31 property bool valid: true
32 implicitHeight: grid.implicitHeight
33
34 MaildirAccount.MaildirSettings {
35 id: maildirSettings
36 accountIdentifier: accountId
37 accountType: "maildir"
38 }
39
40 function save(){
41 maildirSettings.save()
42 }
43
44 function remove(){
45 maildirSettings.remove()
46 }
47
48 GridLayout {
49 id: grid
50 anchors.fill: parent
51 columns: 2
52 columnSpacing: Kube.Units.largeSpacing
53 rowSpacing: Kube.Units.largeSpacing
54
55 Kube.Label {
56 text: qsTr("Title of Account")
57 Layout.alignment: Qt.AlignRight
58 }
59 Kube.TextField {
60 Layout.fillWidth: true
61 placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name")
62 text: maildirSettings.accountName
63 onTextChanged: {
64 maildirSettings.accountName = text
65 }
66 }
67
68 Kube.Label {
69 text: qsTr("Path")
70 Layout.alignment: Qt.AlignRight
71 }
72 RowLayout {
73 Layout.fillWidth: true
74
75 Kube.TextField {
76 id: path
77 Layout.fillWidth: true
78 enabled: false
79 text: maildirSettings.path
80 }
81
82 Controls.Button {
83 iconName: Kube.Icons.folder
84
85 onClicked: {
86 fileDialogComponent.createObject(parent)
87 }
88
89 Component {
90 id: fileDialogComponent
91 Dialogs.FileDialog {
92 id: fileDialog
93
94 visible: true
95 title: "Choose the maildir folder"
96
97 selectFolder: true
98
99 onAccepted: {
100 maildirSettings.path = fileDialog.fileUrl
101 }
102 }
103 }
104 }
105 }
106 }
107}