From eaea0ab6677a044a080c32552b108930cb30adb5 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Wed, 31 Oct 2018 20:58:52 +0100 Subject: [PATCH] Add support for sharing files from plasmoid Summary: This allows you to share a local file on your device to a remote device running kde connect. Reviewers: nicolasfella Reviewed By: nicolasfella Subscribers: kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D16552 --- .../package/contents/ui/DeviceDelegate.qml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/plasmoid/package/contents/ui/DeviceDelegate.qml b/plasmoid/package/contents/ui/DeviceDelegate.qml index 08e179198..8702d262b 100644 --- a/plasmoid/package/contents/ui/DeviceDelegate.qml +++ b/plasmoid/package/contents/ui/DeviceDelegate.qml @@ -24,6 +24,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.kdeconnect 1.0 import QtQuick.Controls.Styles 1.4 +import QtQuick.Dialogs 1.0 PlasmaComponents.ListItem { @@ -106,6 +107,29 @@ PlasmaComponents.ListItem textFormat: Text.PlainText } + //Share + PlasmaComponents.Button + { + Share { + id: share + device: root.device + } + FileDialog { + id: fileDialog + title: "Please choose a file" + folder: shortcuts.home + } + + id: shareFile + iconSource: "document-share" + visible: share.available + tooltip: i18n("Share file") + onClicked: { + fileDialog.open() + share.plugin.shareUrl(fileDialog.fileUrl) + } + } + //Find my phone PlasmaComponents.Button {