Add support for sharing files from QML app
Summary: This allows you to a share a local file to a remote device using the qml app. Reviewers: nicolasfella Reviewed By: nicolasfella Subscribers: kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D16614
This commit is contained in:
parent
56ebd3f889
commit
f15c21e56b
1 changed files with 16 additions and 2 deletions
|
@ -21,6 +21,7 @@
|
|||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Dialogs 1.0
|
||||
import org.kde.kirigami 2.0 as Kirigami
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
|
@ -98,13 +99,21 @@ Kirigami.Page
|
|||
findmyphoneIface.ring()
|
||||
}
|
||||
}
|
||||
|
||||
PluginItem {
|
||||
label: i18n("Run command")
|
||||
interfaceFactory: RemoteCommandsDbusInterfaceFactory
|
||||
component: "qrc:/qml/runcommand.qml"
|
||||
pluginName: "remotecommands"
|
||||
}
|
||||
PluginItem {
|
||||
readonly property var shareIface: ShareDbusInterfaceFactory.create(deviceView.currentDevice.id())
|
||||
pluginName: "share"
|
||||
label: i18n("Share File")
|
||||
onClicked: {
|
||||
fileDialog.open()
|
||||
shareIface.shareUrl(fileDialog.fileUrl)
|
||||
}
|
||||
}
|
||||
|
||||
Item { Layout.fillHeight: true }
|
||||
}
|
||||
|
@ -121,7 +130,6 @@ Kirigami.Page
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: pairDevice
|
||||
Item {
|
||||
|
@ -141,4 +149,10 @@ Kirigami.Page
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
title: i18n("Please choose a file")
|
||||
folder: shortcuts.home
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue