2
import Ubuntu.Components 1.1
3
import Ubuntu.Content 1.1
8
property var activeTransfer
13
activeTransfer: picker.activeTransfer
16
title: i18n.tr("Open with...")
17
head.sections.model: [i18n.tr("Pictures"), i18n.tr("Documents"), i18n.tr("Unknown")]
18
head.backAction: Action {
20
text: i18n.tr("Close")
21
onTriggered: Qt.quit()
28
switch (picker.head.sections.selectedIndex) {
30
return ContentType.Pictures
32
return ContentType.Documents
34
return ContentType.Unknown
37
handler: ContentHandler.Source
39
onPeerSelected: picker.activeTransfer = peer.request();
43
target: picker.activeTransfer ? picker.activeTransfer : null
45
if (picker.activeTransfer.state === ContentTransfer.Charged) {
46
file.path = picker.activeTransfer.items[0].url.toString().replace("file://", "")
47
console.log("[CONTENT-HUB] Content imported!")