Merge lp:~schwann/gallery-app/gallery-pick-return into lp:gallery-app

Proposed by Günter Schwann
Status: Merged
Merged at revision: 871
Proposed branch: lp:~schwann/gallery-app/gallery-pick-return
Merge into: lp:gallery-app
Diff against target: 124 lines (+25/-30)
5 files modified
rc/qml/GalleryApplication.qml (+12/-3)
src/content-communicator.cpp (+0/-13)
src/content-communicator.h (+0/-2)
src/gallery-application.cpp (+13/-8)
tests/unittests/stubs/content-communicator_stub.cpp (+0/-4)
To merge this branch: bzr merge lp:~schwann/gallery-app/gallery-pick-return
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ken VanDine Approve
Bill Filler (community) Needs Fixing
Review via email: mp+190181@code.launchpad.net

Commit message

Do not quit gallery when done with picking content fixes LP: #1236308

Description of the change

Do not quit gallery when done with picking content fixes LP: #1236308

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

I have tested this on my device with Mir, and it does work fine. However I do think we should quit if gallery-app wasn't already running before getting called for picking. If a user didn't have gallery-app in their list of running apps, it would be annoying to leave it running after picking is complete. From the users point of view, they used system-settings to pick a background, not gallery-app. The fact that it's gallery-app doing the work, should be transparent to the user.

Revision history for this message
Bill Filler (bfiller) wrote :

agreed. gallery should quit if it wasn't already opened before picking but not quit if it was already open.

review: Needs Fixing
Revision history for this message
Günter Schwann (schwann) wrote :

Quiting the application in that case should be handled by the content hub.
Gallery doesn't know if it was running "normally" before already. At least not, if there was no command line argument (will add this scenario, even if not used in content-hub).

I'll add the functionality to the content hub. Checking if the app is running already and stopping an app, is in the content hub ApplicationManager. So not too much left to there.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Günter Schwann (schwann) wrote :

MR for quiting the source if it was started by the content hub:
https://code.launchpad.net/~schwann/content-hub/content-quit-source/+merge/190389

Revision history for this message
Ken VanDine (ken-vandine) wrote :

Works for me on the device, I tested it with the referenced content-hub branch.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rc/qml/GalleryApplication.qml'
2--- rc/qml/GalleryApplication.qml 2013-10-06 23:52:24 +0000
3+++ rc/qml/GalleryApplication.qml 2013-10-10 09:19:50 +0000
4@@ -175,9 +175,18 @@
5 objectName: "mainLoader"
6
7 anchors.fill: parent
8- source: allLoaded ? (APP.pickModeEnabled ? Qt.resolvedUrl("PickerScreen.qml")
9- : Qt.resolvedUrl("MainScreen.qml"))
10- : ""
11+ source: allLoaded ? Qt.resolvedUrl("MainScreen.qml") : ""
12+ visible: !pickScreenLoader.visible
13+ }
14+
15+ /// FIXME use state saving instead of loading the UI twice
16+ Loader {
17+ id: pickScreenLoader
18+ objectName: "pickLoader"
19+
20+ anchors.fill: parent
21+ source: (allLoaded && APP.pickModeEnabled) ? Qt.resolvedUrl("PickerScreen.qml") : ""
22+ visible: source != ""
23 }
24
25 Component.onCompleted: {
26
27=== modified file 'src/content-communicator.cpp'
28--- src/content-communicator.cpp 2013-09-27 11:07:13 +0000
29+++ src/content-communicator.cpp 2013-10-10 09:19:50 +0000
30@@ -62,8 +62,6 @@
31 emit photoRequested();
32 emit selectionTypeChanged();
33 emit singleContentPickModeChanged();
34-
35- QObject::connect(m_transfer, SIGNAL(stateChanged()), this, SLOT(quitApp()));
36 }
37
38 /*!
39@@ -125,14 +123,3 @@
40
41 return m_transfer->selectionType() == Transfer::SelectionType::single;
42 }
43-
44-/*!
45- * \brief ContentCommunicator::quitApp
46- * FIXME
47- * As long as the content hub soes not close gallery -use this as fallback
48- */
49-void ContentCommunicator::quitApp()
50-{
51- if (!m_transfer)
52- qApp->quit();
53-}
54
55=== modified file 'src/content-communicator.h'
56--- src/content-communicator.h 2013-09-26 16:32:46 +0000
57+++ src/content-communicator.h 2013-10-10 09:19:50 +0000
58@@ -59,8 +59,6 @@
59 void singleContentPickModeChanged();
60
61 private:
62- Q_SLOT void quitApp();
63-
64 content::Transfer *m_transfer;
65 };
66
67
68=== modified file 'src/gallery-application.cpp'
69--- src/gallery-application.cpp 2013-09-26 16:32:46 +0000
70+++ src/gallery-application.cpp 2013-10-10 09:19:50 +0000
71@@ -51,6 +51,7 @@
72 #include <QQuickItem>
73 #include <QQuickView>
74 #include <QString>
75+#include <QTimer>
76 #include <QUrl>
77
78 QElapsedTimer* GalleryApplication::m_timer = 0;
79@@ -272,10 +273,12 @@
80 }
81 m_contentCommunicator->returnPhotos(selectedMedias);
82
83-// do not switch UI, as gallery anyway always quits atm.
84-// if (m_defaultUiMode == BrowseContentMode) {
85-// setUiMode(BrowseContentMode);
86-// }
87+ if (m_defaultUiMode == BrowseContentMode) {
88+ setUiMode(BrowseContentMode);
89+ } else {
90+ // give the app and content-hub some time to finish taks (run the event loop)
91+ QTimer::singleShot(10, this, SLOT(quit()));
92+ }
93 }
94
95 /*!
96@@ -286,10 +289,12 @@
97 {
98 m_contentCommunicator->cancelTransfer();
99
100-// do not switch UI, as gallery anyway always quits atm.
101-// if (m_defaultUiMode == BrowseContentMode) {
102-// setUiMode(BrowseContentMode);
103-// }
104+ if (m_defaultUiMode == BrowseContentMode) {
105+ setUiMode(BrowseContentMode);
106+ } else {
107+ // give the app and content-hub some time to finish taks (run the event loop)
108+ QTimer::singleShot(10, this, SLOT(quit()));
109+ }
110 }
111
112 /*!
113
114=== modified file 'tests/unittests/stubs/content-communicator_stub.cpp'
115--- tests/unittests/stubs/content-communicator_stub.cpp 2013-09-26 16:32:46 +0000
116+++ tests/unittests/stubs/content-communicator_stub.cpp 2013-10-10 09:19:50 +0000
117@@ -51,7 +51,3 @@
118 {
119 return true;
120 }
121-
122-void ContentCommunicator::quitApp()
123-{
124-}

Subscribers

People subscribed via source and target branches