diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-04-17 14:17:39 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-04-17 14:17:39 +0200 |
commit | afaaeb6dc16315c78091653a2662be41781ddfd3 (patch) | |
tree | 6e6a28e39d6ee9a74c66c1aa9c13a4e930f4a431 | |
parent | 79f27c81dac3c8e7090cbc00cd65b3b9f5d8247a (diff) | |
download | kube-afaaeb6dc16315c78091653a2662be41781ddfd3.tar.gz kube-afaaeb6dc16315c78091653a2662be41781ddfd3.zip |
Set the list of available account plugins from cmake
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | components/CMakeLists.txt | 12 | ||||
-rw-r--r-- | components/accounts/AccountConfiguration.qml.in | 26 | ||||
-rw-r--r-- | components/accounts/qmldir | 1 | ||||
-rw-r--r-- | views/accounts/qml/View.qml | 2 |
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) | |||
13 | option(EXPERIMENTAL_VIEWS "Install experimental views" OFF) | 13 | option(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. |
15 | option(ENABLE_EXTENSION "Enable custom kube extensions" OFF) | 15 | option(ENABLE_EXTENSION "Enable custom kube extensions" OFF) |
16 | set(AVAILABLE_ACCOUNT_PLUGINS "kolabnow" "imap" "maildir" "gmail" CACHE STRING "List of enabled account plugins (provide as semicolon separated string)" ) | ||
16 | 17 | ||
17 | include(CPack) | 18 | include(CPack) |
18 | include(FeatureSummary) | 19 | include(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) | |||
10 | install_qml_component(kube) | 10 | install_qml_component(kube) |
11 | add_subdirectory(kube/tests) | 11 | add_subdirectory(kube/tests) |
12 | install_qml_component(accounts) | 12 | install_qml_component(accounts) |
13 | |||
14 | |||
15 | #Convert list to comma-separated and quoted list. | ||
16 | set(_AVAILABLE_ACCOUNT_PLUGINS ${AVAILABLE_ACCOUNT_PLUGINS}) | ||
17 | set(AVAILABLE_ACCOUNT_PLUGINS "") | ||
18 | foreach(PLUGIN ${_AVAILABLE_ACCOUNT_PLUGINS}) | ||
19 | set(AVAILABLE_ACCOUNT_PLUGINS "${AVAILABLE_ACCOUNT_PLUGINS}, \"${PLUGIN}\"") | ||
20 | endforeach() | ||
21 | string(SUBSTRING "${AVAILABLE_ACCOUNT_PLUGINS}" 2 -1 AVAILABLE_ACCOUNT_PLUGINS) | ||
22 | |||
23 | configure_file(accounts/AccountConfiguration.qml.in accounts/AccountConfiguration.qml) | ||
24 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/accounts/AccountConfiguration.qml DESTINATION ${QML_INSTALL_DIR}/org/kube/components/accounts) | ||
13 | install_qml_component(mailviewer) | 25 | install_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 | |||
19 | pragma Singleton | ||
20 | |||
21 | import QtQuick 2.7 | ||
22 | |||
23 | Item { | ||
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 | ||
3 | Accounts 1.0 Accounts.qml | 3 | Accounts 1.0 Accounts.qml |
4 | AccountWizard 1.0 AccountWizard.qml | 4 | AccountWizard 1.0 AccountWizard.qml |
5 | singleton 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 | |||
26 | FocusScope { | 26 | FocusScope { |
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 | ||