diff options
author | Minijackson <minijackson@riseup.net> | 2018-08-23 09:22:21 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2018-08-23 09:22:21 +0200 |
commit | ef1cf433c9598430654e87790fdb1be11f82ecd1 (patch) | |
tree | 26f3e78c96f1901fa9d123650719bb891ad3b7ad | |
parent | e723ae9154f8a883ec563060b70e7ec04fc64fcf (diff) | |
download | kube-ef1cf433c9598430654e87790fdb1be11f82ecd1.tar.gz kube-ef1cf433c9598430654e87790fdb1be11f82ecd1.zip |
Add caldav and carddav URLs + rename Gmail -> Google
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | accounts/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accounts/gmail/CMakeLists.txt | 19 | ||||
-rw-r--r-- | accounts/gmail/qmldir | 3 | ||||
-rw-r--r-- | accounts/google/CMakeLists.txt | 19 | ||||
-rw-r--r-- | accounts/google/googleaccountplugin.cpp (renamed from accounts/gmail/gmailaccountplugin.cpp) | 10 | ||||
-rw-r--r-- | accounts/google/googleaccountplugin.h (renamed from accounts/gmail/gmailaccountplugin.h) | 2 | ||||
-rw-r--r-- | accounts/google/googlesettings.cpp (renamed from accounts/gmail/gmailsettings.cpp) | 18 | ||||
-rw-r--r-- | accounts/google/googlesettings.h (renamed from accounts/gmail/gmailsettings.h) | 4 | ||||
-rw-r--r-- | accounts/google/metadata.json (renamed from accounts/gmail/metadata.json) | 2 | ||||
-rw-r--r-- | accounts/google/qml/AccountSettings.qml (renamed from accounts/gmail/qml/AccountSettings.qml) | 26 | ||||
-rw-r--r-- | accounts/google/qml/Login.qml (renamed from accounts/gmail/qml/Login.qml) | 6 | ||||
-rw-r--r-- | accounts/google/qmldir | 3 |
13 files changed, 63 insertions, 55 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 25cc0fff..5924c124 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -10,10 +10,10 @@ cmake_policy(SET CMP0048 NEW) | |||
10 | cmake_policy(SET CMP0053 NEW) | 10 | cmake_policy(SET CMP0053 NEW) |
11 | cmake_policy(SET CMP0063 NEW) | 11 | cmake_policy(SET CMP0063 NEW) |
12 | 12 | ||
13 | option(EXPERIMENTAL_VIEWS "Install experimental views" OFF) | 13 | option(EXPERIMENTAL_VIEWS "Install experimental views" ON) |
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" "gmail" "generic" CACHE STRING "List of enabled account plugins (provide as semicolon separated string)" ) | 16 | set(AVAILABLE_ACCOUNT_PLUGINS "kolabnow" "google" "generic" CACHE STRING "List of enabled account plugins (provide as semicolon separated string)" ) |
17 | 17 | ||
18 | include(CPack) | 18 | include(CPack) |
19 | include(FeatureSummary) | 19 | include(FeatureSummary) |
diff --git a/accounts/CMakeLists.txt b/accounts/CMakeLists.txt index 76a11c54..0209f00b 100644 --- a/accounts/CMakeLists.txt +++ b/accounts/CMakeLists.txt | |||
@@ -12,5 +12,5 @@ endmacro(install_qml_account) | |||
12 | add_subdirectory(maildir) | 12 | add_subdirectory(maildir) |
13 | add_subdirectory(imap) | 13 | add_subdirectory(imap) |
14 | add_subdirectory(kolabnow) | 14 | add_subdirectory(kolabnow) |
15 | add_subdirectory(gmail) | 15 | add_subdirectory(google) |
16 | add_subdirectory(generic) | 16 | add_subdirectory(generic) |
diff --git a/accounts/gmail/CMakeLists.txt b/accounts/gmail/CMakeLists.txt deleted file mode 100644 index f8baee04..00000000 --- a/accounts/gmail/CMakeLists.txt +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | project(kube-accounts-gmail) | ||
2 | |||
3 | set(SRCS | ||
4 | gmailsettings.cpp | ||
5 | gmailaccountplugin.cpp | ||
6 | ) | ||
7 | |||
8 | add_library(gmailaccountplugin SHARED ${SRCS}) | ||
9 | target_link_libraries(gmailaccountplugin | ||
10 | sink | ||
11 | frameworkplugin | ||
12 | Qt5::Core | ||
13 | Qt5::Quick | ||
14 | Qt5::Qml | ||
15 | ) | ||
16 | |||
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) | ||
19 | install_qml_account(gmail) | ||
diff --git a/accounts/gmail/qmldir b/accounts/gmail/qmldir deleted file mode 100644 index 78a9e5b7..00000000 --- a/accounts/gmail/qmldir +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | module org.kube.accounts.gmail | ||
2 | |||
3 | plugin gmailaccountplugin | ||
diff --git a/accounts/google/CMakeLists.txt b/accounts/google/CMakeLists.txt new file mode 100644 index 00000000..3732190d --- /dev/null +++ b/accounts/google/CMakeLists.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | project(kube-accounts-google) | ||
2 | |||
3 | set(SRCS | ||
4 | googlesettings.cpp | ||
5 | googleaccountplugin.cpp | ||
6 | ) | ||
7 | |||
8 | add_library(googleaccountplugin SHARED ${SRCS}) | ||
9 | target_link_libraries(googleaccountplugin | ||
10 | sink | ||
11 | frameworkplugin | ||
12 | Qt5::Core | ||
13 | Qt5::Quick | ||
14 | Qt5::Qml | ||
15 | ) | ||
16 | |||
17 | install(TARGETS googleaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/google) | ||
18 | install(FILES metadata.json DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/google) | ||
19 | install_qml_account(google) | ||
diff --git a/accounts/gmail/gmailaccountplugin.cpp b/accounts/google/googleaccountplugin.cpp index 53218939..d419e585 100644 --- a/accounts/gmail/gmailaccountplugin.cpp +++ b/accounts/google/googleaccountplugin.cpp | |||
@@ -16,14 +16,14 @@ | |||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
17 | 02110-1301, USA. | 17 | 02110-1301, USA. |
18 | */ | 18 | */ |
19 | #include "gmailaccountplugin.h" | 19 | #include "googleaccountplugin.h" |
20 | 20 | ||
21 | #include "gmailsettings.h" | 21 | #include "googlesettings.h" |
22 | 22 | ||
23 | #include <QtQml> | 23 | #include <QtQml> |
24 | 24 | ||
25 | void GmailAccountPlugin::registerTypes (const char *uri) | 25 | void GoogleAccountPlugin::registerTypes (const char *uri) |
26 | { | 26 | { |
27 | Q_ASSERT(uri == QLatin1String("org.kube.accounts.gmail")); | 27 | Q_ASSERT(uri == QLatin1String("org.kube.accounts.google")); |
28 | qmlRegisterType<GmailSettings>(uri, 1, 0, "GmailSettings"); | 28 | qmlRegisterType<GoogleSettings>(uri, 1, 0, "GoogleSettings"); |
29 | } | 29 | } |
diff --git a/accounts/gmail/gmailaccountplugin.h b/accounts/google/googleaccountplugin.h index 5876e393..d546c4f9 100644 --- a/accounts/gmail/gmailaccountplugin.h +++ b/accounts/google/googleaccountplugin.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <QQmlEngine> | 21 | #include <QQmlEngine> |
22 | #include <QQmlExtensionPlugin> | 22 | #include <QQmlExtensionPlugin> |
23 | 23 | ||
24 | class GmailAccountPlugin : public QQmlExtensionPlugin | 24 | class GoogleAccountPlugin : public QQmlExtensionPlugin |
25 | { | 25 | { |
26 | Q_OBJECT | 26 | Q_OBJECT |
27 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") | 27 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") |
diff --git a/accounts/gmail/gmailsettings.cpp b/accounts/google/googlesettings.cpp index a50668b8..6c4c32de 100644 --- a/accounts/gmail/gmailsettings.cpp +++ b/accounts/google/googlesettings.cpp | |||
@@ -16,14 +16,14 @@ | |||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
17 | 02110-1301, USA. | 17 | 02110-1301, USA. |
18 | */ | 18 | */ |
19 | #include "gmailsettings.h" | 19 | #include "googlesettings.h" |
20 | 20 | ||
21 | GmailSettings::GmailSettings(QObject *parent) | 21 | GoogleSettings::GoogleSettings(QObject *parent) |
22 | : AccountSettings(parent) | 22 | : AccountSettings(parent) |
23 | { | 23 | { |
24 | } | 24 | } |
25 | 25 | ||
26 | void GmailSettings::load() | 26 | void GoogleSettings::load() |
27 | { | 27 | { |
28 | loadAccount(); | 28 | loadAccount(); |
29 | loadImapResource(); | 29 | loadImapResource(); |
@@ -31,7 +31,7 @@ void GmailSettings::load() | |||
31 | loadIdentity(); | 31 | loadIdentity(); |
32 | } | 32 | } |
33 | 33 | ||
34 | void GmailSettings::save() | 34 | void GoogleSettings::save() |
35 | { | 35 | { |
36 | mImapServer = "imaps://imap.gmail.com:993"; | 36 | mImapServer = "imaps://imap.gmail.com:993"; |
37 | mImapUsername = mEmailAddress; | 37 | mImapUsername = mEmailAddress; |
@@ -39,13 +39,21 @@ void GmailSettings::save() | |||
39 | mSmtpServer = "smtps://smtp.gmail.com:587"; | 39 | mSmtpServer = "smtps://smtp.gmail.com:587"; |
40 | mSmtpUsername = mEmailAddress; | 40 | mSmtpUsername = mEmailAddress; |
41 | 41 | ||
42 | mCardDavServer = QStringLiteral("https://www.googleapis.com/carddav/v1/principals/") + mEmailAddress + "/"; | ||
43 | mCardDavUsername = mEmailAddress; | ||
44 | |||
45 | mCalDavServer = QStringLiteral("https://www.google.com/calendar/dav/") + mEmailAddress + "/"; | ||
46 | mCalDavUsername = mEmailAddress; | ||
47 | |||
42 | saveAccount(); | 48 | saveAccount(); |
43 | saveImapResource(); | 49 | saveImapResource(); |
44 | saveMailtransportResource(); | 50 | saveMailtransportResource(); |
51 | saveCardDavResource(); | ||
52 | saveCalDavResource(); | ||
45 | saveIdentity(); | 53 | saveIdentity(); |
46 | } | 54 | } |
47 | 55 | ||
48 | void GmailSettings::remove() | 56 | void GoogleSettings::remove() |
49 | { | 57 | { |
50 | removeResource(mMailtransportIdentifier); | 58 | removeResource(mMailtransportIdentifier); |
51 | removeResource(mImapIdentifier); | 59 | removeResource(mImapIdentifier); |
diff --git a/accounts/gmail/gmailsettings.h b/accounts/google/googlesettings.h index 708cb94b..ac7ae61f 100644 --- a/accounts/gmail/gmailsettings.h +++ b/accounts/google/googlesettings.h | |||
@@ -20,12 +20,12 @@ | |||
20 | 20 | ||
21 | #include <domain/settings/accountsettings.h> | 21 | #include <domain/settings/accountsettings.h> |
22 | 22 | ||
23 | class GmailSettings : public AccountSettings | 23 | class GoogleSettings : public AccountSettings |
24 | { | 24 | { |
25 | Q_OBJECT | 25 | Q_OBJECT |
26 | 26 | ||
27 | public: | 27 | public: |
28 | GmailSettings(QObject *parent = 0); | 28 | GoogleSettings(QObject *parent = 0); |
29 | 29 | ||
30 | Q_INVOKABLE virtual void load() Q_DECL_OVERRIDE; | 30 | Q_INVOKABLE virtual void load() Q_DECL_OVERRIDE; |
31 | Q_INVOKABLE virtual void save() Q_DECL_OVERRIDE; | 31 | Q_INVOKABLE virtual void save() Q_DECL_OVERRIDE; |
diff --git a/accounts/gmail/metadata.json b/accounts/google/metadata.json index 68c06971..0ad786f1 100644 --- a/accounts/gmail/metadata.json +++ b/accounts/google/metadata.json | |||
@@ -1,4 +1,4 @@ | |||
1 | { | 1 | { |
2 | "Name": "GMail", | 2 | "Name": "Google", |
3 | "RequiresKeyring": true | 3 | "RequiresKeyring": true |
4 | } | 4 | } |
diff --git a/accounts/gmail/qml/AccountSettings.qml b/accounts/google/qml/AccountSettings.qml index d7df5eaf..73cdfbd7 100644 --- a/accounts/gmail/qml/AccountSettings.qml +++ b/accounts/google/qml/AccountSettings.qml | |||
@@ -20,28 +20,28 @@ | |||
20 | import QtQuick 2.4 | 20 | import QtQuick 2.4 |
21 | import QtQuick.Layouts 1.1 | 21 | import QtQuick.Layouts 1.1 |
22 | import org.kube.framework 1.0 as Kube | 22 | import org.kube.framework 1.0 as Kube |
23 | import org.kube.accounts.gmail 1.0 as GmailAccount | 23 | import org.kube.accounts.google 1.0 as GoogleAccount |
24 | 24 | ||
25 | Item { | 25 | Item { |
26 | 26 | ||
27 | property string accountId | 27 | property string accountId |
28 | property string heading: qsTr("Connect your GMail account") | 28 | property string heading: qsTr("Connect your Google account") |
29 | property string subheadline: qsTr("To let Kube access your account, fill in email address, username and give the account a title that will be displayed inside Kube.") | 29 | property string subheadline: qsTr("To let Kube access your account, fill in email address, username and give the account a title that will be displayed inside Kube.") |
30 | property bool valid: true | 30 | property bool valid: true |
31 | implicitHeight: grid.implicitHeight | 31 | implicitHeight: grid.implicitHeight |
32 | 32 | ||
33 | GmailAccount.GmailSettings { | 33 | GoogleAccount.GoogleSettings { |
34 | id: gmailSettings | 34 | id: googleSettings |
35 | accountIdentifier: accountId | 35 | accountIdentifier: accountId |
36 | accountType: "gmail" | 36 | accountType: "google" |
37 | } | 37 | } |
38 | 38 | ||
39 | function save(){ | 39 | function save(){ |
40 | gmailSettings.save() | 40 | googleSettings.save() |
41 | } | 41 | } |
42 | 42 | ||
43 | function remove(){ | 43 | function remove(){ |
44 | gmailSettings.remove() | 44 | googleSettings.remove() |
45 | } | 45 | } |
46 | 46 | ||
47 | GridLayout { | 47 | GridLayout { |
@@ -52,7 +52,7 @@ Item { | |||
52 | rowSpacing: Kube.Units.largeSpacing | 52 | rowSpacing: Kube.Units.largeSpacing |
53 | 53 | ||
54 | Kube.Label { | 54 | Kube.Label { |
55 | text: "Please note that GMail requires you to configure your account to allow IMAP connections from Kube: | 55 | text: "Please note that Google requires you to configure your account to allow IMAP connections from Kube: |
56 | <ol type=''> | 56 | <ol type=''> |
57 | <li> See <a href='https://support.google.com/mail/answer/7126229'>https://support.google.com/mail/answer/7126229</a> to configure your account to allow IMAP connections. | 57 | <li> See <a href='https://support.google.com/mail/answer/7126229'>https://support.google.com/mail/answer/7126229</a> to configure your account to allow IMAP connections. |
58 | <li> Visit <a href='https://myaccount.google.com/lesssecureapps'>https://myaccount.google.com/lesssecureapps</a> and enable the setting to allow Kube to connect to your account." | 58 | <li> Visit <a href='https://myaccount.google.com/lesssecureapps'>https://myaccount.google.com/lesssecureapps</a> and enable the setting to allow Kube to connect to your account." |
@@ -68,9 +68,9 @@ Item { | |||
68 | Kube.TextField { | 68 | Kube.TextField { |
69 | Layout.fillWidth: true | 69 | Layout.fillWidth: true |
70 | placeholderText: qsTr("Your name") | 70 | placeholderText: qsTr("Your name") |
71 | text: gmailSettings.userName | 71 | text: googleSettings.userName |
72 | onTextChanged: { | 72 | onTextChanged: { |
73 | gmailSettings.userName = text | 73 | googleSettings.userName = text |
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
@@ -81,10 +81,10 @@ Item { | |||
81 | Kube.TextField { | 81 | Kube.TextField { |
82 | Layout.fillWidth: true | 82 | Layout.fillWidth: true |
83 | 83 | ||
84 | text: gmailSettings.emailAddress | 84 | text: googleSettings.emailAddress |
85 | onTextChanged: { | 85 | onTextChanged: { |
86 | gmailSettings.emailAddress = text | 86 | googleSettings.emailAddress = text |
87 | gmailSettings.accountName = text | 87 | googleSettings.accountName = text |
88 | } | 88 | } |
89 | placeholderText: qsTr("Your email address") | 89 | placeholderText: qsTr("Your email address") |
90 | } | 90 | } |
diff --git a/accounts/gmail/qml/Login.qml b/accounts/google/qml/Login.qml index bcab19be..0a44aa8c 100644 --- a/accounts/gmail/qml/Login.qml +++ b/accounts/google/qml/Login.qml | |||
@@ -20,7 +20,7 @@ | |||
20 | import QtQuick 2.4 | 20 | import QtQuick 2.4 |
21 | import QtQuick.Layouts 1.1 | 21 | import QtQuick.Layouts 1.1 |
22 | import org.kube.framework 1.0 as Kube | 22 | import org.kube.framework 1.0 as Kube |
23 | import org.kube.accounts.gmail 1.0 as GmailAccount | 23 | import org.kube.accounts.google 1.0 as GoogleAccount |
24 | 24 | ||
25 | Item { | 25 | Item { |
26 | property alias accountId: settings.accountIdentifier | 26 | property alias accountId: settings.accountIdentifier |
@@ -28,9 +28,9 @@ Item { | |||
28 | property string subheadline: settings.accountName | 28 | property string subheadline: settings.accountName |
29 | property bool valid: pwField.acceptableInput | 29 | property bool valid: pwField.acceptableInput |
30 | 30 | ||
31 | GmailAccount.GmailSettings { | 31 | GoogleAccount.GoogleSettings { |
32 | id: settings | 32 | id: settings |
33 | accountType: "gmail" | 33 | accountType: "google" |
34 | } | 34 | } |
35 | 35 | ||
36 | function login(){ | 36 | function login(){ |
diff --git a/accounts/google/qmldir b/accounts/google/qmldir new file mode 100644 index 00000000..a4a06cb7 --- /dev/null +++ b/accounts/google/qmldir | |||
@@ -0,0 +1,3 @@ | |||
1 | module org.kube.accounts.google | ||
2 | |||
3 | plugin googleaccountplugin | ||