2
import Ubuntu.Components 1.1
3
import Ubuntu.Content 1.1
7
title: i18n.tr("Open with...")
9
property var activeTransfer
11
head.sections.model: [i18n.tr("Documents"), i18n.tr("Pictures"), i18n.tr("Other")]
12
head.backAction: Action {
15
onTriggered: pageStack.pop()
19
// Do not show ContentPeerPicker header, since we need head.sections.
23
switch (picker.head.sections.selectedIndex) {
25
return ContentType.Documents
27
return ContentType.Pictures
29
return ContentType.Unknown
32
handler: ContentHandler.Source
34
onPeerSelected: picker.activeTransfer = peer.request();
40
activeTransfer: picker.activeTransfer
44
target: picker.activeTransfer ? picker.activeTransfer : null
46
if (picker.activeTransfer.state === ContentTransfer.Charged) {
47
// Close ContentHubPicker page.
50
file.path = picker.activeTransfer.items[0].url.toString().replace("file://", "")
51
console.log("[CONTENT-HUB] Content imported!")