Merge lp:~abreu-alexandre/unity-webapps-qml/content-hub-share-import into lp:unity-webapps-qml

Proposed by Alexandre Abreu
Status: Merged
Merged at revision: 123
Proposed branch: lp:~abreu-alexandre/unity-webapps-qml/content-hub-share-import
Merge into: lp:unity-webapps-qml
Diff against target: 87 lines (+66/-0)
2 files modified
src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js (+14/-0)
src/Ubuntu/UnityWebApps/bindings/content-hub/client/content-hub.js (+52/-0)
To merge this branch: bzr merge lp:~abreu-alexandre/unity-webapps-qml/content-hub-share-import
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+220197@code.launchpad.net

Commit message

Add support for share & import signals

Description of the change

Add support for share & import signals

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks good to me, I tested onImportRequested and onShareRequested on mako, worked fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js'
2--- src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js 2014-05-08 13:01:07 +0000
3+++ src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js 2014-05-20 06:59:07 +0000
4@@ -769,6 +769,20 @@
5 });
6 },
7
8+ onImportRequested: function(callback) {
9+ _contenthub.onImportRequested.connect(function(importTransfer) {
10+ var wrapped = new ContentTransfer(importTransfer);
11+ callback(wrapped.serialize());
12+ });
13+ },
14+
15+ onShareRequested: function(callback) {
16+ _contenthub.shareRequested.connect(function(shareTransfer) {
17+ var wrapped = new ContentTransfer(shareTransfer);
18+ callback(wrapped.serialize());
19+ });
20+ },
21+
22 // Internal
23
24 dispatchToObject: function(infos) {
25
26=== modified file 'src/Ubuntu/UnityWebApps/bindings/content-hub/client/content-hub.js'
27--- src/Ubuntu/UnityWebApps/bindings/content-hub/client/content-hub.js 2014-03-18 13:59:36 +0000
28+++ src/Ubuntu/UnityWebApps/bindings/content-hub/client/content-hub.js 2014-05-20 06:59:07 +0000
29@@ -836,6 +836,58 @@
30 [callback]);
31 },
32
33+ /**
34+ * Sets a handler that is to be called when the current application is the
35+ * target of an share request.
36+ *
37+ * @method onExportRequested
38+ * @param callback {Function(ContentTransfer)} Function when one requests a resource to be shared.
39+ * The corresponding ContentTransfer is provided as a parameter.
40+ *
41+ * @example
42+
43+ var api = external.getUnityObject(1.0);
44+ var hub = api.ContentHub;
45+
46+ var transferState = hub.ContentTransfer.State;
47+
48+ function _shareRequested(transfer) {
49+ };
50+
51+ hub.onShareRequested(_shareRequested);
52+
53+ */
54+ onShareRequested: function(callback) {
55+ backendBridge.call('ContentHub.onShareRequested',
56+ [callback]);
57+ },
58+
59+ /**
60+ * Sets a handler that is to be called when the current application is the
61+ * target of an import request.
62+ *
63+ * @method onImportRequested
64+ * @param callback {Function(ContentTransfer)} Function when one requests a resource to be imported.
65+ * The corresponding ContentTransfer is provided as a parameter.
66+ *
67+ * @example
68+
69+ var api = external.getUnityObject(1.0);
70+ var hub = api.ContentHub;
71+
72+ var transferState = hub.ContentTransfer.State;
73+
74+ function _importRequested(transfer) {
75+ };
76+
77+ hub.onImportRequested(_importRequested);
78+
79+ */
80+ onImportRequested: function(callback) {
81+ backendBridge.call('ContentHub.onImportRequested',
82+ [callback]);
83+ },
84+
85 api: {
86
87 /**

Subscribers

People subscribed via source and target branches

to all changes: