diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-12-18 21:06:21 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-12-18 21:06:21 +0100 |
commit | 2ffbd47ae807d044ac563fb680a322cefebe4ef7 (patch) | |
tree | ac9bbc0d12e8d99f8bf2696f332797b6061e3523 /accounts/maildir/qml/AccountSettings.qml | |
parent | b77216db4b6d941afb03325e0843509621a283da (diff) | |
download | kube-2ffbd47ae807d044ac563fb680a322cefebe4ef7.tar.gz kube-2ffbd47ae807d044ac563fb680a322cefebe4ef7.zip |
Removed kpackage structure
Diffstat (limited to 'accounts/maildir/qml/AccountSettings.qml')
-rw-r--r-- | accounts/maildir/qml/AccountSettings.qml | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/accounts/maildir/qml/AccountSettings.qml b/accounts/maildir/qml/AccountSettings.qml new file mode 100644 index 00000000..0fb87810 --- /dev/null +++ b/accounts/maildir/qml/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 | |||
20 | import QtQuick 2.4 | ||
21 | import QtQuick.Controls 1.4 as Controls | ||
22 | import QtQuick.Layouts 1.1 | ||
23 | import QtQuick.Dialogs 1.0 as Dialogs | ||
24 | import org.kube.framework 1.0 as Kube | ||
25 | import org.kube.accounts.maildir 1.0 as MaildirAccount | ||
26 | |||
27 | Item { | ||
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 | } | ||