diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,10 +10,10 @@ cmake_policy(SET CMP0053 NEW) cmake_policy(SET CMP0063 NEW) -option(EXPERIMENTAL_VIEWS "Install experimental views" OFF) +option(EXPERIMENTAL_VIEWS "Install experimental views" ON) #Do not enable this unless you actually distribute a custom extension. option(ENABLE_EXTENSION "Enable custom kube extensions" OFF) -set(AVAILABLE_ACCOUNT_PLUGINS "kolabnow" "gmail" "generic" CACHE STRING "List of enabled account plugins (provide as semicolon separated string)" ) +set(AVAILABLE_ACCOUNT_PLUGINS "kolabnow" "google" "generic" CACHE STRING "List of enabled account plugins (provide as semicolon separated string)" ) include(CPack) include(FeatureSummary) diff --git a/accounts/CMakeLists.txt b/accounts/CMakeLists.txt --- a/accounts/CMakeLists.txt +++ b/accounts/CMakeLists.txt @@ -12,5 +12,5 @@ add_subdirectory(maildir) add_subdirectory(imap) add_subdirectory(kolabnow) -add_subdirectory(gmail) +add_subdirectory(google) add_subdirectory(generic) diff --git a/accounts/gmail/CMakeLists.txt b/accounts/gmail/CMakeLists.txt deleted file mode 100644 --- a/accounts/gmail/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -project(kube-accounts-gmail) - -set(SRCS - gmailsettings.cpp - gmailaccountplugin.cpp -) - -add_library(gmailaccountplugin SHARED ${SRCS}) -target_link_libraries(gmailaccountplugin - sink - frameworkplugin - Qt5::Core - Qt5::Quick - Qt5::Qml -) - -install(TARGETS gmailaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/gmail) -install(FILES metadata.json DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/gmail) -install_qml_account(gmail) diff --git a/accounts/gmail/qmldir b/accounts/gmail/qmldir deleted file mode 100644 --- a/accounts/gmail/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -module org.kube.accounts.gmail - -plugin gmailaccountplugin diff --git a/accounts/google/CMakeLists.txt b/accounts/google/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/accounts/google/CMakeLists.txt @@ -0,0 +1,19 @@ +project(kube-accounts-google) + +set(SRCS + googlesettings.cpp + googleaccountplugin.cpp +) + +add_library(googleaccountplugin SHARED ${SRCS}) +target_link_libraries(googleaccountplugin + sink + frameworkplugin + Qt5::Core + Qt5::Quick + Qt5::Qml +) + +install(TARGETS googleaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/google) +install(FILES metadata.json DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/google) +install_qml_account(google) diff --git a/accounts/gmail/gmailaccountplugin.h b/accounts/google/googleaccountplugin.h rename from accounts/gmail/gmailaccountplugin.h rename to accounts/google/googleaccountplugin.h --- a/accounts/gmail/gmailaccountplugin.h +++ b/accounts/google/googleaccountplugin.h @@ -21,7 +21,7 @@ #include #include -class GmailAccountPlugin : public QQmlExtensionPlugin +class GoogleAccountPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") diff --git a/accounts/gmail/gmailaccountplugin.cpp b/accounts/google/googleaccountplugin.cpp rename from accounts/gmail/gmailaccountplugin.cpp rename to accounts/google/googleaccountplugin.cpp --- a/accounts/gmail/gmailaccountplugin.cpp +++ b/accounts/google/googleaccountplugin.cpp @@ -16,14 +16,14 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "gmailaccountplugin.h" +#include "googleaccountplugin.h" -#include "gmailsettings.h" +#include "googlesettings.h" #include -void GmailAccountPlugin::registerTypes (const char *uri) +void GoogleAccountPlugin::registerTypes (const char *uri) { - Q_ASSERT(uri == QLatin1String("org.kube.accounts.gmail")); - qmlRegisterType(uri, 1, 0, "GmailSettings"); + Q_ASSERT(uri == QLatin1String("org.kube.accounts.google")); + qmlRegisterType(uri, 1, 0, "GoogleSettings"); } diff --git a/accounts/gmail/gmailsettings.h b/accounts/google/googlesettings.h rename from accounts/gmail/gmailsettings.h rename to accounts/google/googlesettings.h --- a/accounts/gmail/gmailsettings.h +++ b/accounts/google/googlesettings.h @@ -20,12 +20,12 @@ #include -class GmailSettings : public AccountSettings +class GoogleSettings : public AccountSettings { Q_OBJECT public: - GmailSettings(QObject *parent = 0); + GoogleSettings(QObject *parent = 0); Q_INVOKABLE virtual void load() Q_DECL_OVERRIDE; Q_INVOKABLE virtual void save() Q_DECL_OVERRIDE; diff --git a/accounts/gmail/gmailsettings.cpp b/accounts/google/googlesettings.cpp rename from accounts/gmail/gmailsettings.cpp rename to accounts/google/googlesettings.cpp --- a/accounts/gmail/gmailsettings.cpp +++ b/accounts/google/googlesettings.cpp @@ -16,14 +16,14 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "gmailsettings.h" +#include "googlesettings.h" -GmailSettings::GmailSettings(QObject *parent) +GoogleSettings::GoogleSettings(QObject *parent) : AccountSettings(parent) { } -void GmailSettings::load() +void GoogleSettings::load() { loadAccount(); loadImapResource(); @@ -31,7 +31,7 @@ loadIdentity(); } -void GmailSettings::save() +void GoogleSettings::save() { mImapServer = "imaps://imap.gmail.com:993"; mImapUsername = mEmailAddress; @@ -39,13 +39,21 @@ mSmtpServer = "smtps://smtp.gmail.com:587"; mSmtpUsername = mEmailAddress; + mCardDavServer = QStringLiteral("https://www.googleapis.com/carddav/v1/principals/") + mEmailAddress + "/"; + mCardDavUsername = mEmailAddress; + + mCalDavServer = QStringLiteral("https://www.google.com/calendar/dav/") + mEmailAddress + "/"; + mCalDavUsername = mEmailAddress; + saveAccount(); saveImapResource(); saveMailtransportResource(); + saveCardDavResource(); + saveCalDavResource(); saveIdentity(); } -void GmailSettings::remove() +void GoogleSettings::remove() { removeResource(mMailtransportIdentifier); removeResource(mImapIdentifier); diff --git a/accounts/gmail/metadata.json b/accounts/google/metadata.json rename from accounts/gmail/metadata.json rename to accounts/google/metadata.json --- a/accounts/gmail/metadata.json +++ b/accounts/google/metadata.json @@ -1,4 +1,4 @@ { - "Name": "GMail", + "Name": "Google", "RequiresKeyring": true } diff --git a/accounts/gmail/qml/AccountSettings.qml b/accounts/google/qml/AccountSettings.qml rename from accounts/gmail/qml/AccountSettings.qml rename to accounts/google/qml/AccountSettings.qml --- a/accounts/gmail/qml/AccountSettings.qml +++ b/accounts/google/qml/AccountSettings.qml @@ -20,28 +20,28 @@ import QtQuick 2.4 import QtQuick.Layouts 1.1 import org.kube.framework 1.0 as Kube -import org.kube.accounts.gmail 1.0 as GmailAccount +import org.kube.accounts.google 1.0 as GoogleAccount Item { property string accountId - property string heading: qsTr("Connect your GMail account") + property string heading: qsTr("Connect your Google account") 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.") property bool valid: true implicitHeight: grid.implicitHeight - GmailAccount.GmailSettings { - id: gmailSettings + GoogleAccount.GoogleSettings { + id: googleSettings accountIdentifier: accountId - accountType: "gmail" + accountType: "google" } function save(){ - gmailSettings.save() + googleSettings.save() } function remove(){ - gmailSettings.remove() + googleSettings.remove() } GridLayout { @@ -52,7 +52,7 @@ rowSpacing: Kube.Units.largeSpacing Kube.Label { - text: "Please note that GMail requires you to configure your account to allow IMAP connections from Kube: + text: "Please note that Google requires you to configure your account to allow IMAP connections from Kube:
  1. See https://support.google.com/mail/answer/7126229 to configure your account to allow IMAP connections.
  2. Visit https://myaccount.google.com/lesssecureapps and enable the setting to allow Kube to connect to your account." @@ -68,9 +68,9 @@ Kube.TextField { Layout.fillWidth: true placeholderText: qsTr("Your name") - text: gmailSettings.userName + text: googleSettings.userName onTextChanged: { - gmailSettings.userName = text + googleSettings.userName = text } } @@ -81,10 +81,10 @@ Kube.TextField { Layout.fillWidth: true - text: gmailSettings.emailAddress + text: googleSettings.emailAddress onTextChanged: { - gmailSettings.emailAddress = text - gmailSettings.accountName = text + googleSettings.emailAddress = text + googleSettings.accountName = text } placeholderText: qsTr("Your email address") } diff --git a/accounts/gmail/qml/Login.qml b/accounts/google/qml/Login.qml rename from accounts/gmail/qml/Login.qml rename to accounts/google/qml/Login.qml --- a/accounts/gmail/qml/Login.qml +++ b/accounts/google/qml/Login.qml @@ -20,7 +20,7 @@ import QtQuick 2.4 import QtQuick.Layouts 1.1 import org.kube.framework 1.0 as Kube -import org.kube.accounts.gmail 1.0 as GmailAccount +import org.kube.accounts.google 1.0 as GoogleAccount Item { property alias accountId: settings.accountIdentifier @@ -28,9 +28,9 @@ property string subheadline: settings.accountName property bool valid: pwField.acceptableInput - GmailAccount.GmailSettings { + GoogleAccount.GoogleSettings { id: settings - accountType: "gmail" + accountType: "google" } function login(){ diff --git a/accounts/google/qmldir b/accounts/google/qmldir new file mode 100644 --- /dev/null +++ b/accounts/google/qmldir @@ -0,0 +1,3 @@ +module org.kube.accounts.google + +plugin googleaccountplugin