From 54c3e5912b0d64bad5a1c66bc96f0552ac5e21f5 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 3 Mar 2016 17:10:18 +0100 Subject: Install a qml plugin for the maildir account This works and allows us to register other controllers and action handlers, but it's not yet clear to me whether we should rather be using kpackage for this as well (and I failed to get it to run, so, here we are...) --- accounts/maildir/CMakeLists.txt | 27 ++++++ .../package/contents/ui/MaildirAccountSettings.qml | 100 +++++++++++++++++++++ accounts/maildir/qmldir | 3 + 3 files changed, 130 insertions(+) create mode 100644 accounts/maildir/CMakeLists.txt create mode 100644 accounts/maildir/package/contents/ui/MaildirAccountSettings.qml create mode 100644 accounts/maildir/qmldir (limited to 'accounts/maildir') diff --git a/accounts/maildir/CMakeLists.txt b/accounts/maildir/CMakeLists.txt new file mode 100644 index 00000000..7e9894b1 --- /dev/null +++ b/accounts/maildir/CMakeLists.txt @@ -0,0 +1,27 @@ +project(kube-accounts-maildir) + +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(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/accounts/maildir) +install(FILES package/contents/ui/MaildirAccountSettings.qml DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/accounts/maildir) + diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml new file mode 100644 index 00000000..5ba9f0c1 --- /dev/null +++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2016 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.4 +import QtQuick.Layouts 1.1 + +import org.kde.kube.settings 1.0 as KubeSettings +// import org.kde.kube.accounts.maildir 1.0 as MaildirAccount + +Rectangle { + id: root + property string accountId + property string accountName + + color: colorPalette.background + + GridLayout { + id: gridLayout + columns: 2 + Layout.fillWidth: true + + Text { + Layout.columnSpan: 2 + Layout.fillWidth: true + text: "Account: " + accountName + } + + Label { text: "Username" } + TextField { + id: username + text: "username" + Layout.fillWidth: true + } + + Label { text: "Password" } + TextField { + id: password + text: "password" + Layout.fillWidth: true + } + + Label { text: "Server" } + TextField { + id: server + text: "server" + Layout.fillWidth: true + } + + //If we had a settings controller + // MaildirAccount.SmtpSettings { + // id: smtpSettings + // identifier: accountId + // property alias username: username.text + // property alias password: password.text + // property alias server: server.text + // } + + KubeSettings.Settings { + id: accountSettings + identifier: "account." + modelData + property string primaryIdentity: "current" + } + KubeSettings.Settings { + id: identitySettings + identifier: "identity.current" + property string transport: "current" + } + KubeSettings.Settings { + id: transportSettings + identifier: "transport.current" + property alias username: username.text + property alias password: password.text + property alias server: server.text + } + + Button { + id: button + text: "Save" + onClicked: { + smtpSettings.save(); + root.visible = false; + } + } + } +} diff --git a/accounts/maildir/qmldir b/accounts/maildir/qmldir new file mode 100644 index 00000000..40e6be1c --- /dev/null +++ b/accounts/maildir/qmldir @@ -0,0 +1,3 @@ +module org.kde.kube.accounts.maildir + +AccountSettings 1.0 MaildirAccountSettings.qml -- cgit v1.2.3