~ci-train-bot/camera-app/camera-app-ubuntu-xenial-landing-041

« back to all changes in this revision

Viewing changes to ViewFinderExportConfirmation.qml

  • Committer: CI Train Bot
  • Author(s): Florian Boucault, Ugo Riboni, Arthur Mello
  • Date: 2016-02-29 12:14:36 UTC
  • mfrom: (607.1.52 staging)
  • Revision ID: ci-train-bot@canonical.com-20160229121436-7l9hv9sqblzhgwvm
New release:
- Allow tap to focus up to the left/right edge of the screen
- Query the manual focus support to enable/disable tap-to-focus as the backend supports it
- Do not crash if no QCameraExposureControl is available (true with Unity 7)
- Before setting a photo capture resolution, always checks it is included in the possible resolution options
- Fix bottom edge mouse handling: ensure that clicks on the bottom edge open it and that any click outside of option buttons dismiss the bottom edge
- Various performance improvements to minimize the time between shots and between pressing the shutter button and the actual capture
- When the GPS fix is accurate to less than 100m display the GPS icon in red and don't save location
- Display error messages when disk write fails and when SD card is not writeable when switching to it
- Disable record/shuttle button while PhotoRoll hint is visible

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
    property bool isVideo
24
24
    property string mediaPath
25
 
    property Snapshot snapshot
26
 
 
27
 
    function confirmExport(path) {
28
 
        viewFinder.visible = false;
29
 
        viewFinderOverlay.visible = false;
30
 
        mediaPath = path;
31
 
        if (!isVideo) snapshot.visible = true;
32
 
        visible = true;
33
 
    }
34
 
 
35
 
    function hide() {
36
 
        viewFinder.visible = true;
37
 
        viewFinderOverlay.visible = true;
38
 
        snapshot.source = "";
39
 
        snapshot.visible = false;
40
 
        visible = false;
41
 
    }
 
25
    property bool waitingForPictureCapture: false
 
26
 
 
27
    signal hideRequested()
 
28
    signal showRequested()
 
29
    property ViewFinderGeometry viewFinderGeometry
42
30
 
43
31
    visible: false
44
32
 
 
33
    // For videos show immediately without waiting for the preview to load,
 
34
    // since we will show a progress indicator instead of the preview
 
35
    onMediaPathChanged: if (mediaPath && isVideo) showRequested()
 
36
 
 
37
    function photoCaptureStarted() {
 
38
        controls.item.lockPictureOrientation()
 
39
        waitingForPictureCapture = true
 
40
    }
 
41
 
45
42
    Loader {
 
43
        id: controls
46
44
        anchors.fill: parent
47
45
        asynchronous: true
48
46
        sourceComponent: Component {
49
47
            Item {
 
48
                function lockPictureOrientation() { pictureReview.lockOrientation() }
 
49
 
50
50
                VideoReview {
51
51
                    id: videoReview
52
52
                    anchors.fill: parent
53
53
                    bottomMargin: buttons.height
54
 
                    videoPath: mediaPath
 
54
                    videoPath: isVideo ? mediaPath : ""
55
55
                    visible: isVideo
56
56
                }
57
57
 
 
58
                PictureReview {
 
59
                    id: pictureReview
 
60
                    anchors.fill: parent
 
61
                    visible: !isVideo
 
62
                    geometry: viewFinderGeometry
 
63
                    source: !isVideo ? mediaPath : ""
 
64
 
 
65
                    // Show export confirmation only when the snapshot is loaded to prevent the
 
66
                    // screen being black while the image loads
 
67
                    onLoadedChanged: {
 
68
                        if (loaded) {
 
69
                             viewFinderExportConfirmation.showRequested()
 
70
                             waitingForPictureCapture = false
 
71
                         }
 
72
                    }
 
73
                }
 
74
 
58
75
                Item {
59
76
                    id: buttons
60
77
                    anchors.bottom: parent.bottom
74
91
                        }
75
92
 
76
93
                        iconName: "reload"
77
 
                        onClicked: viewFinderExportConfirmation.hide()
 
94
                        onClicked: hideRequested()
78
95
                    }
79
96
 
80
97
                    CircleButton {
90
107
 
91
108
                        iconName: "ok"
92
109
                        onClicked: {
93
 
                            viewFinderExportConfirmation.hide();
 
110
                            hideRequested();
94
111
                            main.exportContent([mediaPath]);
 
112
                            mediaPath = "";
95
113
                        }
96
114
                    }
97
115
 
108
126
 
109
127
                        iconName: "close"
110
128
                        onClicked: {
111
 
                            viewFinderExportConfirmation.hide();
 
129
                            hideRequested();
112
130
                            main.cancelExport();
 
131
                            mediaPath = "";
113
132
                        }
114
133
                    }
115
134
                }