diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 17:10:18 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 17:10:18 +0100 |
commit | 54c3e5912b0d64bad5a1c66bc96f0552ac5e21f5 (patch) | |
tree | 65b511dc68bd327d59cc320b04cb077a0a52e014 /accounts | |
parent | 7bc71c84a91d980f46bc042731ee903cef591031 (diff) | |
download | kube-54c3e5912b0d64bad5a1c66bc96f0552ac5e21f5.tar.gz kube-54c3e5912b0d64bad5a1c66bc96f0552ac5e21f5.zip |
Install a qml plugin for the maildir account
This works and allows us to register other controllers and action
handlers, but it's not yet clear to me whether we should rather be
using kpackage for this as well (and I failed to get it to run, so,
here we are...)
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/CMakeLists.txt | 1 | ||||
-rw-r--r-- | accounts/maildir/CMakeLists.txt | 27 | ||||
-rw-r--r-- | accounts/maildir/package/contents/ui/MaildirAccountSettings.qml | 100 | ||||
-rw-r--r-- | accounts/maildir/qmldir | 3 |
4 files changed, 131 insertions, 0 deletions
diff --git a/accounts/CMakeLists.txt b/accounts/CMakeLists.txt new file mode 100644 index 00000000..25fa7f67 --- /dev/null +++ b/accounts/CMakeLists.txt | |||
@@ -0,0 +1 @@ | |||
add_subdirectory(maildir) | |||
diff --git a/accounts/maildir/CMakeLists.txt b/accounts/maildir/CMakeLists.txt new file mode 100644 index 00000000..7e9894b1 --- /dev/null +++ b/accounts/maildir/CMakeLists.txt | |||
@@ -0,0 +1,27 @@ | |||
1 | project(kube-accounts-maildir) | ||
2 | |||
3 | cmake_minimum_required(VERSION 2.8.10.1) | ||
4 | |||
5 | include(CPack) | ||
6 | include(FeatureSummary) | ||
7 | find_package(PkgConfig) | ||
8 | |||
9 | ################# set KDE specific information ################# | ||
10 | |||
11 | find_package(ECM 0.0.8 REQUIRED NO_MODULE) | ||
12 | |||
13 | # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked | ||
14 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) | ||
15 | |||
16 | include(KDEInstallDirs) | ||
17 | include(KDECMakeSettings) | ||
18 | include(KDECompilerSettings) | ||
19 | |||
20 | find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui) | ||
21 | |||
22 | set (QT_MIN_VERSION "5.4.0") | ||
23 | find_package(KF5 REQUIRED COMPONENTS Package) | ||
24 | |||
25 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/accounts/maildir) | ||
26 | install(FILES package/contents/ui/MaildirAccountSettings.qml DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/accounts/maildir) | ||
27 | |||
diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml new file mode 100644 index 00000000..5ba9f0c1 --- /dev/null +++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml | |||
@@ -0,0 +1,100 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> | ||
3 | * | ||
4 | * 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 | * the Free Software Foundation; either version 3 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | import QtQuick 2.4 | ||
19 | import QtQuick.Controls 1.4 | ||
20 | import QtQuick.Layouts 1.1 | ||
21 | |||
22 | import org.kde.kube.settings 1.0 as KubeSettings | ||
23 | // import org.kde.kube.accounts.maildir 1.0 as MaildirAccount | ||
24 | |||
25 | Rectangle { | ||
26 | id: root | ||
27 | property string accountId | ||
28 | property string accountName | ||
29 | |||
30 | color: colorPalette.background | ||
31 | |||
32 | GridLayout { | ||
33 | id: gridLayout | ||
34 | columns: 2 | ||
35 | Layout.fillWidth: true | ||
36 | |||
37 | Text { | ||
38 | Layout.columnSpan: 2 | ||
39 | Layout.fillWidth: true | ||
40 | text: "Account: " + accountName | ||
41 | } | ||
42 | |||
43 | Label { text: "Username" } | ||
44 | TextField { | ||
45 | id: username | ||
46 | text: "username" | ||
47 | Layout.fillWidth: true | ||
48 | } | ||
49 | |||
50 | Label { text: "Password" } | ||
51 | TextField { | ||
52 | id: password | ||
53 | text: "password" | ||
54 | Layout.fillWidth: true | ||
55 | } | ||
56 | |||
57 | Label { text: "Server" } | ||
58 | TextField { | ||
59 | id: server | ||
60 | text: "server" | ||
61 | Layout.fillWidth: true | ||
62 | } | ||
63 | |||
64 | //If we had a settings controller | ||
65 | // MaildirAccount.SmtpSettings { | ||
66 | // id: smtpSettings | ||
67 | // identifier: accountId | ||
68 | // property alias username: username.text | ||
69 | // property alias password: password.text | ||
70 | // property alias server: server.text | ||
71 | // } | ||
72 | |||
73 | KubeSettings.Settings { | ||
74 | id: accountSettings | ||
75 | identifier: "account." + modelData | ||
76 | property string primaryIdentity: "current" | ||
77 | } | ||
78 | KubeSettings.Settings { | ||
79 | id: identitySettings | ||
80 | identifier: "identity.current" | ||
81 | property string transport: "current" | ||
82 | } | ||
83 | KubeSettings.Settings { | ||
84 | id: transportSettings | ||
85 | identifier: "transport.current" | ||
86 | property alias username: username.text | ||
87 | property alias password: password.text | ||
88 | property alias server: server.text | ||
89 | } | ||
90 | |||
91 | Button { | ||
92 | id: button | ||
93 | text: "Save" | ||
94 | onClicked: { | ||
95 | smtpSettings.save(); | ||
96 | root.visible = false; | ||
97 | } | ||
98 | } | ||
99 | } | ||
100 | } | ||
diff --git a/accounts/maildir/qmldir b/accounts/maildir/qmldir new file mode 100644 index 00000000..40e6be1c --- /dev/null +++ b/accounts/maildir/qmldir | |||
@@ -0,0 +1,3 @@ | |||
1 | module org.kde.kube.accounts.maildir | ||
2 | |||
3 | AccountSettings 1.0 MaildirAccountSettings.qml | ||