From ad39a0aa4852b09318a1a0e557dd7eaed12c4e95 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Thu, 31 Dec 2015 19:03:58 +0100 Subject: kmail-quick -> kube-mail --- applications/CMakeLists.txt | 4 +- applications/kmail-quick/CMakeLists.txt | 33 ----- applications/kmail-quick/main.cpp | 14 -- .../kmail-quick/package/contents/ui/Avatar.qml | 55 -------- .../package/contents/ui/ColorPalette.qml | 26 ---- .../package/contents/ui/FolderListView.qml | 102 -------------- .../package/contents/ui/FolderModel.qml | 36 ----- .../kmail-quick/package/contents/ui/ListItem.qml | 63 --------- .../package/contents/ui/MailListModel.qml | 149 --------------------- .../package/contents/ui/MailListView.qml | 131 ------------------ .../package/contents/ui/SingleMailView.qml | 64 --------- .../kmail-quick/package/contents/ui/example.qml | 64 --------- .../kmail-quick/package/contents/ui/main.qml | 138 ------------------- applications/kmail-quick/package/metadata.desktop | 8 -- applications/kube-mail/CMakeLists.txt | 33 +++++ applications/kube-mail/main.cpp | 14 ++ .../kube-mail/package/contents/ui/Avatar.qml | 55 ++++++++ .../kube-mail/package/contents/ui/ColorPalette.qml | 26 ++++ .../package/contents/ui/FolderListView.qml | 102 ++++++++++++++ .../kube-mail/package/contents/ui/FolderModel.qml | 36 +++++ .../kube-mail/package/contents/ui/ListItem.qml | 63 +++++++++ .../package/contents/ui/MailListModel.qml | 149 +++++++++++++++++++++ .../kube-mail/package/contents/ui/MailListView.qml | 131 ++++++++++++++++++ .../package/contents/ui/SingleMailView.qml | 64 +++++++++ .../kube-mail/package/contents/ui/example.qml | 64 +++++++++ .../kube-mail/package/contents/ui/main.qml | 138 +++++++++++++++++++ applications/kube-mail/package/metadata.desktop | 8 ++ 27 files changed, 885 insertions(+), 885 deletions(-) delete mode 100644 applications/kmail-quick/CMakeLists.txt delete mode 100644 applications/kmail-quick/main.cpp delete mode 100644 applications/kmail-quick/package/contents/ui/Avatar.qml delete mode 100644 applications/kmail-quick/package/contents/ui/ColorPalette.qml delete mode 100644 applications/kmail-quick/package/contents/ui/FolderListView.qml delete mode 100644 applications/kmail-quick/package/contents/ui/FolderModel.qml delete mode 100644 applications/kmail-quick/package/contents/ui/ListItem.qml delete mode 100644 applications/kmail-quick/package/contents/ui/MailListModel.qml delete mode 100644 applications/kmail-quick/package/contents/ui/MailListView.qml delete mode 100644 applications/kmail-quick/package/contents/ui/SingleMailView.qml delete mode 100644 applications/kmail-quick/package/contents/ui/example.qml delete mode 100644 applications/kmail-quick/package/contents/ui/main.qml delete mode 100644 applications/kmail-quick/package/metadata.desktop create mode 100644 applications/kube-mail/CMakeLists.txt create mode 100644 applications/kube-mail/main.cpp create mode 100644 applications/kube-mail/package/contents/ui/Avatar.qml create mode 100644 applications/kube-mail/package/contents/ui/ColorPalette.qml create mode 100644 applications/kube-mail/package/contents/ui/FolderListView.qml create mode 100644 applications/kube-mail/package/contents/ui/FolderModel.qml create mode 100644 applications/kube-mail/package/contents/ui/ListItem.qml create mode 100644 applications/kube-mail/package/contents/ui/MailListModel.qml create mode 100644 applications/kube-mail/package/contents/ui/MailListView.qml create mode 100644 applications/kube-mail/package/contents/ui/SingleMailView.qml create mode 100644 applications/kube-mail/package/contents/ui/example.qml create mode 100644 applications/kube-mail/package/contents/ui/main.qml create mode 100644 applications/kube-mail/package/metadata.desktop (limited to 'applications') diff --git a/applications/CMakeLists.txt b/applications/CMakeLists.txt index 1db5ed2b..dd65a3e8 100644 --- a/applications/CMakeLists.txt +++ b/applications/CMakeLists.txt @@ -1,2 +1,2 @@ -add_subdirectory(kmail-quick) -add_subdirectory(kube-accounts) \ No newline at end of file +add_subdirectory(kube-mail) +add_subdirectory(kube-accounts) diff --git a/applications/kmail-quick/CMakeLists.txt b/applications/kmail-quick/CMakeLists.txt deleted file mode 100644 index 9758e597..00000000 --- a/applications/kmail-quick/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -project(kmail-quick) - -cmake_minimum_required(VERSION 2.8.10.1) - -include(CPack) -include(FeatureSummary) -find_package(PkgConfig) - -################# set KDE specific information ################# - -find_package(ECM 0.0.8 REQUIRED NO_MODULE) - -# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) - -include(KDEInstallDirs) -include(KDECMakeSettings) -include(KDECompilerSettings) - -find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui) - -set (QT_MIN_VERSION "5.4.0") -find_package(KF5 REQUIRED COMPONENTS Package) - -# install UI package -kpackage_install_package(package org.kde.pim.kmail-quick pim) - -# install executable -add_executable(${PROJECT_NAME} main.cpp) -qt5_use_modules(${PROJECT_NAME} Gui Quick) -target_link_libraries(${PROJECT_NAME} KF5::Package) - -install(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/applications/kmail-quick/main.cpp b/applications/kmail-quick/main.cpp deleted file mode 100644 index 557ca64e..00000000 --- a/applications/kmail-quick/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include - -#include - -#include - -int main(int argc, char *argv[]) -{ - QGuiApplication app(argc, argv); - auto mainFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kpackage/pim/org.kde.pim.kmail-quick/contents/ui/main.qml", QStandardPaths::LocateFile); - QQmlApplicationEngine engine(QUrl::fromLocalFile(mainFile)); - return app.exec(); -} diff --git a/applications/kmail-quick/package/contents/ui/Avatar.qml b/applications/kmail-quick/package/contents/ui/Avatar.qml deleted file mode 100644 index 33d6733c..00000000 --- a/applications/kmail-quick/package/contents/ui/Avatar.qml +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2015 Michael Bohlender - * - * 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 3 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, see . - */ - -import QtQuick 2.4 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 - - -Rectangle { - - property string name; - - //colors taken from https://techbase.kde.org/Projects/Usability/HIG/Color - function calcColor(x) - { - switch (x % 5) { - case 0: - return "#16a085" - case 1: - return "#27ae60" - case 2: - return "#2980b9" - case 3: - return "#8e44ad" - case 4: - return "#c0392b" - } - } - - radius: 2 - - color: calcColor(name.length) - - Text { - anchors.centerIn: parent - - text: name.charAt(0) - - color: "#ecf0f1" - } -} diff --git a/applications/kmail-quick/package/contents/ui/ColorPalette.qml b/applications/kmail-quick/package/contents/ui/ColorPalette.qml deleted file mode 100644 index db85cac6..00000000 --- a/applications/kmail-quick/package/contents/ui/ColorPalette.qml +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2015 Michael Bohlender - * - * 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 3 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, see . - */ - -import QtQuick 2.4 - -//TODO probably expose it from the Cpp side -Item { - property string background: "#fcfcfc" - property string selected: "#3daee9" - property string read: "#232629" - property string border: "#232629" -} \ No newline at end of file diff --git a/applications/kmail-quick/package/contents/ui/FolderListView.qml b/applications/kmail-quick/package/contents/ui/FolderListView.qml deleted file mode 100644 index f0ce7da2..00000000 --- a/applications/kmail-quick/package/contents/ui/FolderListView.qml +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2015 Michael Bohlender - * - * 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 3 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, see . - */ - -import QtQuick 2.4 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 - -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents - -import org.kde.akonadi2.mail 1.0 as Mail - -Item { - id: root - - Item { - id: searchBox - - width: root.width - height: unit.size * 10 - - TextField { - anchors. centerIn: parent - - width: parent.width * 0.9 - - placeholderText: "Search all email..." - } - } - - ScrollView { - - anchors { - top: searchBox.bottom - left: parent.left - right: parent.right - bottom: parent.bottom - } - - ListView { - id: listView - - currentIndex: -1 - - clip: true - - model: folderList.model //FolderModel {} - - delegate: PlasmaComponents.ListItem { - - width: root.width - height: unit.size * 10 - - enabled: true - checked: listView.currentIndex == index - - onClicked: { - mailList.loadMailFolder(model.id) - listView.currentIndex = model.index - } - - PlasmaCore.IconItem { - id: iconItem - - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: unit.size * 3 - } - - source: model.icon - } - - Label { - id: label - - anchors { - verticalCenter: parent.verticalCenter - left: iconItem.right - leftMargin: unit.size * 3 - } - - text: model.name - } - } - } - } -} \ No newline at end of file diff --git a/applications/kmail-quick/package/contents/ui/FolderModel.qml b/applications/kmail-quick/package/contents/ui/FolderModel.qml deleted file mode 100644 index b20a1606..00000000 --- a/applications/kmail-quick/package/contents/ui/FolderModel.qml +++ /dev/null @@ -1,36 +0,0 @@ -import QtQuick 2.4 - -ListModel { - ListElement { - icon: "mail-folder-inbox" - name: "Inbox" - } - ListElement { - icon: "mail-folder-sent" - name: "Sent" - } - ListElement { - icon: "user-trash" - name: "Trash" - } - ListElement { - icon: "document-edit" - name: "Drafts" - } - ListElement { - icon: "folder" - name: "cats" - } - ListElement { - icon: "folder" - name: "dogs" - } - ListElement { - icon: "folder" - name: "dragons" - } - ListElement { - icon: "folder" - name: "long tailed dragons" - } -} \ No newline at end of file diff --git a/applications/kmail-quick/package/contents/ui/ListItem.qml b/applications/kmail-quick/package/contents/ui/ListItem.qml deleted file mode 100644 index 5396645d..00000000 --- a/applications/kmail-quick/package/contents/ui/ListItem.qml +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2015 Michael Bohlender - * - * 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 3 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, see . - */ - -import QtQuick 2.4 - -Item { - id: delegateRoot - - readonly property bool isCurrentItem: ListView.isCurrentItem - - height: unit.width * 25 - width: parent.width - - MouseArea { - id: mouseArea - - anchors.fill: parent - } - - Rectangle { - anchors.fill: parent - - color: colorPalette.background - - //clickColor - Rectangle { - id: clickColor - - anchors.fill: parent - - color: colorPalette.selected - opacity: 0.4 - - visible: mouseArea.pressed - } - - //border - Rectangle { - - anchors.bottom: parent.bottom - - height: 1 - width: parent.width - - color: colorPalette.border - opacity: 0.2 - } - } -} \ No newline at end of file diff --git a/applications/kmail-quick/package/contents/ui/MailListModel.qml b/applications/kmail-quick/package/contents/ui/MailListModel.qml deleted file mode 100644 index bf0f70a2..00000000 --- a/applications/kmail-quick/package/contents/ui/MailListModel.qml +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2015 Michael Bohlender - * - * 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 3 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, see . - */ - -import QtQuick 2.4 - -ListModel { - ListElement { - sender: "mighty@mail.com" - senderName: "Mighty Monkey" - subject: "I feel weak without my bananas" - date: "19:21" - unread: true - } - ListElement { - sender: "benni@bandana.org" - senderName: "Ben Bandana" - subject: "Check this out" - date: "16:01" - unread: true - } - ListElement { - sender: "alice@mail.com" - senderName: "Alice Cheng" - subject: "Re: We need more food" - date: "12:55" - unread: false - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "KDE Rocks" - date: "Sat" - unread: true - } - ListElement { - sender: "tiny@mail.com" - senderName: "Tiny" - subject: "Huge success!!" - date: "Sat" - unread: false - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "KDE Rocks" - date: "Fr" - unread: false - } - ListElement { - sender: "Laura@mail.com" - senderName: "Laura B" - subject: ":)" - date: "Thu" - unread: false - } - ListElement { - sender: "Andreas@stars.org" - senderName: "Andreas Rockstar" - subject: "KDE Rocks" - date: "Wed" - unread: false - } - ListElement { - sender: "alice@mail.com" - senderName: "Alice Cheng" - subject: "Re: We need more food" - date: "Wed" - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "KDE Rocks" - date: "Mon" - } - ListElement { - sender: "mighty@mail.com" - senderName: "Mighty Monkey" - subject: "I feel weak without my bananas" - date: "Nov 20" - } - ListElement { - sender: "benni@bandana.org" - senderName: "Ben Bandana" - subject: "Check this out" - date: "Nov 15" - } - ListElement { - sender: "alice@mail.com" - senderName: "Alice Cheng" - subject: "Re: We need more food" - date: "Sep 29" - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "KDE Rocks" - date: "Sep 14" - } - ListElement { - sender: "tiny@mail.com" - senderName: "Tiny" - subject: "Huge success!!" - date: "Sep 14" - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "KDE Rocks" - date: "Sep 5" - } - ListElement { - sender: "Laura@mail.com" - senderName: "Laura B" - subject: ":)" - date: "Sep 4" - } - ListElement { - sender: "Andreas@stars.org" - senderName: "Andreas Rockstar" - subject: "KDE Rocks" - date: "May 25" - } - ListElement { - sender: "alice@mail.com" - senderName: "Alice Cheng" - subject: "Re: We need more food" - date: "May 3" - } - ListElement { - sender: "bob@bandana.org" - senderName: "Bob Ross" - subject: "Board Task: Write draft email to people with KDE accounts commiting to Qt repositories" - date: "Dec 2014" - } -} \ No newline at end of file diff --git a/applications/kmail-quick/package/contents/ui/MailListView.qml b/applications/kmail-quick/package/contents/ui/MailListView.qml deleted file mode 100644 index f6ded917..00000000 --- a/applications/kmail-quick/package/contents/ui/MailListView.qml +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (C) 2015 Michael Bohlender - * - * 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 3 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, see . - */ - -import QtQuick 2.4 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 - -import org.kde.plasma.components 2.0 as PlasmaComponents - -ScrollView { - id: root - ListView { - id: listView - - model: mailList.model //MailListModel {} - - delegate: PlasmaComponents.ListItem { - - width: listView.width - height: unit.size * 12 - - enabled: true - checked: listView.currentIndex == index - - MouseArea { - anchors.fill: parent - - onClicked: { - listView.currentIndex = model.index - singleMail.loadMail(model.id) - } - } - - Rectangle { - id: unread - - anchors.fill: parent - - color: colorPalette.read - opacity: 0.1 - - visible: model.unread == false - } - - Avatar { - id: avatar - - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: unit.size * 2 - } - - height: unit.size * 9 - width: height - - name: model.senderName - } - - Label { - id: senderName - - anchors { - top: avatar.top - left: avatar.right - leftMargin: unit.size * 3 - } - - text: model.senderName - - font.weight: Font.DemiBold - } - - Label { - id: sender - - anchors { - top: avatar.top - left: senderName.right - leftMargin: unit.size - right: date.left - rightMargin: unit.size - } - - text: "(" + model.sender +")" - - clip: true - } - - Label { - id: date - - anchors { - top: avatar.top - right: parent.right - rightMargin: unit.size * 2 - } - - text: model.date - - font.weight: Font.Light - } - - Label { - id: subject - - anchors { - bottom: avatar.bottom - left: avatar.right - leftMargin: unit.size * 3 - } - - text: model.subject - } - } - } -} \ No newline at end of file diff --git a/applications/kmail-quick/package/contents/ui/SingleMailView.qml b/applications/kmail-quick/package/contents/ui/SingleMailView.qml deleted file mode 100644 index e307ccfd..00000000 --- a/applications/kmail-quick/package/contents/ui/SingleMailView.qml +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2015 Michael Bohlender - * - * 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 3 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, see . - */ - -import QtQuick 2.4 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 - -Item { - id: root - - Rectangle { - id: background - - anchors.fill: parent - - color: colorPalette.background - } - - Repeater { - anchors.fill: parent - - model: singleMail.model - - delegate: Item { - height: root.height - width: root.widht - - ColumnLayout { - - Label { - text: model.id - } - Label { - text: model.sender - } - Label { - text: model.senderName - } - - Label { - text: model.subject - } - - Label { - text: model.mimeMessage - } - } - } - } -} \ No newline at end of file diff --git a/applications/kmail-quick/package/contents/ui/example.qml b/applications/kmail-quick/package/contents/ui/example.qml deleted file mode 100644 index a968bc72..00000000 --- a/applications/kmail-quick/package/contents/ui/example.qml +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2015 Michael Bohlender - * - * 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 3 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, see . - */ - -import QtQuick 2.4 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 - -import org.kde.akonadi2.mail 1.0 - -Item { - id: root - - MailList { - id: mailList - - query: "Some Query" - - } - - Button { - id: button - - anchors { - top: parent.top - right: parent.right - left: parent.left - } - - text: "add mail" - - onClicked: mailList.addMail("test test test"); - } - - ListView { - - anchors { - top: button.bottom - left: parent.left - right: parent.right - bottom: parent.bottom - } - - model: mailList.model - - delegate: Label { - - text: model.subject - } - } -} \ No newline at end of file diff --git a/applications/kmail-quick/package/contents/ui/main.qml b/applications/kmail-quick/package/contents/ui/main.qml deleted file mode 100644 index 88d2edde..00000000 --- a/applications/kmail-quick/package/contents/ui/main.qml +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (C) 2015 Michael Bohlender - * - * 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 3 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, see . - */ - -import QtQuick 2.4 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 -import org.kde.plasma.components 2.0 as PlasmaComponents - -import org.kde.akonadi2.mail 1.0 as Mail - -ApplicationWindow { - id: app - - //FIXME remove fixed pixel hight - //for now just convinience during testing - height: 1080 * 0.7 - width: 1920 * 0.7 - - visible: true - - //Controller: - Mail.FolderList { - id: folderList - } - - Mail.MailList { - id: mailList - } - - Mail.SingleMail{ - id: singleMail - } - - //UI - toolBar: ToolBar { - - Row { - anchors.fill: parent - - PlasmaComponents.ToolButton { - - height: parent.height - - iconName: "mail-message-new" - - text: "Compose" - } - - PlasmaComponents.ToolButton { - - height: parent.height - - iconName: "mail-mark-unread" - text: "Mark Unread" - - onClicked: { - mailList.markMailUnread(true) - } - } - - PlasmaComponents.ToolButton { - - height: parent.height - - iconName: "mail-mark-important" - text: "Mark Important" - - onClicked: { - mailList.markMailImportant(true) - } - } - - PlasmaComponents.ToolButton { - - height: parent.height - - iconName: "edit-delete" - text: "Delete Mail" - - onClicked: { - mailList.deleteMail() - } - } - } - } - - SplitView { - anchors.fill: parent - - FolderListView { - id: folderListView - - width: unit.size * 55 - Layout.maximumWidth: unit.size * 150 - Layout.minimumWidth: unit.size * 30 - } - - MailListView { - id: mailListView - - width: unit.size * 80 - Layout.maximumWidth: unit.size * 250 - Layout.minimumWidth: unit.size * 50 - } - - SingleMailView { - id: mailView - - Layout.fillWidth: true - } - } - - //TODO find a better way to scale UI - Item { - id: unit - - property int size: 5 - } - - ColorPalette { - id: colorPalette - } -} - diff --git a/applications/kmail-quick/package/metadata.desktop b/applications/kmail-quick/package/metadata.desktop deleted file mode 100644 index d02fa46a..00000000 --- a/applications/kmail-quick/package/metadata.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=KMail Quick -X-KDE-PluginInfo-Name=org.kde.pim.kmail-quick -Exec=kpackagelauncherqml -a org.kde.pim.kmail-quick -X-Plasma-MainScript=ui/main.qml -X-KDE-ServiceTypes=KPackage/GenericQML -Icon=kmail2 -Type=Service \ No newline at end of file diff --git a/applications/kube-mail/CMakeLists.txt b/applications/kube-mail/CMakeLists.txt new file mode 100644 index 00000000..05c98d18 --- /dev/null +++ b/applications/kube-mail/CMakeLists.txt @@ -0,0 +1,33 @@ +project(kube-mail) + +cmake_minimum_required(VERSION 2.8.10.1) + +include(CPack) +include(FeatureSummary) +find_package(PkgConfig) + +################# set KDE specific information ################# + +find_package(ECM 0.0.8 REQUIRED NO_MODULE) + +# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) + +include(KDEInstallDirs) +include(KDECMakeSettings) +include(KDECompilerSettings) + +find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui) + +set (QT_MIN_VERSION "5.4.0") +find_package(KF5 REQUIRED COMPONENTS Package) + +# install UI package +kpackage_install_package(package org.kde.kube.mail pim) + +# install executable +add_executable(${PROJECT_NAME} main.cpp) +qt5_use_modules(${PROJECT_NAME} Gui Quick) +target_link_libraries(${PROJECT_NAME} KF5::Package) + +install(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/applications/kube-mail/main.cpp b/applications/kube-mail/main.cpp new file mode 100644 index 00000000..400cba82 --- /dev/null +++ b/applications/kube-mail/main.cpp @@ -0,0 +1,14 @@ +#include +#include + +#include + +#include + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + auto mainFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kpackage/pim/org.kde.kube.mail/contents/ui/main.qml", QStandardPaths::LocateFile); + QQmlApplicationEngine engine(QUrl::fromLocalFile(mainFile)); + return app.exec(); +} diff --git a/applications/kube-mail/package/contents/ui/Avatar.qml b/applications/kube-mail/package/contents/ui/Avatar.qml new file mode 100644 index 00000000..33d6733c --- /dev/null +++ b/applications/kube-mail/package/contents/ui/Avatar.qml @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2015 Michael Bohlender + * + * 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 3 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, see . + */ + +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + + +Rectangle { + + property string name; + + //colors taken from https://techbase.kde.org/Projects/Usability/HIG/Color + function calcColor(x) + { + switch (x % 5) { + case 0: + return "#16a085" + case 1: + return "#27ae60" + case 2: + return "#2980b9" + case 3: + return "#8e44ad" + case 4: + return "#c0392b" + } + } + + radius: 2 + + color: calcColor(name.length) + + Text { + anchors.centerIn: parent + + text: name.charAt(0) + + color: "#ecf0f1" + } +} diff --git a/applications/kube-mail/package/contents/ui/ColorPalette.qml b/applications/kube-mail/package/contents/ui/ColorPalette.qml new file mode 100644 index 00000000..db85cac6 --- /dev/null +++ b/applications/kube-mail/package/contents/ui/ColorPalette.qml @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2015 Michael Bohlender + * + * 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 3 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, see . + */ + +import QtQuick 2.4 + +//TODO probably expose it from the Cpp side +Item { + property string background: "#fcfcfc" + property string selected: "#3daee9" + property string read: "#232629" + property string border: "#232629" +} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/FolderListView.qml b/applications/kube-mail/package/contents/ui/FolderListView.qml new file mode 100644 index 00000000..f0ce7da2 --- /dev/null +++ b/applications/kube-mail/package/contents/ui/FolderListView.qml @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2015 Michael Bohlender + * + * 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 3 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, see . + */ + +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.components 2.0 as PlasmaComponents + +import org.kde.akonadi2.mail 1.0 as Mail + +Item { + id: root + + Item { + id: searchBox + + width: root.width + height: unit.size * 10 + + TextField { + anchors. centerIn: parent + + width: parent.width * 0.9 + + placeholderText: "Search all email..." + } + } + + ScrollView { + + anchors { + top: searchBox.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + } + + ListView { + id: listView + + currentIndex: -1 + + clip: true + + model: folderList.model //FolderModel {} + + delegate: PlasmaComponents.ListItem { + + width: root.width + height: unit.size * 10 + + enabled: true + checked: listView.currentIndex == index + + onClicked: { + mailList.loadMailFolder(model.id) + listView.currentIndex = model.index + } + + PlasmaCore.IconItem { + id: iconItem + + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + leftMargin: unit.size * 3 + } + + source: model.icon + } + + Label { + id: label + + anchors { + verticalCenter: parent.verticalCenter + left: iconItem.right + leftMargin: unit.size * 3 + } + + text: model.name + } + } + } + } +} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/FolderModel.qml b/applications/kube-mail/package/contents/ui/FolderModel.qml new file mode 100644 index 00000000..b20a1606 --- /dev/null +++ b/applications/kube-mail/package/contents/ui/FolderModel.qml @@ -0,0 +1,36 @@ +import QtQuick 2.4 + +ListModel { + ListElement { + icon: "mail-folder-inbox" + name: "Inbox" + } + ListElement { + icon: "mail-folder-sent" + name: "Sent" + } + ListElement { + icon: "user-trash" + name: "Trash" + } + ListElement { + icon: "document-edit" + name: "Drafts" + } + ListElement { + icon: "folder" + name: "cats" + } + ListElement { + icon: "folder" + name: "dogs" + } + ListElement { + icon: "folder" + name: "dragons" + } + ListElement { + icon: "folder" + name: "long tailed dragons" + } +} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/ListItem.qml b/applications/kube-mail/package/contents/ui/ListItem.qml new file mode 100644 index 00000000..5396645d --- /dev/null +++ b/applications/kube-mail/package/contents/ui/ListItem.qml @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2015 Michael Bohlender + * + * 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 3 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, see . + */ + +import QtQuick 2.4 + +Item { + id: delegateRoot + + readonly property bool isCurrentItem: ListView.isCurrentItem + + height: unit.width * 25 + width: parent.width + + MouseArea { + id: mouseArea + + anchors.fill: parent + } + + Rectangle { + anchors.fill: parent + + color: colorPalette.background + + //clickColor + Rectangle { + id: clickColor + + anchors.fill: parent + + color: colorPalette.selected + opacity: 0.4 + + visible: mouseArea.pressed + } + + //border + Rectangle { + + anchors.bottom: parent.bottom + + height: 1 + width: parent.width + + color: colorPalette.border + opacity: 0.2 + } + } +} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/MailListModel.qml b/applications/kube-mail/package/contents/ui/MailListModel.qml new file mode 100644 index 00000000..bf0f70a2 --- /dev/null +++ b/applications/kube-mail/package/contents/ui/MailListModel.qml @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2015 Michael Bohlender + * + * 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 3 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, see . + */ + +import QtQuick 2.4 + +ListModel { + ListElement { + sender: "mighty@mail.com" + senderName: "Mighty Monkey" + subject: "I feel weak without my bananas" + date: "19:21" + unread: true + } + ListElement { + sender: "benni@bandana.org" + senderName: "Ben Bandana" + subject: "Check this out" + date: "16:01" + unread: true + } + ListElement { + sender: "alice@mail.com" + senderName: "Alice Cheng" + subject: "Re: We need more food" + date: "12:55" + unread: false + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "KDE Rocks" + date: "Sat" + unread: true + } + ListElement { + sender: "tiny@mail.com" + senderName: "Tiny" + subject: "Huge success!!" + date: "Sat" + unread: false + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "KDE Rocks" + date: "Fr" + unread: false + } + ListElement { + sender: "Laura@mail.com" + senderName: "Laura B" + subject: ":)" + date: "Thu" + unread: false + } + ListElement { + sender: "Andreas@stars.org" + senderName: "Andreas Rockstar" + subject: "KDE Rocks" + date: "Wed" + unread: false + } + ListElement { + sender: "alice@mail.com" + senderName: "Alice Cheng" + subject: "Re: We need more food" + date: "Wed" + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "KDE Rocks" + date: "Mon" + } + ListElement { + sender: "mighty@mail.com" + senderName: "Mighty Monkey" + subject: "I feel weak without my bananas" + date: "Nov 20" + } + ListElement { + sender: "benni@bandana.org" + senderName: "Ben Bandana" + subject: "Check this out" + date: "Nov 15" + } + ListElement { + sender: "alice@mail.com" + senderName: "Alice Cheng" + subject: "Re: We need more food" + date: "Sep 29" + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "KDE Rocks" + date: "Sep 14" + } + ListElement { + sender: "tiny@mail.com" + senderName: "Tiny" + subject: "Huge success!!" + date: "Sep 14" + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "KDE Rocks" + date: "Sep 5" + } + ListElement { + sender: "Laura@mail.com" + senderName: "Laura B" + subject: ":)" + date: "Sep 4" + } + ListElement { + sender: "Andreas@stars.org" + senderName: "Andreas Rockstar" + subject: "KDE Rocks" + date: "May 25" + } + ListElement { + sender: "alice@mail.com" + senderName: "Alice Cheng" + subject: "Re: We need more food" + date: "May 3" + } + ListElement { + sender: "bob@bandana.org" + senderName: "Bob Ross" + subject: "Board Task: Write draft email to people with KDE accounts commiting to Qt repositories" + date: "Dec 2014" + } +} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/MailListView.qml b/applications/kube-mail/package/contents/ui/MailListView.qml new file mode 100644 index 00000000..f6ded917 --- /dev/null +++ b/applications/kube-mail/package/contents/ui/MailListView.qml @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2015 Michael Bohlender + * + * 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 3 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, see . + */ + +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +import org.kde.plasma.components 2.0 as PlasmaComponents + +ScrollView { + id: root + ListView { + id: listView + + model: mailList.model //MailListModel {} + + delegate: PlasmaComponents.ListItem { + + width: listView.width + height: unit.size * 12 + + enabled: true + checked: listView.currentIndex == index + + MouseArea { + anchors.fill: parent + + onClicked: { + listView.currentIndex = model.index + singleMail.loadMail(model.id) + } + } + + Rectangle { + id: unread + + anchors.fill: parent + + color: colorPalette.read + opacity: 0.1 + + visible: model.unread == false + } + + Avatar { + id: avatar + + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + leftMargin: unit.size * 2 + } + + height: unit.size * 9 + width: height + + name: model.senderName + } + + Label { + id: senderName + + anchors { + top: avatar.top + left: avatar.right + leftMargin: unit.size * 3 + } + + text: model.senderName + + font.weight: Font.DemiBold + } + + Label { + id: sender + + anchors { + top: avatar.top + left: senderName.right + leftMargin: unit.size + right: date.left + rightMargin: unit.size + } + + text: "(" + model.sender +")" + + clip: true + } + + Label { + id: date + + anchors { + top: avatar.top + right: parent.right + rightMargin: unit.size * 2 + } + + text: model.date + + font.weight: Font.Light + } + + Label { + id: subject + + anchors { + bottom: avatar.bottom + left: avatar.right + leftMargin: unit.size * 3 + } + + text: model.subject + } + } + } +} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/SingleMailView.qml b/applications/kube-mail/package/contents/ui/SingleMailView.qml new file mode 100644 index 00000000..e307ccfd --- /dev/null +++ b/applications/kube-mail/package/contents/ui/SingleMailView.qml @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2015 Michael Bohlender + * + * 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 3 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, see . + */ + +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +Item { + id: root + + Rectangle { + id: background + + anchors.fill: parent + + color: colorPalette.background + } + + Repeater { + anchors.fill: parent + + model: singleMail.model + + delegate: Item { + height: root.height + width: root.widht + + ColumnLayout { + + Label { + text: model.id + } + Label { + text: model.sender + } + Label { + text: model.senderName + } + + Label { + text: model.subject + } + + Label { + text: model.mimeMessage + } + } + } + } +} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/example.qml b/applications/kube-mail/package/contents/ui/example.qml new file mode 100644 index 00000000..a968bc72 --- /dev/null +++ b/applications/kube-mail/package/contents/ui/example.qml @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2015 Michael Bohlender + * + * 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 3 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, see . + */ + +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +import org.kde.akonadi2.mail 1.0 + +Item { + id: root + + MailList { + id: mailList + + query: "Some Query" + + } + + Button { + id: button + + anchors { + top: parent.top + right: parent.right + left: parent.left + } + + text: "add mail" + + onClicked: mailList.addMail("test test test"); + } + + ListView { + + anchors { + top: button.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + } + + model: mailList.model + + delegate: Label { + + text: model.subject + } + } +} \ No newline at end of file diff --git a/applications/kube-mail/package/contents/ui/main.qml b/applications/kube-mail/package/contents/ui/main.qml new file mode 100644 index 00000000..88d2edde --- /dev/null +++ b/applications/kube-mail/package/contents/ui/main.qml @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2015 Michael Bohlender + * + * 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 3 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, see . + */ + +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 +import org.kde.plasma.components 2.0 as PlasmaComponents + +import org.kde.akonadi2.mail 1.0 as Mail + +ApplicationWindow { + id: app + + //FIXME remove fixed pixel hight + //for now just convinience during testing + height: 1080 * 0.7 + width: 1920 * 0.7 + + visible: true + + //Controller: + Mail.FolderList { + id: folderList + } + + Mail.MailList { + id: mailList + } + + Mail.SingleMail{ + id: singleMail + } + + //UI + toolBar: ToolBar { + + Row { + anchors.fill: parent + + PlasmaComponents.ToolButton { + + height: parent.height + + iconName: "mail-message-new" + + text: "Compose" + } + + PlasmaComponents.ToolButton { + + height: parent.height + + iconName: "mail-mark-unread" + text: "Mark Unread" + + onClicked: { + mailList.markMailUnread(true) + } + } + + PlasmaComponents.ToolButton { + + height: parent.height + + iconName: "mail-mark-important" + text: "Mark Important" + + onClicked: { + mailList.markMailImportant(true) + } + } + + PlasmaComponents.ToolButton { + + height: parent.height + + iconName: "edit-delete" + text: "Delete Mail" + + onClicked: { + mailList.deleteMail() + } + } + } + } + + SplitView { + anchors.fill: parent + + FolderListView { + id: folderListView + + width: unit.size * 55 + Layout.maximumWidth: unit.size * 150 + Layout.minimumWidth: unit.size * 30 + } + + MailListView { + id: mailListView + + width: unit.size * 80 + Layout.maximumWidth: unit.size * 250 + Layout.minimumWidth: unit.size * 50 + } + + SingleMailView { + id: mailView + + Layout.fillWidth: true + } + } + + //TODO find a better way to scale UI + Item { + id: unit + + property int size: 5 + } + + ColorPalette { + id: colorPalette + } +} + diff --git a/applications/kube-mail/package/metadata.desktop b/applications/kube-mail/package/metadata.desktop new file mode 100644 index 00000000..630cc133 --- /dev/null +++ b/applications/kube-mail/package/metadata.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Kube Mail +X-KDE-PluginInfo-Name=org.kde.kube.mail +Exec=kpackagelauncherqml -a org.kde.kube.mail +X-Plasma-MainScript=ui/main.qml +X-KDE-ServiceTypes=KPackage/GenericQML +Icon=kmail2 +Type=Service -- cgit v1.2.3