=== c-nv-s_ is now known as c-nv-s [10:05] !ping [10:05] pong! [10:05] cool [10:05] ports no longer blocked [18:09] OK, who, other than Ken, knows about the Content Hub? I can't work out for the life of me how to use it :( [18:33] aquarius, what are you trying todo with it? [18:51] ahayzen, I have a list of the filenames of files in my app's data folder, and I show them in a ListView. I would like tapping a filename to show a list of apps on the phone which I can share that file to, and then choosing an app to open that file in that app. [18:51] ok [18:51] ahayzen, and I cannot work out how. A ContentPeerPicker presumably has something to do with it. [18:52] yeah it will do... i've only done an import (need to still implement export for music)..but this may be useful.. [18:52] Also, every example I can find shows a Page with a ContentPeerPicker in it, and the app pushes that Page onto a PageStack. But my app doesn't have a PageStack, it has Tabs, so I don't know how to even show the Picker, even if I could get it working, which I can't. :) [18:52] https://code.launchpad.net/~ken-vandine/+junk/hub-exporter [18:53] Yeah, I've done import; Readability appears in the browser's Share menu. It's being a source for sharing (without being a source for other apps that want to import a file) that I can't work out. [18:53] Yup, I've been looking at the hub exporter code, which as far as I can tell is the nearest thing to actual documentation of this stuff, but it's pretty impenetrable :( [18:54] so what have you got working so far? [18:55] nothing. The actual ContentHub code is complaining about not having peers, but Ken's hub-importer doesn't even *mention* PeerModelLoader, so I have no idea where one of those comes from [18:55] I can't even get started -- I can work out so little about this stuff that I don't even know what I don't know, if you see what I mean! [18:56] he has a ContentPeerPicker {} [18:57] IIRC the way his works is to load up activeTransfer with the items to transfer [18:57] then it then picker is shown [18:57] then it calls __exportItems(url) [18:58] He does, and I have one too, but when I try to use it, I get "file:///usr/lib/x86_64-linux-gnu/qt5/qml/Ubuntu/Content/ContentPeerPicker.qml:229: TypeError: Cannot read property 'peers' of null"... and that code line is "model: customPeerModelLoader ? customPeerModelLoader.item.peers : peerModelLoader.item.peers"... that is, it's expecting to have a PeerModelLoader or a CustomPeerModelLoader, and Ken doesn't [18:58] have one, so I don't get how any of it works :) [19:01] ugh i fear i'm going to have to figure this out for music soon as well :-) [19:03] * ahayzen wonders if that is a type "customer" https://developer.ubuntu.com/api/apps/qml/sdk-15.04/Ubuntu.Content.ContentPeerPicker/#customerPeerModelLoader-prop [19:03] *typo lol [19:03] I have been assuming that that's meant to be "custom", yeah :) [19:03] it says *optional* [19:03] but that is far from the worst fault in the documentation [19:04] ya, I *think* that if you want to provide your own peermodelloader you can set that to override the system one [19:04] but I don't seem to *have* the system one, and I don't know how to set it up, because the hub-importer never mentions it! [19:04] when you look at this page https://developer.ubuntu.com/api/apps/qml/sdk-15.04/Ubuntu.Content/ your just like which Content* thing do i want?! [19:05] this stuff is totally indecipherable; the docs are either low-level API docs or high-level handwavy "the content hub is for exchanging files between apps" stuff. There are no explanations of *how to use it* :( [19:05] what does you code look like currently? [19:06] http://pastebin.ubuntu.com/11868377/ [19:06] but that's not useful [19:06] because I'm literally just altering stuff at random ;) [19:06] and clicking the listitem throws "ContentPeerPicker.qml:229: TypeError: Cannot read property 'peers' of null" [19:08] "ContentType.Uknown" https://developer.ubuntu.com/api/apps/qml/sdk-15.04/Ubuntu.Content.ContentType/ [19:08] who wrote these docs ? lol [19:08] is there an app which can share a file to other apps, so I can look at the source? mzanetti's Tagger does it, I think, but I don't understand that either :) [19:09] yeah camera, gallery do as well IIRC [19:09] aquarius, huh? you mean content hub? [19:09] yup [19:09] mzanetti, I do [19:10] aquarius, ~mzanetti/+junk/contenthubtest [19:10] this is a test app I use when I do something with contenthub [19:10] ooh, that sounds useful ;) [19:10] it can share and receive anything [19:10] not 100% finished yet [19:10] thank you! I shall look at that [19:10] I plan to publish to store once it's ready... but should work fine for most parts already [19:12] aquarius, also just found this which is a text only exporter http://bazaar.launchpad.net/~ken-vandine/+junk/hub-text-exporter/view/head:/Main.qml which looks quite simple compared to the others [19:15] mzanetti, what's the difference between "share" and "export"? [19:15] haha [19:16] that's in the content hub api, it's not a peculiarity of mzanetti's app. But nothing describes what the difference is! [19:16] i did know the difference at one point... [19:19] aquarius, export is to "save" a file, share is to post it to facebook etc [19:19] aquarius, depending on which one you select you'll notice different apps showing up in the ContentPeerPicker [19:20] mzanetti, how does that filter it? by the type of content? [19:20] two things. ContentType and handler (share vs export) [19:21] ah ok so by having destination: [music] .. we only appear under export IIRC ? [19:21] not necessarily... every app accepting content can specify both [19:22] you can also write an app to share music [19:22] yeah i need to make music a source of music at some point [19:22] so then you could go from the Clock and pick a track for your alarm [19:23] or your ringtone whatever [19:26] since my app is basically like the file manager, I think I'd want a combination of both, but I don't know how to do that either.. [19:28] aquarius, for sending things to other apps you need: the apparmor policy content_exchange_source [19:29] in your app have a "share" button, onClicked show a ContentPeerPicker with contentType: ContentType.All (or restrict to whatever) and handler ContentType.Share [19:30] onPeerPicked, create a new ContentItem, set the url property to your file and and set it's state to Charged [19:31] ok, that makes sense; let me try that [19:33] then you can add a "save" or "open with..." button and do exactly the same, but set the picker's handler property to ContentHandler.Destination [19:33] for receiving content it's a bit different then... [19:42] Simplest imaginable approach: all I want to do is show a ContentPeerPicker (I'm not even trying to do the transfer yet, so we'll screw up when a peer is picked), code at http://pastebin.ubuntu.com/11868561/ and it throws error "ContentPeerPicker.qml:229: TypeError: Cannot read property 'peers' of null" on startup... presumably because I don't set a PeerModel? Or something? Confused [19:50] aquarius, hmm... are you running it on the desktop? [19:51] ah. I am. That may be it. I'll try it on the phone, then... [19:54] same error... [19:55] ContentPeerPicker10.qml:186: TypeError: Cannot read property 'peers' of null [20:12] let me try your contenthubtest and work out what's different :)