import CameraPlus 1.0
// TODO: flash not ready (battery low or flash not ready message)
+// TODO: front camera
CameraPage {
id: root
+ CameraTheme {
+ id: cameraTheme
+ }
+
VisualItemModel {
id: mainModel
Component.onCompleted: {
platformSettings.init()
- // TODO: hardcoding device id
- root.resetCamera(0, settings.mode)
+ root.resetCamera(settings.device, settings.mode)
}
PlatformSettings {
Settings {
id: settings
+ onDeviceChanged: {
+ // Reset pipeline manager error
+ pipelineManager.error = false
+
+ if (root.resetCamera(settings.device, settings.mode)) {
+ pipelineManager.startCamera()
+ }
+ }
}
PipelineManager {
function resetCamera(deviceId, mode) {
if (!viewfinder.camera.reset(deviceId, mode)) {
showError(qsTr("Failed to set camera device and mode. Please restart the application."))
+ return false
}
+
+ return true
}
function showError(msg) {
dateTimeEnabled: true
}
- Orientation {
+ CameraOrientation {
id: orientation
active: viewfinder.camera.running || (mainView.currentIndex == 2 && Qt.application.active)
}
- Compass {
+ CameraCompass {
id: compass
active: viewfinder.camera.running
}