Merge lp:~fboucault/camera-app/disable_controls_while_shooting into lp:camera-app/staging

Proposed by Florian Boucault
Status: Merged
Approved by: Ugo Riboni
Approved revision: 630
Merged at revision: 629
Proposed branch: lp:~fboucault/camera-app/disable_controls_while_shooting
Merge into: lp:camera-app/staging
Diff against target: 143 lines (+10/-13)
4 files modified
ViewFinderOverlay.qml (+6/-2)
ViewFinderOverlayLoader.qml (+0/-6)
ViewFinderView.qml (+3/-4)
camera-app.qml (+1/-1)
To merge this branch: bzr merge lp:~fboucault/camera-app/disable_controls_while_shooting
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ugo Riboni (community) Approve
Review via email: mp+281827@code.launchpad.net

Commit message

Disable all controls while a photo is being saved.

To post a comment you must log in.
630. By Florian Boucault

Disable focus ring also

Revision history for this message
Ugo Riboni (uriboni) wrote :

Works as expected and simplifies previous code as a bonus, so all good

review: Approve
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 'ViewFinderOverlay.qml'
2--- ViewFinderOverlay.qml 2016-01-05 14:09:07 +0000
3+++ ViewFinderOverlay.qml 2016-01-07 09:46:25 +0000
4@@ -32,7 +32,6 @@
5 property real revealProgress: noSpaceHint.visible ? 1.0 : bottomEdge.progress
6 property var controls: controls
7 property var settings: settings
8- signal photoCaptureStarting()
9
10 function showFocusRing(x, y) {
11 focusRing.center = Qt.point(x, y);
12@@ -286,6 +285,7 @@
13 height: optionsOverlayLoader.height
14 onOpenedChanged: optionsOverlayLoader.item.closeValueSelector()
15 enabled: camera.videoRecorder.recorderState == CameraRecorder.StoppedState
16+ && !camera.photoCaptureInProgress
17 opacity: enabled ? 1.0 : 0.3
18
19 Item {
20@@ -698,7 +698,7 @@
21 }
22 }
23
24- viewFinderOverlay.photoCaptureStarting()
25+ camera.photoCaptureInProgress = true;
26 if (main.contentExportMode) {
27 camera.imageCapture.captureToLocation(application.temporaryLocation);
28 } else if (application.removableStoragePresent && settings.preferRemovableStorage) {
29@@ -787,6 +787,7 @@
30 iconName: (camera.captureMode == Camera.CaptureStillImage) ? "camcorder" : "camera-symbolic"
31 onClicked: controls.changeRecordMode()
32 enabled: camera.videoRecorder.recorderState == CameraRecorder.StoppedState && !main.contentExportMode
33+ && !camera.photoCaptureInProgress
34 }
35
36 ShootButton {
37@@ -836,6 +837,7 @@
38 }
39
40 enabled: !camera.switchInProgress && camera.videoRecorder.recorderState == CameraRecorder.StoppedState
41+ && !camera.photoCaptureInProgress
42 iconName: "camera-flip"
43 onClicked: controls.switchCamera()
44 }
45@@ -858,6 +860,7 @@
46 property real maximumScale: 3.0
47 property bool active: false
48
49+ enabled: !camera.photoCaptureInProgress
50 onPinchStarted: {
51 active = true;
52 initialZoom = zoomControl.value;
53@@ -876,6 +879,7 @@
54 MouseArea {
55 id: manualFocusMouseArea
56 anchors.fill: parent
57+ enabled: !camera.photoCaptureInProgress
58 onClicked: {
59 camera.manualFocus(mouse.x, mouse.y);
60 mouse.accepted = false;
61
62=== modified file 'ViewFinderOverlayLoader.qml'
63--- ViewFinderOverlayLoader.qml 2016-01-05 14:04:31 +0000
64+++ ViewFinderOverlayLoader.qml 2016-01-07 09:46:25 +0000
65@@ -24,7 +24,6 @@
66 property real revealProgress: loader.item ? loader.item.revealProgress : 0
67 property var controls: loader.item ? loader.item.controls : null
68 property var settings: loader.item.settings
69- signal photoCaptureStarting()
70
71 function showFocusRing(x, y) {
72 loader.item.showFocusRing(x, y);
73@@ -34,11 +33,6 @@
74 loader.item.updateResolutionOptions();
75 }
76
77- Connections {
78- target: item
79- onPhotoCaptureStarting: loader.photoCaptureStarting()
80- }
81-
82 asynchronous: true
83 Component.onCompleted: {
84 loader.setSource("ViewFinderOverlay.qml", { "camera": loader.camera });
85
86=== modified file 'ViewFinderView.qml'
87--- ViewFinderView.qml 2016-01-05 14:09:07 +0000
88+++ ViewFinderView.qml 2016-01-07 09:46:25 +0000
89@@ -31,7 +31,6 @@
90 property bool inView
91 property alias captureMode: camera.captureMode
92 property real aspectRatio: viewFinder.sourceRect.height != 0 ? viewFinder.sourceRect.width / viewFinder.sourceRect.height : 1.0
93- property bool photoCaptureInProgress: false
94 signal photoTaken(string filePath)
95 signal videoShot(string filePath)
96
97@@ -39,7 +38,6 @@
98 Connections {
99 target: viewFinderOverlay
100 onStatusChanged: decideCameraState()
101- onPhotoCaptureStarting: viewFinderView.photoCaptureInProgress = true
102 }
103 Connections {
104 target: Qt.application
105@@ -107,6 +105,7 @@
106 property alias currentZoom: camera.digitalZoom
107 property alias maximumZoom: camera.maximumDigitalZoom
108 property bool switchInProgress: false
109+ property bool photoCaptureInProgress: false
110
111 imageCapture {
112 onReadyChanged: {
113@@ -119,7 +118,7 @@
114 }
115 }
116 onCaptureFailed: {
117- photoCaptureInProgress = false;
118+ camera.photoCaptureInProgress = false;
119 console.log("Capture failed for request " + requestId + ": " + message);
120 }
121 onImageCaptured: {
122@@ -137,7 +136,7 @@
123 viewFinderExportConfirmation.confirmExport(path);
124 }
125 viewFinderView.photoTaken(path);
126- photoCaptureInProgress = false;
127+ camera.photoCaptureInProgress = false;
128 metricPhotos.increment();
129 console.log("Picture saved as " + path);
130 }
131
132=== modified file 'camera-app.qml'
133--- camera-app.qml 2016-01-05 14:04:31 +0000
134+++ camera-app.qml 2016-01-07 09:46:25 +0000
135@@ -135,7 +135,7 @@
136 }
137 }
138 ]
139- interactive: !viewFinderView.touchAcquired && !galleryView.touchAcquired && !viewFinderView.photoCaptureInProgress
140+ interactive: !viewFinderView.touchAcquired && !galleryView.touchAcquired && !viewFinderView.camera.photoCaptureInProgress
141
142 Component.onCompleted: {
143 // FIXME: workaround for qtubuntu not returning values depending on the grid unit definition

Subscribers

People subscribed via source and target branches