diff options
-rw-r--r-- | accounts/generic/CMakeLists.txt | 1 | ||||
-rw-r--r-- | accounts/generic/metadata.json | 4 | ||||
-rw-r--r-- | accounts/gmail/CMakeLists.txt | 1 | ||||
-rw-r--r-- | accounts/gmail/metadata.json | 4 | ||||
-rw-r--r-- | accounts/imap/CMakeLists.txt | 1 | ||||
-rw-r--r-- | accounts/imap/metadata.json | 4 | ||||
-rw-r--r-- | accounts/kolabnow/CMakeLists.txt | 1 | ||||
-rw-r--r-- | accounts/kolabnow/metadata.json | 4 | ||||
-rw-r--r-- | accounts/maildir/metadata.json | 1 | ||||
-rw-r--r-- | components/accounts/qml/AccountWizard.qml | 6 | ||||
-rw-r--r-- | framework/src/accounts/accountfactory.cpp | 3 | ||||
-rw-r--r-- | framework/src/accounts/accountfactory.h | 2 |
12 files changed, 31 insertions, 1 deletions
diff --git a/accounts/generic/CMakeLists.txt b/accounts/generic/CMakeLists.txt index f609c2e1..5d485a67 100644 --- a/accounts/generic/CMakeLists.txt +++ b/accounts/generic/CMakeLists.txt | |||
@@ -20,4 +20,5 @@ target_link_libraries(genericaccountplugin | |||
20 | ) | 20 | ) |
21 | 21 | ||
22 | install(TARGETS genericaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/generic) | 22 | install(TARGETS genericaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/generic) |
23 | install(FILES metadata.json DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/generic) | ||
23 | install_qml_account(generic) | 24 | install_qml_account(generic) |
diff --git a/accounts/generic/metadata.json b/accounts/generic/metadata.json new file mode 100644 index 00000000..d89b1b67 --- /dev/null +++ b/accounts/generic/metadata.json | |||
@@ -0,0 +1,4 @@ | |||
1 | { | ||
2 | "Name": "Custom", | ||
3 | "RequiresKeyring": true | ||
4 | } | ||
diff --git a/accounts/gmail/CMakeLists.txt b/accounts/gmail/CMakeLists.txt index 42b95a45..f8baee04 100644 --- a/accounts/gmail/CMakeLists.txt +++ b/accounts/gmail/CMakeLists.txt | |||
@@ -15,4 +15,5 @@ target_link_libraries(gmailaccountplugin | |||
15 | ) | 15 | ) |
16 | 16 | ||
17 | install(TARGETS gmailaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/gmail) | 17 | install(TARGETS gmailaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/gmail) |
18 | install(FILES metadata.json DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/gmail) | ||
18 | install_qml_account(gmail) | 19 | install_qml_account(gmail) |
diff --git a/accounts/gmail/metadata.json b/accounts/gmail/metadata.json new file mode 100644 index 00000000..68c06971 --- /dev/null +++ b/accounts/gmail/metadata.json | |||
@@ -0,0 +1,4 @@ | |||
1 | { | ||
2 | "Name": "GMail", | ||
3 | "RequiresKeyring": true | ||
4 | } | ||
diff --git a/accounts/imap/CMakeLists.txt b/accounts/imap/CMakeLists.txt index 97399490..80aa6a0c 100644 --- a/accounts/imap/CMakeLists.txt +++ b/accounts/imap/CMakeLists.txt | |||
@@ -20,4 +20,5 @@ target_link_libraries(imapaccountplugin | |||
20 | ) | 20 | ) |
21 | 21 | ||
22 | install(TARGETS imapaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/imap) | 22 | install(TARGETS imapaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/imap) |
23 | install(FILES metadata.json DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/imap) | ||
23 | install_qml_account(imap) | 24 | install_qml_account(imap) |
diff --git a/accounts/imap/metadata.json b/accounts/imap/metadata.json new file mode 100644 index 00000000..f47e4792 --- /dev/null +++ b/accounts/imap/metadata.json | |||
@@ -0,0 +1,4 @@ | |||
1 | { | ||
2 | "Name": "IMAP", | ||
3 | "RequiresKeyring": true | ||
4 | } | ||
diff --git a/accounts/kolabnow/CMakeLists.txt b/accounts/kolabnow/CMakeLists.txt index 92beab1c..a2eda818 100644 --- a/accounts/kolabnow/CMakeLists.txt +++ b/accounts/kolabnow/CMakeLists.txt | |||
@@ -15,4 +15,5 @@ target_link_libraries(kolabnowaccountplugin | |||
15 | ) | 15 | ) |
16 | 16 | ||
17 | install(TARGETS kolabnowaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/kolabnow) | 17 | install(TARGETS kolabnowaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/kolabnow) |
18 | install(FILES metadata.json DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/kolabnow) | ||
18 | install_qml_account(kolabnow) | 19 | install_qml_account(kolabnow) |
diff --git a/accounts/kolabnow/metadata.json b/accounts/kolabnow/metadata.json new file mode 100644 index 00000000..28c64235 --- /dev/null +++ b/accounts/kolabnow/metadata.json | |||
@@ -0,0 +1,4 @@ | |||
1 | { | ||
2 | "Name": "Kolab Now", | ||
3 | "RequiresKeyring": true | ||
4 | } | ||
diff --git a/accounts/maildir/metadata.json b/accounts/maildir/metadata.json index 9f9f106e..8a674538 100644 --- a/accounts/maildir/metadata.json +++ b/accounts/maildir/metadata.json | |||
@@ -1,3 +1,4 @@ | |||
1 | { | 1 | { |
2 | "Name": "Maildir", | ||
2 | "RequiresKeyring": false | 3 | "RequiresKeyring": false |
3 | } | 4 | } |
diff --git a/components/accounts/qml/AccountWizard.qml b/components/accounts/qml/AccountWizard.qml index b928fd8b..eb259aa6 100644 --- a/components/accounts/qml/AccountWizard.qml +++ b/components/accounts/qml/AccountWizard.qml | |||
@@ -72,8 +72,12 @@ Kube.Popup { | |||
72 | delegate: Kube.Button { | 72 | delegate: Kube.Button { |
73 | objectName: "accountTypeButton" + modelData | 73 | objectName: "accountTypeButton" + modelData |
74 | Layout.fillWidth: true | 74 | Layout.fillWidth: true |
75 | text: modelData | 75 | text: accountFactory.accountName |
76 | onClicked: stack.push(wizardPage.createObject(stack, {accountType:modelData})) | 76 | onClicked: stack.push(wizardPage.createObject(stack, {accountType:modelData})) |
77 | Kube.AccountFactory { | ||
78 | id: accountFactory | ||
79 | accountType: modelData | ||
80 | } | ||
77 | } | 81 | } |
78 | } | 82 | } |
79 | } | 83 | } |
diff --git a/framework/src/accounts/accountfactory.cpp b/framework/src/accounts/accountfactory.cpp index 7f3f046d..c3c3a170 100644 --- a/framework/src/accounts/accountfactory.cpp +++ b/framework/src/accounts/accountfactory.cpp | |||
@@ -64,17 +64,20 @@ void AccountFactory::loadPackage() | |||
64 | }(); | 64 | }(); |
65 | mUiPath.clear(); | 65 | mUiPath.clear(); |
66 | mLoginUi.clear(); | 66 | mLoginUi.clear(); |
67 | mAccountName.clear(); | ||
67 | mRequiresKeyring = false; | 68 | mRequiresKeyring = false; |
68 | if (pluginPath.isEmpty()) { | 69 | if (pluginPath.isEmpty()) { |
69 | qWarning() << "Failed to load account package: " << "org.kube.accounts." + mAccountType; | 70 | qWarning() << "Failed to load account package: " << "org.kube.accounts." + mAccountType; |
70 | } else { | 71 | } else { |
71 | mUiPath = QUrl::fromLocalFile(pluginPath + "/AccountSettings.qml"); | 72 | mUiPath = QUrl::fromLocalFile(pluginPath + "/AccountSettings.qml"); |
72 | mLoginUi = QUrl::fromLocalFile(pluginPath + "/Login.qml"); | 73 | mLoginUi = QUrl::fromLocalFile(pluginPath + "/Login.qml"); |
74 | mAccountName = mAccountType; | ||
73 | if (QFileInfo::exists(pluginPath + "/metadata.json")) { | 75 | if (QFileInfo::exists(pluginPath + "/metadata.json")) { |
74 | QFile file{pluginPath + "/metadata.json"}; | 76 | QFile file{pluginPath + "/metadata.json"}; |
75 | file.open(QIODevice::ReadOnly); | 77 | file.open(QIODevice::ReadOnly); |
76 | auto json = QJsonDocument::fromJson(file.readAll()); | 78 | auto json = QJsonDocument::fromJson(file.readAll()); |
77 | mRequiresKeyring = json.object().value("RequiresKeyring").toBool(true); | 79 | mRequiresKeyring = json.object().value("RequiresKeyring").toBool(true); |
80 | mAccountName = json.object().value("Name").toString(); | ||
78 | } else { | 81 | } else { |
79 | mRequiresKeyring = true; | 82 | mRequiresKeyring = true; |
80 | } | 83 | } |
diff --git a/framework/src/accounts/accountfactory.h b/framework/src/accounts/accountfactory.h index 10acfbc1..b183f8fe 100644 --- a/framework/src/accounts/accountfactory.h +++ b/framework/src/accounts/accountfactory.h | |||
@@ -32,6 +32,7 @@ class KUBE_EXPORT AccountFactory : public QObject | |||
32 | Q_OBJECT | 32 | Q_OBJECT |
33 | Q_PROPERTY(QString accountId MEMBER mAccountId WRITE setAccountId); | 33 | Q_PROPERTY(QString accountId MEMBER mAccountId WRITE setAccountId); |
34 | Q_PROPERTY(QString accountType MEMBER mAccountType WRITE setAccountType); | 34 | Q_PROPERTY(QString accountType MEMBER mAccountType WRITE setAccountType); |
35 | Q_PROPERTY(QString accountName MEMBER mAccountName NOTIFY accountLoaded); | ||
35 | Q_PROPERTY(QUrl uiPath MEMBER mUiPath NOTIFY accountLoaded); | 36 | Q_PROPERTY(QUrl uiPath MEMBER mUiPath NOTIFY accountLoaded); |
36 | Q_PROPERTY(QUrl loginUi MEMBER mLoginUi NOTIFY accountLoaded); | 37 | Q_PROPERTY(QUrl loginUi MEMBER mLoginUi NOTIFY accountLoaded); |
37 | Q_PROPERTY(bool requiresKeyring MEMBER mRequiresKeyring NOTIFY accountLoaded); | 38 | Q_PROPERTY(bool requiresKeyring MEMBER mRequiresKeyring NOTIFY accountLoaded); |
@@ -47,6 +48,7 @@ signals: | |||
47 | private: | 48 | private: |
48 | void loadPackage(); | 49 | void loadPackage(); |
49 | QString mAccountId; | 50 | QString mAccountId; |
51 | QString mAccountName; | ||
50 | QUrl mUiPath; | 52 | QUrl mUiPath; |
51 | QUrl mLoginUi; | 53 | QUrl mLoginUi; |
52 | QByteArray mAccountType; | 54 | QByteArray mAccountType; |