Merge lp:~ken-vandine/gallery-app/oop_peer_picker into lp:gallery-app

Proposed by Ken VanDine
Status: Approved
Approved by: Arthur Mello
Approved revision: 1338
Proposed branch: lp:~ken-vandine/gallery-app/oop_peer_picker
Merge into: lp:gallery-app
Prerequisite: lp:~ken-vandine/gallery-app/add_profile
Diff against target: 255 lines (+42/-111)
7 files modified
debian/control (+2/-1)
rc/qml/EventsOverview.qml (+15/-34)
rc/qml/MediaViewer/MediaViewer.qml (+13/-30)
rc/qml/PhotosOverview.qml (+12/-31)
tests/autopilot/gallery_app/emulators/events_view.py (+0/-5)
tests/autopilot/gallery_app/emulators/photo_viewer.py (+0/-5)
tests/autopilot/gallery_app/emulators/photos_view.py (+0/-5)
To merge this branch: bzr merge lp:~ken-vandine/gallery-app/oop_peer_picker
Reviewer Review Type Date Requested Status
Arthur Mello (community) Approve
system-apps-ci-bot continuous-integration Approve
Review via email: mp+312292@code.launchpad.net

Commit message

Use new out of process peer picker for sharing

Description of the change

Use new out of process peer picker for sharing

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:1337
https://jenkins.canonical.com/system-apps/job/lp-gallery-app-ci/31/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/2103
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/519
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/2106
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1934
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1934/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1934
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1934/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/1934
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/1934/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1934
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1934/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1934
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1934/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/1934
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/1934/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1934
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1934/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1934
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1934/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/1934
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/1934/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-gallery-app-ci/31/rebuild

review: Approve (continuous-integration)
1338. By Ken VanDine

Bump depends for content-hub to >= 0.3 for the out of process peer picker

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:1338
https://jenkins.canonical.com/system-apps/job/lp-gallery-app-ci/33/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/2158
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/554
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/2161
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1989
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1989/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1989
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1989/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/1989
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/1989/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1989
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1989/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1989
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1989/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/1989
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/1989/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1989
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1989/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1989
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1989/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/1989
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/1989/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-gallery-app-ci/33/rebuild

review: Approve (continuous-integration)
Revision history for this message
Arthur Mello (artmello) wrote :

lgtm

review: Approve

Unmerged revisions

1338. By Ken VanDine

Bump depends for content-hub to >= 0.3 for the out of process peer picker

1337. By Ken VanDine

Use new out of process peer picker for sharing

1336. By Ken VanDine

Depend on qtdeclarative5-ubuntu-ui-extras0.2

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2016-12-08 14:51:07 +0000
3+++ debian/control 2016-12-08 14:51:08 +0000
4@@ -40,8 +40,9 @@
5 qml-module-ubuntu-thumbnailer0.1,
6 qtdeclarative5-ubuntu-ui-toolkit-plugin | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles,
7 qtdeclarative5-window-plugin,
8- qtdeclarative5-ubuntu-content1,
9+ qtdeclarative5-ubuntu-content1 (>= 0.3),
10 qtdeclarative5-ubuntu-thumbnailer0.1,
11+ qtdeclarative5-ubuntu-ui-extras0.2,
12 Description: Photo gallery for Ubuntu
13 gallery-app is a photo gallery for the Ubuntu platform.
14
15
16=== modified file 'rc/qml/EventsOverview.qml'
17--- rc/qml/EventsOverview.qml 2016-04-13 19:00:29 +0000
18+++ rc/qml/EventsOverview.qml 2016-12-08 14:51:08 +0000
19@@ -147,8 +147,9 @@
20 PopupUtils.open(unableShareDialog, null);
21 return;
22 }
23- overview.pushPage(sharePicker);
24- sharePicker.visible = true;
25+ ContentHub.requestPeerForType(
26+ galleryPhotoViewer.media.type === MediaSource.Video ? ContentType.Videos : ContentType.Pictures,
27+ ContentHandler.Share);
28 }
29 }
30 ]
31@@ -184,38 +185,18 @@
32 ContentItem {}
33 }
34
35- Page {
36- id: sharePicker
37- visible: false
38- title: i18n.tr("Share to")
39-
40- ContentPeerPicker {
41- objectName: "sharePickerEvents"
42- anchors.fill: parent
43- showTitle: false
44-
45- contentType: organicEventView.selection.mediaType === MediaSource.Video ? ContentType.Videos : ContentType.Pictures
46- handler: ContentHandler.Share
47-
48- onPeerSelected: {
49- overview.popPage();
50- sharePicker.visible = false;
51-
52- var curTransfer = peer.request();
53- if (curTransfer.state === ContentTransfer.InProgress)
54- {
55- var medias = organicEventView.selection.model.selectedMediasQML;
56- curTransfer.items = medias.filter(function(data) {
57- return data.hasOwnProperty('type'); // filter out event headers
58- }).map(function(data) {
59- return contentItemComp.createObject(parent, {"url": data.path});
60- });
61- curTransfer.state = ContentTransfer.Charged;
62- }
63- }
64- onCancelPressed: {
65- overview.popPage();
66- sharePicker.visible = false;
67+ Connections {
68+ target: ContentHub
69+ onPeerSelected: {
70+ var curTransfer = peer.request();
71+ if (curTransfer.state === ContentTransfer.InProgress) {
72+ var medias = organicEventView.selection.model.selectedMediasQML;
73+ curTransfer.items = medias.filter(function(data) {
74+ return data.hasOwnProperty('type'); // filter out event headers
75+ }).map(function(data) {
76+ return contentItemComp.createObject(parent, {"url": data.path});
77+ });
78+ curTransfer.state = ContentTransfer.Charged;
79 }
80 }
81 }
82
83=== modified file 'rc/qml/MediaViewer/MediaViewer.qml'
84--- rc/qml/MediaViewer/MediaViewer.qml 2016-02-24 17:24:38 +0000
85+++ rc/qml/MediaViewer/MediaViewer.qml 2016-12-08 14:51:08 +0000
86@@ -63,7 +63,7 @@
87 property bool isReady: model != null && model.count > 0 && galleryPhotoViewer.currentItem
88
89 // tooolbar actions for the full view
90- property variant actions: (media && !sharePicker.visible) ? d.mediaActions : []
91+ property variant actions: media ? d.mediaActions : []
92
93 property variant backAction: d.backAction
94
95@@ -172,33 +172,15 @@
96 ContentItem {}
97 }
98
99- Page {
100- id: sharePicker
101- visible: false
102- title: i18n.tr("Share to")
103-
104- onVisibleChanged: viewerWrapper.setHeaderVisibilityRequested(!visible)
105-
106- ContentPeerPicker {
107- objectName: "sharePicker"
108- showTitle: false
109- anchors.fill: parent
110- contentType: galleryPhotoViewer.media.type === MediaSource.Video ? ContentType.Videos : ContentType.Pictures
111- handler: ContentHandler.Share
112-
113- onPeerSelected: {
114- overview.popPage();
115- sharePicker.visible = false;
116- var curTransfer = peer.request();
117- if (curTransfer.state === ContentTransfer.InProgress)
118- {
119- curTransfer.items = [ contentItemComp.createObject(parent, {"url": viewerWrapper.media.path}) ];
120- curTransfer.state = ContentTransfer.Charged;
121- }
122- }
123- onCancelPressed: {
124- overview.popPage();
125- sharePicker.visible = false;
126+ Connections {
127+ target: ContentHub
128+ onPeerSelected: {
129+ console.debug("onPeerSelected: " + peer);
130+ var curTransfer = peer.request();
131+ if (curTransfer.state === ContentTransfer.InProgress)
132+ {
133+ curTransfer.items = [ contentItemComp.createObject(parent, {"url": viewerWrapper.media.path}) ];
134+ curTransfer.state = ContentTransfer.Charged;
135 }
136 }
137 }
138@@ -358,8 +340,9 @@
139 iconName: "share"
140 visible: !APP.desktopMode
141 onTriggered: {
142- overview.pushPage(sharePicker)
143- sharePicker.visible = true;
144+ ContentHub.requestPeerForType(
145+ galleryPhotoViewer.media.type === MediaSource.Video ? ContentType.Videos : ContentType.Pictures,
146+ ContentHandler.Share);
147 }
148 }
149 ]
150
151=== modified file 'rc/qml/PhotosOverview.qml'
152--- rc/qml/PhotosOverview.qml 2016-04-13 19:00:29 +0000
153+++ rc/qml/PhotosOverview.qml 2016-12-08 14:51:08 +0000
154@@ -173,9 +173,9 @@
155 PopupUtils.open(unableShareDialog, null);
156 return;
157 }
158-
159- overview.pushPage(sharePicker)
160- sharePicker.visible = true;
161+ ContentHub.requestPeerForType(
162+ galleryPhotoViewer.media.type === MediaSource.Video ? ContentType.Videos : ContentType.Pictures,
163+ ContentHandler.Share);
164 }
165 }
166 ]
167@@ -197,34 +197,15 @@
168 ContentItem {}
169 }
170
171- Page {
172- id: sharePicker
173- visible: false
174- title: i18n.tr("Share to")
175-
176- ContentPeerPicker {
177- objectName: "sharePickerPhotos"
178- showTitle: false
179- anchors.fill: parent
180- contentType: d.selection.mediaType === MediaSource.Video ? ContentType.Videos : ContentType.Pictures
181- handler: ContentHandler.Share
182-
183- onPeerSelected: {
184- overview.popPage();
185- sharePicker.visible = false;
186-
187- var curTransfer = peer.request();
188- if (curTransfer.state === ContentTransfer.InProgress)
189- {
190- curTransfer.items = d.selection.model.selectedMediasQML.map(function(data) {
191- return contentItemComp.createObject(parent, {"url": data.path});
192- });
193- curTransfer.state = ContentTransfer.Charged;
194- }
195- }
196- onCancelPressed: {
197- overview.popPage();
198- sharePicker.visible = false;
199+ Connections {
200+ target: ContentHub
201+ onPeerSelected: {
202+ var curTransfer = peer.request();
203+ if (curTransfer.state === ContentTransfer.InProgress) {
204+ curTransfer.items = d.selection.model.selectedMediasQML.map(function(data) {
205+ return contentItemComp.createObject(parent, {"url": data.path});
206+ });
207+ curTransfer.state = ContentTransfer.Charged;
208 }
209 }
210 }
211
212=== modified file 'tests/autopilot/gallery_app/emulators/events_view.py'
213--- tests/autopilot/gallery_app/emulators/events_view.py 2016-02-12 21:53:45 +0000
214+++ tests/autopilot/gallery_app/emulators/events_view.py 2016-12-08 14:51:08 +0000
215@@ -46,11 +46,6 @@
216 photo_delegates = event.select_many(objectName='eventPhoto')
217 return len(photo_delegates)
218
219- def get_share_peer_picker(self):
220- """Returns the photo viewer share picker."""
221- return self.app.wait_select_single(objectName="sharePickerEvents",
222- visible=True)
223-
224 def _get_image_in_event_view(self, image_name):
225 """Return the photo of the gallery based on image name.
226
227
228=== modified file 'tests/autopilot/gallery_app/emulators/photo_viewer.py'
229--- tests/autopilot/gallery_app/emulators/photo_viewer.py 2016-01-15 20:29:19 +0000
230+++ tests/autopilot/gallery_app/emulators/photo_viewer.py 2016-12-08 14:51:08 +0000
231@@ -97,11 +97,6 @@
232 return self.app.wait_select_single("PopupAlbumPicker",
233 objectName="popupAlbumPicker")
234
235- def get_share_peer_picker(self):
236- """Returns the photo viewer share picker."""
237- return self.app.wait_select_single(objectName="sharePicker",
238- visible=True)
239-
240 def get_photo_editor(self):
241 """Returns the photo edit dialog."""
242 return self.app.wait_select_single("PhotoEditor")
243
244=== modified file 'tests/autopilot/gallery_app/emulators/photos_view.py'
245--- tests/autopilot/gallery_app/emulators/photos_view.py 2016-02-12 21:53:45 +0000
246+++ tests/autopilot/gallery_app/emulators/photos_view.py 2016-12-08 14:51:08 +0000
247@@ -28,8 +28,3 @@
248 photo_delegates = self.app.select_many("QQuickItem",
249 objectName="allPotosGridPhoto")
250 return len(photo_delegates)
251-
252- def get_share_peer_picker(self):
253- """Returns the photo viewer share picker."""
254- return self.app.wait_select_single(objectName="sharePickerPhotos",
255- visible=True)

Subscribers

People subscribed via source and target branches