From 2ffbd47ae807d044ac563fb680a322cefebe4ef7 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 18 Dec 2017 21:06:21 +0100 Subject: Removed kpackage structure --- accounts/CMakeLists.txt | 2 +- .../gmail/package/contents/ui/AccountSettings.qml | 122 ------------------- accounts/gmail/package/metadata.desktop | 8 -- accounts/gmail/qml/AccountSettings.qml | 122 +++++++++++++++++++ .../imap/package/contents/ui/AccountSettings.qml | 129 --------------------- accounts/imap/package/contents/ui/Login.qml | 62 ---------- accounts/imap/package/metadata.desktop | 8 -- accounts/imap/qml/AccountSettings.qml | 129 +++++++++++++++++++++ accounts/imap/qml/Login.qml | 62 ++++++++++ .../package/contents/ui/AccountSettings.qml | 84 -------------- accounts/kolabnow/package/contents/ui/Login.qml | 62 ---------- accounts/kolabnow/package/metadata.desktop | 8 -- accounts/kolabnow/qml/AccountSettings.qml | 84 ++++++++++++++ accounts/kolabnow/qml/Login.qml | 62 ++++++++++ .../package/contents/ui/AccountSettings.qml | 107 ----------------- accounts/maildir/package/metadata.desktop | 9 -- accounts/maildir/qml/AccountSettings.qml | 107 +++++++++++++++++ components/CMakeLists.txt | 2 +- 18 files changed, 568 insertions(+), 601 deletions(-) delete mode 100644 accounts/gmail/package/contents/ui/AccountSettings.qml delete mode 100644 accounts/gmail/package/metadata.desktop create mode 100644 accounts/gmail/qml/AccountSettings.qml delete mode 100644 accounts/imap/package/contents/ui/AccountSettings.qml delete mode 100644 accounts/imap/package/contents/ui/Login.qml delete mode 100644 accounts/imap/package/metadata.desktop create mode 100644 accounts/imap/qml/AccountSettings.qml create mode 100644 accounts/imap/qml/Login.qml delete mode 100644 accounts/kolabnow/package/contents/ui/AccountSettings.qml delete mode 100644 accounts/kolabnow/package/contents/ui/Login.qml delete mode 100644 accounts/kolabnow/package/metadata.desktop create mode 100644 accounts/kolabnow/qml/AccountSettings.qml create mode 100644 accounts/kolabnow/qml/Login.qml delete mode 100644 accounts/maildir/package/contents/ui/AccountSettings.qml delete mode 100644 accounts/maildir/package/metadata.desktop create mode 100644 accounts/maildir/qml/AccountSettings.qml diff --git a/accounts/CMakeLists.txt b/accounts/CMakeLists.txt index 26a45a0a..bf116942 100644 --- a/accounts/CMakeLists.txt +++ b/accounts/CMakeLists.txt @@ -5,7 +5,7 @@ find_package(Sink CONFIG REQUIRED) find_package(KAsync CONFIG REQUIRED) macro(install_qml_account name) - install(DIRECTORY package/contents/ui/ DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/${name}) + install(DIRECTORY qml/ DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/${name}) install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/${name}) endmacro(install_qml_account) diff --git a/accounts/gmail/package/contents/ui/AccountSettings.qml b/accounts/gmail/package/contents/ui/AccountSettings.qml deleted file mode 100644 index 16f7dbf3..00000000 --- a/accounts/gmail/package/contents/ui/AccountSettings.qml +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender, - Copyright (C) 2017 Christian Mollekopf, - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 2.4 -import QtQuick.Controls 1.4 as Controls -import QtQuick.Layouts 1.1 -import org.kube.framework 1.0 as Kube -import org.kube.accounts.gmail 1.0 as GmailAccount - -Item { - - property string accountId - property string heading: qsTr("Connect your GMail account") - property string subheadline: qsTr("To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube.") - property bool valid: true - implicitHeight: grid.implicitHeight - - GmailAccount.GmailSettings { - id: gmailSettings - accountIdentifier: accountId - accountType: "gmail" - } - - function save(){ - gmailSettings.save() - } - - function remove(){ - gmailSettings.remove() - } - - GridLayout { - id: grid - anchors.fill: parent - columns: 2 - columnSpacing: Kube.Units.largeSpacing - rowSpacing: Kube.Units.largeSpacing - - Kube.Label { - text: "Please note that GMail 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." - Layout.alignment: Qt.AlignCenter - Layout.columnSpan: 2 - textFormat: Text.StyledText - } - - Kube.Label { - text: qsTr("Title of Account") - Layout.alignment: Qt.AlignRight - } - Kube.TextField { - Layout.fillWidth: true - placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") - text: gmailSettings.accountName - onTextChanged: { - gmailSettings.accountName = text - } - } - - Kube.Label { - text: qsTr("Name") - Layout.alignment: Qt.AlignRight - } - Kube.TextField { - Layout.fillWidth: true - placeholderText: qsTr("Your name") - text: gmailSettings.userName - onTextChanged: { - gmailSettings.userName = text - } - } - - Kube.Label { - text: qsTr("Email address") - Layout.alignment: Qt.AlignRight - } - Kube.TextField { - Layout.fillWidth: true - - text: gmailSettings.emailAddress - onTextChanged: { - gmailSettings.emailAddress = text - } - placeholderText: qsTr("Your email address") - } - - Kube.Label { - text: qsTr("Password") - Layout.alignment: Qt.AlignRight - } - - Kube.PasswordField { - id: pwField - Layout.fillWidth: true - - placeholderText: qsTr("Password of your email account") - text: gmailSettings.imapPassword - onTextChanged: { - gmailSettings.imapPassword = text - gmailSettings.smtpPassword = text - } - } - } -} diff --git a/accounts/gmail/package/metadata.desktop b/accounts/gmail/package/metadata.desktop deleted file mode 100644 index e2b71ec9..00000000 --- a/accounts/gmail/package/metadata.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=Kube GMail Accounts Plugin -X-KDE-PluginInfo-Name=org.kube.accounts.gmail -Exec=kpackagelauncherqml -a org.kube.accounts.gmail -X-Plasma-MainScript=ui/GmailSettings.qml -X-KDE-ServiceTypes=KPackage/GenericQML -Icon=folder -Type=Service diff --git a/accounts/gmail/qml/AccountSettings.qml b/accounts/gmail/qml/AccountSettings.qml new file mode 100644 index 00000000..16f7dbf3 --- /dev/null +++ b/accounts/gmail/qml/AccountSettings.qml @@ -0,0 +1,122 @@ +/* + Copyright (C) 2016 Michael Bohlender, + Copyright (C) 2017 Christian Mollekopf, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +import QtQuick 2.4 +import QtQuick.Controls 1.4 as Controls +import QtQuick.Layouts 1.1 +import org.kube.framework 1.0 as Kube +import org.kube.accounts.gmail 1.0 as GmailAccount + +Item { + + property string accountId + property string heading: qsTr("Connect your GMail account") + property string subheadline: qsTr("To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube.") + property bool valid: true + implicitHeight: grid.implicitHeight + + GmailAccount.GmailSettings { + id: gmailSettings + accountIdentifier: accountId + accountType: "gmail" + } + + function save(){ + gmailSettings.save() + } + + function remove(){ + gmailSettings.remove() + } + + GridLayout { + id: grid + anchors.fill: parent + columns: 2 + columnSpacing: Kube.Units.largeSpacing + rowSpacing: Kube.Units.largeSpacing + + Kube.Label { + text: "Please note that GMail 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." + Layout.alignment: Qt.AlignCenter + Layout.columnSpan: 2 + textFormat: Text.StyledText + } + + Kube.Label { + text: qsTr("Title of Account") + Layout.alignment: Qt.AlignRight + } + Kube.TextField { + Layout.fillWidth: true + placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") + text: gmailSettings.accountName + onTextChanged: { + gmailSettings.accountName = text + } + } + + Kube.Label { + text: qsTr("Name") + Layout.alignment: Qt.AlignRight + } + Kube.TextField { + Layout.fillWidth: true + placeholderText: qsTr("Your name") + text: gmailSettings.userName + onTextChanged: { + gmailSettings.userName = text + } + } + + Kube.Label { + text: qsTr("Email address") + Layout.alignment: Qt.AlignRight + } + Kube.TextField { + Layout.fillWidth: true + + text: gmailSettings.emailAddress + onTextChanged: { + gmailSettings.emailAddress = text + } + placeholderText: qsTr("Your email address") + } + + Kube.Label { + text: qsTr("Password") + Layout.alignment: Qt.AlignRight + } + + Kube.PasswordField { + id: pwField + Layout.fillWidth: true + + placeholderText: qsTr("Password of your email account") + text: gmailSettings.imapPassword + onTextChanged: { + gmailSettings.imapPassword = text + gmailSettings.smtpPassword = text + } + } + } +} diff --git a/accounts/imap/package/contents/ui/AccountSettings.qml b/accounts/imap/package/contents/ui/AccountSettings.qml deleted file mode 100644 index d81f9c54..00000000 --- a/accounts/imap/package/contents/ui/AccountSettings.qml +++ /dev/null @@ -1,129 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender, - Copyright (C) 2017 Christian Mollekopf, - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 2.4 -import QtQuick.Controls 1.4 as Controls -import QtQuick.Layouts 1.1 -import org.kube.framework 1.0 as Kube -import org.kube.accounts.imap 1.0 as ImapAccount - -Item { - - property string accountId - property string heading: qsTr("Connect your IMAP account") - property string subheadline: qsTr("To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube. For information about which SMTP, IMAP address, which authentification and port to be used, please contact your email provider.") - property bool valid: true - implicitHeight: grid.implicitHeight - - ImapAccount.ImapSettings { - id: imapSettings - accountIdentifier: accountId - accountType: "imap" - } - - function save(){ - imapSettings.save() - } - - function remove(){ - imapSettings.remove() - } - GridLayout { - id: grid - anchors.fill: parent - columns: 2 - columnSpacing: Kube.Units.largeSpacing - rowSpacing: Kube.Units.largeSpacing - - Kube.Label { - text: qsTr("Title of Account") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - Layout.fillWidth: true - placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") - text: imapSettings.accountName - onTextChanged: { - imapSettings.accountName = text - } - } - - Kube.Label { - text: qsTr("Name") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - Layout.fillWidth: true - placeholderText: qsTr("Your name") - text: imapSettings.userName - onTextChanged: { - imapSettings.userName = text - } - } - - Kube.Label { - text: qsTr("Email address") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - Layout.fillWidth: true - - text: imapSettings.emailAddress - onTextChanged: { - imapSettings.emailAddress = text - imapSettings.imapUsername = text - imapSettings.smtpUsername = text - } - placeholderText: qsTr("Your email address") - } - - Kube.Label { - text: qsTr("IMAP server address") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - id: imapServer - - Layout.fillWidth: true - - placeholderText: "imaps://mainserver.example.net:993" - text: imapSettings.imapServer - onTextChanged: { - imapSettings.imapServer = text - } - validator: imapSettings.imapServerValidator - } - - Kube.Label { - text: qsTr("Smtp address") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - id: smtpServer - Layout.fillWidth: true - - placeholderText: "smtps://mainserver.example.net:993" - text: imapSettings.smtpServer - onTextChanged: { - imapSettings.smtpServer = text - } - validator: imapSettings.smtpServerValidator - } - } -} diff --git a/accounts/imap/package/contents/ui/Login.qml b/accounts/imap/package/contents/ui/Login.qml deleted file mode 100644 index 14e13e89..00000000 --- a/accounts/imap/package/contents/ui/Login.qml +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender, - Copyright (C) 2017 Christian Mollekopf, - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 2.4 -import QtQuick.Layouts 1.1 -import org.kube.framework 1.0 as Kube -import org.kube.accounts.imap 1.0 as ImapAccount - -Item { - property alias accountId: settings.accountIdentifier - property string heading: qsTr("Login") - property string subheadline: settings.accountName - - ImapAccount.ImapSettings { - id: settings - accountType: "imap" - } - - function login(){ - settings.save() - } - - GridLayout { - anchors { - fill: parent - } - columns: 2 - columnSpacing: Kube.Units.largeSpacing - rowSpacing: Kube.Units.largeSpacing - - Kube.Label { - text: qsTr("Password") - Layout.alignment: Qt.AlignRight - } - - Kube.PasswordField { - id: pwField - Layout.fillWidth: true - focus: true - - placeholderText: qsTr("Password of your IMAP account") - text: settings.imapPassword - onTextChanged: settings.imapPassword = text - } - } -} diff --git a/accounts/imap/package/metadata.desktop b/accounts/imap/package/metadata.desktop deleted file mode 100644 index 7c4320c3..00000000 --- a/accounts/imap/package/metadata.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=Kube Imap Accounts Plugin -X-KDE-PluginInfo-Name=org.kube.accounts.imap -Exec=kpackagelauncherqml -a org.kube.accounts.imap -X-Plasma-MainScript=ui/ImapAccountSettings.qml -X-KDE-ServiceTypes=KPackage/GenericQML -Icon=folder -Type=Service diff --git a/accounts/imap/qml/AccountSettings.qml b/accounts/imap/qml/AccountSettings.qml new file mode 100644 index 00000000..d81f9c54 --- /dev/null +++ b/accounts/imap/qml/AccountSettings.qml @@ -0,0 +1,129 @@ +/* + Copyright (C) 2016 Michael Bohlender, + Copyright (C) 2017 Christian Mollekopf, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +import QtQuick 2.4 +import QtQuick.Controls 1.4 as Controls +import QtQuick.Layouts 1.1 +import org.kube.framework 1.0 as Kube +import org.kube.accounts.imap 1.0 as ImapAccount + +Item { + + property string accountId + property string heading: qsTr("Connect your IMAP account") + property string subheadline: qsTr("To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube. For information about which SMTP, IMAP address, which authentification and port to be used, please contact your email provider.") + property bool valid: true + implicitHeight: grid.implicitHeight + + ImapAccount.ImapSettings { + id: imapSettings + accountIdentifier: accountId + accountType: "imap" + } + + function save(){ + imapSettings.save() + } + + function remove(){ + imapSettings.remove() + } + GridLayout { + id: grid + anchors.fill: parent + columns: 2 + columnSpacing: Kube.Units.largeSpacing + rowSpacing: Kube.Units.largeSpacing + + Kube.Label { + text: qsTr("Title of Account") + Layout.alignment: Qt.AlignRight + } + Kube.RequiredTextField { + Layout.fillWidth: true + placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") + text: imapSettings.accountName + onTextChanged: { + imapSettings.accountName = text + } + } + + Kube.Label { + text: qsTr("Name") + Layout.alignment: Qt.AlignRight + } + Kube.RequiredTextField { + Layout.fillWidth: true + placeholderText: qsTr("Your name") + text: imapSettings.userName + onTextChanged: { + imapSettings.userName = text + } + } + + Kube.Label { + text: qsTr("Email address") + Layout.alignment: Qt.AlignRight + } + Kube.RequiredTextField { + Layout.fillWidth: true + + text: imapSettings.emailAddress + onTextChanged: { + imapSettings.emailAddress = text + imapSettings.imapUsername = text + imapSettings.smtpUsername = text + } + placeholderText: qsTr("Your email address") + } + + Kube.Label { + text: qsTr("IMAP server address") + Layout.alignment: Qt.AlignRight + } + Kube.RequiredTextField { + id: imapServer + + Layout.fillWidth: true + + placeholderText: "imaps://mainserver.example.net:993" + text: imapSettings.imapServer + onTextChanged: { + imapSettings.imapServer = text + } + validator: imapSettings.imapServerValidator + } + + Kube.Label { + text: qsTr("Smtp address") + Layout.alignment: Qt.AlignRight + } + Kube.RequiredTextField { + id: smtpServer + Layout.fillWidth: true + + placeholderText: "smtps://mainserver.example.net:993" + text: imapSettings.smtpServer + onTextChanged: { + imapSettings.smtpServer = text + } + validator: imapSettings.smtpServerValidator + } + } +} diff --git a/accounts/imap/qml/Login.qml b/accounts/imap/qml/Login.qml new file mode 100644 index 00000000..14e13e89 --- /dev/null +++ b/accounts/imap/qml/Login.qml @@ -0,0 +1,62 @@ +/* + Copyright (C) 2016 Michael Bohlender, + Copyright (C) 2017 Christian Mollekopf, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +import QtQuick 2.4 +import QtQuick.Layouts 1.1 +import org.kube.framework 1.0 as Kube +import org.kube.accounts.imap 1.0 as ImapAccount + +Item { + property alias accountId: settings.accountIdentifier + property string heading: qsTr("Login") + property string subheadline: settings.accountName + + ImapAccount.ImapSettings { + id: settings + accountType: "imap" + } + + function login(){ + settings.save() + } + + GridLayout { + anchors { + fill: parent + } + columns: 2 + columnSpacing: Kube.Units.largeSpacing + rowSpacing: Kube.Units.largeSpacing + + Kube.Label { + text: qsTr("Password") + Layout.alignment: Qt.AlignRight + } + + Kube.PasswordField { + id: pwField + Layout.fillWidth: true + focus: true + + placeholderText: qsTr("Password of your IMAP account") + text: settings.imapPassword + onTextChanged: settings.imapPassword = text + } + } +} diff --git a/accounts/kolabnow/package/contents/ui/AccountSettings.qml b/accounts/kolabnow/package/contents/ui/AccountSettings.qml deleted file mode 100644 index 4161bc49..00000000 --- a/accounts/kolabnow/package/contents/ui/AccountSettings.qml +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender, - Copyright (C) 2017 Christian Mollekopf, - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 2.4 -import QtQuick.Layouts 1.1 -import org.kube.framework 1.0 as Kube -import org.kube.accounts.kolabnow 1.0 as KolabnowAccount - -Item { - property string accountId - property string heading: qsTr("Connect your Kolab Now account") - property string subheadline: qsTr("Please fill in your name and email address. No account yet? Sign up now!") - property bool valid: nameField.acceptableInput && emailField.acceptableInput - implicitHeight: grid.implicitHeight - - KolabnowAccount.KolabnowSettings { - id: kolabnowSettings - accountIdentifier: accountId - accountType: "kolabnow" - } - - function save(){ - kolabnowSettings.save() - } - - function remove(){ - kolabnowSettings.remove() - } - - GridLayout { - id: grid - anchors.fill: parent - columns: 2 - columnSpacing: Kube.Units.largeSpacing - rowSpacing: Kube.Units.largeSpacing - - Kube.Label { - text: qsTr("Name") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - id: nameField - focus: true - Layout.fillWidth: true - placeholderText: qsTr("Your name") - text: kolabnowSettings.userName - onTextChanged: { - kolabnowSettings.userName = text - } - } - - Kube.Label { - text: qsTr("Email address") - Layout.alignment: Qt.AlignRight - } - Kube.RequiredTextField { - id: emailField - Layout.fillWidth: true - - text: kolabnowSettings.emailAddress - onTextChanged: { - kolabnowSettings.emailAddress = text - kolabnowSettings.accountName = text - } - placeholderText: qsTr("Your email address") - } - } -} diff --git a/accounts/kolabnow/package/contents/ui/Login.qml b/accounts/kolabnow/package/contents/ui/Login.qml deleted file mode 100644 index e416b089..00000000 --- a/accounts/kolabnow/package/contents/ui/Login.qml +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender, - Copyright (C) 2017 Christian Mollekopf, - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 2.4 -import QtQuick.Layouts 1.1 -import org.kube.framework 1.0 as Kube -import org.kube.accounts.kolabnow 1.0 as KolabnowAccount - -Item { - property alias accountId: settings.accountIdentifier - property string heading: qsTr("Login") - property string subheadline: settings.accountName - - KolabnowAccount.KolabnowSettings { - id: settings - accountType: "kolabnow" - } - - function login(){ - settings.save() - } - - GridLayout { - anchors { - fill: parent - } - columns: 2 - columnSpacing: Kube.Units.largeSpacing - rowSpacing: Kube.Units.largeSpacing - - Kube.Label { - text: qsTr("Password") - Layout.alignment: Qt.AlignRight - } - - Kube.PasswordField { - id: pwField - Layout.fillWidth: true - focus: true - - placeholderText: qsTr("Password of your Kolab Now account") - text: settings.imapPassword - onTextChanged: settings.imapPassword = text - } - } -} diff --git a/accounts/kolabnow/package/metadata.desktop b/accounts/kolabnow/package/metadata.desktop deleted file mode 100644 index 6777e2d1..00000000 --- a/accounts/kolabnow/package/metadata.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=Kube Kolabnow Accounts Plugin -X-KDE-PluginInfo-Name=org.kube.accounts.kolabnow -Exec=kpackagelauncherqml -a org.kube.accounts.kolabnow -X-Plasma-MainScript=ui/KolabnowAccountSettings.qml -X-KDE-ServiceTypes=KPackage/GenericQML -Icon=folder -Type=Service diff --git a/accounts/kolabnow/qml/AccountSettings.qml b/accounts/kolabnow/qml/AccountSettings.qml new file mode 100644 index 00000000..4161bc49 --- /dev/null +++ b/accounts/kolabnow/qml/AccountSettings.qml @@ -0,0 +1,84 @@ +/* + Copyright (C) 2016 Michael Bohlender, + Copyright (C) 2017 Christian Mollekopf, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +import QtQuick 2.4 +import QtQuick.Layouts 1.1 +import org.kube.framework 1.0 as Kube +import org.kube.accounts.kolabnow 1.0 as KolabnowAccount + +Item { + property string accountId + property string heading: qsTr("Connect your Kolab Now account") + property string subheadline: qsTr("Please fill in your name and email address. No account yet? Sign up now!") + property bool valid: nameField.acceptableInput && emailField.acceptableInput + implicitHeight: grid.implicitHeight + + KolabnowAccount.KolabnowSettings { + id: kolabnowSettings + accountIdentifier: accountId + accountType: "kolabnow" + } + + function save(){ + kolabnowSettings.save() + } + + function remove(){ + kolabnowSettings.remove() + } + + GridLayout { + id: grid + anchors.fill: parent + columns: 2 + columnSpacing: Kube.Units.largeSpacing + rowSpacing: Kube.Units.largeSpacing + + Kube.Label { + text: qsTr("Name") + Layout.alignment: Qt.AlignRight + } + Kube.RequiredTextField { + id: nameField + focus: true + Layout.fillWidth: true + placeholderText: qsTr("Your name") + text: kolabnowSettings.userName + onTextChanged: { + kolabnowSettings.userName = text + } + } + + Kube.Label { + text: qsTr("Email address") + Layout.alignment: Qt.AlignRight + } + Kube.RequiredTextField { + id: emailField + Layout.fillWidth: true + + text: kolabnowSettings.emailAddress + onTextChanged: { + kolabnowSettings.emailAddress = text + kolabnowSettings.accountName = text + } + placeholderText: qsTr("Your email address") + } + } +} diff --git a/accounts/kolabnow/qml/Login.qml b/accounts/kolabnow/qml/Login.qml new file mode 100644 index 00000000..e416b089 --- /dev/null +++ b/accounts/kolabnow/qml/Login.qml @@ -0,0 +1,62 @@ +/* + Copyright (C) 2016 Michael Bohlender, + Copyright (C) 2017 Christian Mollekopf, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +import QtQuick 2.4 +import QtQuick.Layouts 1.1 +import org.kube.framework 1.0 as Kube +import org.kube.accounts.kolabnow 1.0 as KolabnowAccount + +Item { + property alias accountId: settings.accountIdentifier + property string heading: qsTr("Login") + property string subheadline: settings.accountName + + KolabnowAccount.KolabnowSettings { + id: settings + accountType: "kolabnow" + } + + function login(){ + settings.save() + } + + GridLayout { + anchors { + fill: parent + } + columns: 2 + columnSpacing: Kube.Units.largeSpacing + rowSpacing: Kube.Units.largeSpacing + + Kube.Label { + text: qsTr("Password") + Layout.alignment: Qt.AlignRight + } + + Kube.PasswordField { + id: pwField + Layout.fillWidth: true + focus: true + + placeholderText: qsTr("Password of your Kolab Now account") + text: settings.imapPassword + onTextChanged: settings.imapPassword = text + } + } +} diff --git a/accounts/maildir/package/contents/ui/AccountSettings.qml b/accounts/maildir/package/contents/ui/AccountSettings.qml deleted file mode 100644 index 0fb87810..00000000 --- a/accounts/maildir/package/contents/ui/AccountSettings.qml +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender, - Copyright (C) 2017 Christian Mollekopf, - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 2.4 -import QtQuick.Controls 1.4 as Controls -import QtQuick.Layouts 1.1 -import QtQuick.Dialogs 1.0 as Dialogs -import org.kube.framework 1.0 as Kube -import org.kube.accounts.maildir 1.0 as MaildirAccount - -Item { - property string accountId - property string heading: qsTr("Add your Maildir archive") - property string subheadline: qsTr("To let Kube access your maildir archive, add the path to your archive and give the account a title that will be displayed inside Kube.") - property bool valid: true - implicitHeight: grid.implicitHeight - - MaildirAccount.MaildirSettings { - id: maildirSettings - accountIdentifier: accountId - accountType: "maildir" - } - - function save(){ - maildirSettings.save() - } - - function remove(){ - maildirSettings.remove() - } - - GridLayout { - id: grid - anchors.fill: parent - columns: 2 - columnSpacing: Kube.Units.largeSpacing - rowSpacing: Kube.Units.largeSpacing - - Kube.Label { - text: qsTr("Title of Account") - Layout.alignment: Qt.AlignRight - } - Kube.TextField { - Layout.fillWidth: true - placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") - text: maildirSettings.accountName - onTextChanged: { - maildirSettings.accountName = text - } - } - - Kube.Label { - text: qsTr("Path") - Layout.alignment: Qt.AlignRight - } - RowLayout { - Layout.fillWidth: true - - Kube.TextField { - id: path - Layout.fillWidth: true - enabled: false - text: maildirSettings.path - } - - Controls.Button { - iconName: Kube.Icons.folder - - onClicked: { - fileDialogComponent.createObject(parent) - } - - Component { - id: fileDialogComponent - Dialogs.FileDialog { - id: fileDialog - - visible: true - title: "Choose the maildir folder" - - selectFolder: true - - onAccepted: { - maildirSettings.path = fileDialog.fileUrl - } - } - } - } - } - } -} diff --git a/accounts/maildir/package/metadata.desktop b/accounts/maildir/package/metadata.desktop deleted file mode 100644 index ce922455..00000000 --- a/accounts/maildir/package/metadata.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Name=Kube Maildir Accounts Plugin -X-KDE-PluginInfo-Name=org.kube.accounts.maildir -Exec=kpackagelauncherqml -a org.kube.accounts.maildir -X-Plasma-MainScript=ui/MaildirAccountSettings.qml -X-KDE-ServiceTypes=KPackage/GenericQML -Icon=folder -Type=Service -X-KDE-Kube-RequiresKeyring=False diff --git a/accounts/maildir/qml/AccountSettings.qml b/accounts/maildir/qml/AccountSettings.qml new file mode 100644 index 00000000..0fb87810 --- /dev/null +++ b/accounts/maildir/qml/AccountSettings.qml @@ -0,0 +1,107 @@ +/* + Copyright (C) 2016 Michael Bohlender, + Copyright (C) 2017 Christian Mollekopf, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +import QtQuick 2.4 +import QtQuick.Controls 1.4 as Controls +import QtQuick.Layouts 1.1 +import QtQuick.Dialogs 1.0 as Dialogs +import org.kube.framework 1.0 as Kube +import org.kube.accounts.maildir 1.0 as MaildirAccount + +Item { + property string accountId + property string heading: qsTr("Add your Maildir archive") + property string subheadline: qsTr("To let Kube access your maildir archive, add the path to your archive and give the account a title that will be displayed inside Kube.") + property bool valid: true + implicitHeight: grid.implicitHeight + + MaildirAccount.MaildirSettings { + id: maildirSettings + accountIdentifier: accountId + accountType: "maildir" + } + + function save(){ + maildirSettings.save() + } + + function remove(){ + maildirSettings.remove() + } + + GridLayout { + id: grid + anchors.fill: parent + columns: 2 + columnSpacing: Kube.Units.largeSpacing + rowSpacing: Kube.Units.largeSpacing + + Kube.Label { + text: qsTr("Title of Account") + Layout.alignment: Qt.AlignRight + } + Kube.TextField { + Layout.fillWidth: true + placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") + text: maildirSettings.accountName + onTextChanged: { + maildirSettings.accountName = text + } + } + + Kube.Label { + text: qsTr("Path") + Layout.alignment: Qt.AlignRight + } + RowLayout { + Layout.fillWidth: true + + Kube.TextField { + id: path + Layout.fillWidth: true + enabled: false + text: maildirSettings.path + } + + Controls.Button { + iconName: Kube.Icons.folder + + onClicked: { + fileDialogComponent.createObject(parent) + } + + Component { + id: fileDialogComponent + Dialogs.FileDialog { + id: fileDialog + + visible: true + title: "Choose the maildir folder" + + selectFolder: true + + onAccepted: { + maildirSettings.path = fileDialog.fileUrl + } + } + } + } + } + } +} diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index ff001324..ed28b5f4 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -3,7 +3,7 @@ project(kube-components) find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Widgets) macro(install_qml_component name) - install(DIRECTORY ${name}/contents/ui/ DESTINATION ${QML_INSTALL_DIR}/org/kube/components/${name}) + install(DIRECTORY ${name}/qml/ DESTINATION ${QML_INSTALL_DIR}/org/kube/components/${name}) install(FILES ${name}/qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/components/${name}) endmacro(install_qml_component) -- cgit v1.2.3