From 5ca3a769c0b0c93cfcbf6134937b32eed52e2fc2 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 22 Feb 2017 15:56:21 +0100 Subject: Removed Create/Edit*.qml and controllers, added gmail plugin The current settings plugin could potentially be replaced by a proper controller, but what we have works so that's low priority. --- .../package/contents/ui/MaildirAccountSettings.qml | 124 ++++----------------- 1 file changed, 24 insertions(+), 100 deletions(-) (limited to 'accounts/maildir/package/contents/ui') diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml index a5d35d5c..b768979a 100644 --- a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml +++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml @@ -1,5 +1,6 @@ /* 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 @@ -17,108 +18,76 @@ */ import QtQuick 2.4 -import QtQuick.Controls 1.4 +import QtQuick.Controls 1.4 as Controls +import QtQuick.Controls 2.0 as Controls2 import QtQuick.Layouts 1.1 -import QtQuick.Dialogs 1.0 +import QtQuick.Dialogs 1.0 as Dialogs import org.kde.kirigami 1.0 as Kirigami import org.kube.framework.settings 1.0 as KubeSettings import org.kube.accounts.maildir 1.0 as MaildirAccount - Item { property string accountId + property string heading: "Add your Maildir archive" + property string subheadline: "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." MaildirAccount.MaildirSettings { id: maildirSettings accountIdentifier: accountId + accountType: "maildir" + } + + function save(){ + maildirSettings.save() } - anchors.fill: parent + function remove(){ + maildirSettings.remove() + } Item { anchors { fill: parent - margins: Kirigami.Units.largeSpacing * 2 - } - - Kirigami.Heading { - id: heading - text: "Add your Maildir archive" - - color: Kirigami.Theme.highlightColor - } - - Label { - id: subHeadline - - anchors { - left: heading.left - top: heading.bottom - } - - width: parent.width - - text: "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" - //TODO wait for kirgami theme disabled text color - opacity: 0.5 - wrapMode: Text.Wrap } GridLayout { anchors { - top:subHeadline.bottom - bottom: parent.bottom - left: parent.left - right: parent.right - topMargin: Kirigami.Units.largeSpacing * 2 - bottomMargin: Kirigami.Units.largeSpacing * 2 + fill: parent } - columns: 2 columnSpacing: Kirigami.Units.largeSpacing rowSpacing: Kirigami.Units.largeSpacing - Kirigami.Label { - text: "Title of account" + Controls.Label { + text: "Title of Account" Layout.alignment: Qt.AlignRight } - TextField { + Controls.TextField { Layout.fillWidth: true - + placeholderText: "E.g. \"Work\", \"Home\" that will be displayed in Kube as name" text: maildirSettings.accountName onTextChanged: { maildirSettings.accountName = text } } - Kirigami.Label { + Controls2.Label { text: "Path" Layout.alignment: Qt.AlignRight } RowLayout { Layout.fillWidth: true - TextField { + Controls.TextField { id: path Layout.fillWidth: true - + enabled: false text: maildirSettings.path - onTextChanged: { - maildirSettings.path = text - } - validator: maildirSettings.pathValidator - - Rectangle { - anchors.fill: parent - opacity: 0.2 - color: "yellow" - visible: path.acceptableInput == false - } } - Button { + Controls.Button { iconName: "folder" onClicked: { @@ -127,7 +96,7 @@ Item { Component { id: fileDialogComponent - FileDialog { + Dialogs.FileDialog { id: fileDialog visible: true @@ -142,51 +111,6 @@ Item { } } } - - Label { - text: "" - } - CheckBox { - text: "Read only" - } - - Label { - text: "" - Layout.fillHeight: true - } - Label { - text: "" - } - - Label { - text: "" - } - Item { - Layout.fillWidth: true - - Button { - text: "Delete" - - onClicked: { - maildirSettings.remove() - root.closeDialog() - } - } - - Button { - id: saveButton - - anchors.right: parent.right - - text: "Save" - - onClicked: { - focus: true - maildirSettings.save() - root.closeDialog() - } - } - } } } } -- cgit v1.2.3