summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--components/CMakeLists.txt12
-rw-r--r--components/accounts/AccountConfiguration.qml.in26
-rw-r--r--components/accounts/qmldir1
-rw-r--r--views/accounts/qml/View.qml2
5 files changed, 41 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 321cacf7..b5059760 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,7 @@ cmake_policy(SET CMP0063 NEW)
13option(EXPERIMENTAL_VIEWS "Install experimental views" OFF) 13option(EXPERIMENTAL_VIEWS "Install experimental views" OFF)
14#Do not enable this unless you actually distribute a custom extension. 14#Do not enable this unless you actually distribute a custom extension.
15option(ENABLE_EXTENSION "Enable custom kube extensions" OFF) 15option(ENABLE_EXTENSION "Enable custom kube extensions" OFF)
16set(AVAILABLE_ACCOUNT_PLUGINS "kolabnow" "imap" "maildir" "gmail" CACHE STRING "List of enabled account plugins (provide as semicolon separated string)" )
16 17
17include(CPack) 18include(CPack)
18include(FeatureSummary) 19include(FeatureSummary)
diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt
index 9ae2824d..1f477a4d 100644
--- a/components/CMakeLists.txt
+++ b/components/CMakeLists.txt
@@ -10,4 +10,16 @@ endmacro(install_qml_component)
10install_qml_component(kube) 10install_qml_component(kube)
11add_subdirectory(kube/tests) 11add_subdirectory(kube/tests)
12install_qml_component(accounts) 12install_qml_component(accounts)
13
14
15#Convert list to comma-separated and quoted list.
16set(_AVAILABLE_ACCOUNT_PLUGINS ${AVAILABLE_ACCOUNT_PLUGINS})
17set(AVAILABLE_ACCOUNT_PLUGINS "")
18foreach(PLUGIN ${_AVAILABLE_ACCOUNT_PLUGINS})
19 set(AVAILABLE_ACCOUNT_PLUGINS "${AVAILABLE_ACCOUNT_PLUGINS}, \"${PLUGIN}\"")
20endforeach()
21string(SUBSTRING "${AVAILABLE_ACCOUNT_PLUGINS}" 2 -1 AVAILABLE_ACCOUNT_PLUGINS)
22
23configure_file(accounts/AccountConfiguration.qml.in accounts/AccountConfiguration.qml)
24install(FILES ${CMAKE_CURRENT_BINARY_DIR}/accounts/AccountConfiguration.qml DESTINATION ${QML_INSTALL_DIR}/org/kube/components/accounts)
13install_qml_component(mailviewer) 25install_qml_component(mailviewer)
diff --git a/components/accounts/AccountConfiguration.qml.in b/components/accounts/AccountConfiguration.qml.in
new file mode 100644
index 00000000..58c70b59
--- /dev/null
+++ b/components/accounts/AccountConfiguration.qml.in
@@ -0,0 +1,26 @@
1/*
2 Copyright (C) 2018 Christian Mollekopf, <mollekopf@kolabsys.com>
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 2 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 along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19pragma Singleton
20
21import QtQuick 2.7
22
23Item {
24 property var availableAccountPlugins: [@AVAILABLE_ACCOUNT_PLUGINS@]
25}
26
diff --git a/components/accounts/qmldir b/components/accounts/qmldir
index 24759d6a..26d2c9b6 100644
--- a/components/accounts/qmldir
+++ b/components/accounts/qmldir
@@ -2,3 +2,4 @@ module org.kube.components.accounts
2 2
3Accounts 1.0 Accounts.qml 3Accounts 1.0 Accounts.qml
4AccountWizard 1.0 AccountWizard.qml 4AccountWizard 1.0 AccountWizard.qml
5singleton AccountConfiguration 1.0 AccountConfiguration.qml
diff --git a/views/accounts/qml/View.qml b/views/accounts/qml/View.qml
index 0bdab979..00fa845f 100644
--- a/views/accounts/qml/View.qml
+++ b/views/accounts/qml/View.qml
@@ -26,7 +26,7 @@ import org.kube.components.accounts 1.0 as KubeAccounts
26FocusScope { 26FocusScope {
27 id: root 27 id: root
28 //Defines available account types. 28 //Defines available account types.
29 property var availableAccountPlugins: ["kolabnow", "imap", "maildir", "gmail"] 29 property var availableAccountPlugins: KubeAccounts.AccountConfiguration.availableAccountPlugins
30 //Defines whether more than one account is supported. 30 //Defines whether more than one account is supported.
31 property bool singleAccountMode: availableAccountPlugins.length == 1 31 property bool singleAccountMode: availableAccountPlugins.length == 1
32 32