From f6e8b7ff01c7de0a7b7613bf46b51adf3a8a59a1 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Thu, 1 Mar 2018 11:13:22 +0100 Subject: Add key import --- framework/qml/AttachmentDelegate.qml | 10 ++++++++++ framework/qml/Icons.qml | 1 + framework/qml/MailViewer.qml | 2 ++ 3 files changed, 13 insertions(+) (limited to 'framework/qml') diff --git a/framework/qml/AttachmentDelegate.qml b/framework/qml/AttachmentDelegate.qml index 3c308e65..4469cbdd 100644 --- a/framework/qml/AttachmentDelegate.qml +++ b/framework/qml/AttachmentDelegate.qml @@ -23,10 +23,12 @@ Item { id: root property string name + property string type property string icon property alias actionIcon: actionButton.iconName signal clicked; signal execute; + signal publicKeyImport; width: content.width + Kube.Units.smallSpacing * 1.5 height: content.height + Kube.Units.smallSpacing @@ -69,6 +71,14 @@ Item { text: root.name color: Kube.Colors.backgroundColor } + Kube.IconButton { + visible: root.type == "application/pgp-keys" + iconName: Kube.Icons.key_import_inverted + height: Kube.Units.gridUnit + width: height + onClicked: root.publicKeyImport() + padding: 0 + } Kube.IconButton { id: actionButton height: Kube.Units.gridUnit diff --git a/framework/qml/Icons.qml b/framework/qml/Icons.qml index 2afe840e..4dfae3d7 100644 --- a/framework/qml/Icons.qml +++ b/framework/qml/Icons.qml @@ -63,6 +63,7 @@ Item { property string secure: "document-encrypt" property string insecure: "document-decrypt" property string signed: "document-sign" + property string key_import_inverted: "view-certificate-import-inverted" property string addNew: "list-add" property string remove: "kube-list-remove-inverted" diff --git a/framework/qml/MailViewer.qml b/framework/qml/MailViewer.qml index 565adedd..e9ffd108 100644 --- a/framework/qml/MailViewer.qml +++ b/framework/qml/MailViewer.qml @@ -283,6 +283,7 @@ Rectangle { delegate: AttachmentDelegate { name: model.name + type: model.type icon: model.iconName clip: true @@ -290,6 +291,7 @@ Rectangle { actionIcon: Kube.Icons.save_inverted onExecute: messageParser.attachments.saveAttachmentToDisk(messageParser.attachments.index(index, 0)) onClicked: messageParser.attachments.openAttachment(messageParser.attachments.index(index, 0)) + onPublicKeyImport: messageParser.attachments.importPublicKey(messageParser.attachments.index(index, 0)) } } } -- cgit v1.2.3