X-Git-Url: http://cgit.sxemacs.org/?p=harmattan%2Fcameraplus;a=blobdiff_plain;f=qml%2FCameraSettings.qml;h=9791aa8f890785ef7b4db87607962bfafe49a5a2;hp=8f0f874e89ae57b5ae9758aac3489c38a54bd60e;hb=c636dcebc755fd75fbb5e475f0e9e4f16e11ccc7;hpb=a339d80735f5d460601c3e2ad381b3b5e5110652 diff --git a/qml/CameraSettings.qml b/qml/CameraSettings.qml index 8f0f874..9791aa8 100644 --- a/qml/CameraSettings.qml +++ b/qml/CameraSettings.qml @@ -3,7 +3,7 @@ /*! * This file is part of CameraPlus. * - * Copyright (C) 2012 Mohammed Sameer + * Copyright (C) 2012-2013 Mohammed Sameer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,121 +20,106 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -import QtQuick 1.1 -import com.nokia.meego 1.1 +import QtQuick 2.0 +import QtCamera 1.0 Column { - id: col - spacing: 10 - - Label { - font.pixelSize: 36 - text: qsTr("Camera settings"); - } - - SectionHeader { - text: qsTr("Show captured content"); - } - - ButtonRow { - anchors.horizontalCenter: parent.horizontalCenter - - Button { - text: qsTr("Disabled"); - checked: settings.postCaptureTimeout == 0; - onClicked: settings.postCaptureTimeout = 0; - } - - Button { - text: qsTr("2 seconds"); - checked: settings.postCaptureTimeout == 2; - onClicked: settings.postCaptureTimeout = 2; - } - - Button { - text: qsTr("5 seconds"); - checked: settings.postCaptureTimeout == 10; - onClicked: settings.postCaptureTimeout = 10; - } - - Button { - text: qsTr("No timeout"); - checked: settings.postCaptureTimeout == -1; - onClicked: settings.postCaptureTimeout = -1; - } - } - - SectionHeader { - text: qsTr("Creator name"); - } - - TextField { - placeholderText: qsTr("Name or copyright"); - width: parent.width - text: settings.creatorName - onTextChanged: settings.creatorName = text; - } - - Item { - width: parent.width - height: Math.max(enableCameraSoundsLabel.height, enableCameraSounds.height); - - Label { - id: enableCameraSoundsLabel - anchors.left: parent.left - text: qsTr("Enable camera sounds"); - } - - Switch { - id: enableCameraSounds - anchors.right: parent.right - // We have to do it that way because QML complains about a binding - // loop for checked if we bind the checked property to the settings value. - Component.onCompleted: checked = settings.soundEnabled; - onCheckedChanged: settings.soundEnabled = checked; - } - } - - Item { - width: parent.width - height: Math.max(useGpsLabel.height, useGps.height); - - Label { - id: useGpsLabel - anchors.left: parent.left - text: qsTr("Use GPS"); - } - - Switch { - id: useGps - anchors.right: parent.right - // We have to do it that way because QML complains about a binding - // loop for checked if we bind the checked property to the settings value. - Component.onCompleted: checked = settings.useGps; - onCheckedChanged: settings.useGps = checked; - } + property Camera camera: null + + id: col + spacing: 10 + width: parent.width + + CameraLabel { + font.pixelSize: 36 + text: qsTr("Camera settings") + width: parent.width + } + + SectionHeader { + text: qsTr("Camera") + width: parent.width + } + + CameraButtonRow { + anchors.horizontalCenter: parent.horizontalCenter + enabled: camera != null && camera.running && camera.idle + + CameraButton { + text: qsTr("Back (Primary)"); + checkable: true + checked: settings.device == 0 + onClicked: settings.device = 0 } - Item { - width: parent.width - height: Math.max(useGeotagsLabel.height, useGeotags.height); - - // TODO: transition when hiding/showing and we should scroll a bit to show it - visible: useGps.checked - - Label { - id: useGeotagsLabel - anchors.left: parent.left - text: qsTr("Use geotags"); - } - - Switch { - id: useGeotags - anchors.right: parent.right - // We have to do it that way because QML complains about a binding - // loop for checked if we bind the checked property to the settings value. - Component.onCompleted: checked = settings.useGeotags; - onCheckedChanged: settings.useGeotags = checked; - } + CameraButton { + text: qsTr("Front (Secondary)"); + checkable: true + checked: settings.device == 1 + onClicked: settings.device = 1 } + } + + CameraTextSwitch { + text: qsTr("Show grid lines") + + checked: settings.gridEnabled + onCheckedChanged: settings.gridEnabled = checked + } + + SectionHeader { + text: qsTr("Creator name") + width: parent.width + } + + CameraTextField { + placeholderText: qsTr("Name or copyright") + width: parent.width + text: settings.creatorName + onTextChanged: settings.creatorName = text + } + + CameraTextSwitch { + text: qsTr("Use zoom keys for capture") + checked: settings.zoomAsShutter + onCheckedChanged: settings.zoomAsShutter = checked + } + + CameraTextSwitch { + text: qsTr("Use proximity sensor for capture") + + checked: settings.proximityAsShutter + onCheckedChanged: settings.proximityAsShutter = checked + } + + CameraTextSwitch { + text: qsTr("Enable camera sounds") + + checked: settings.soundEnabled + onCheckedChanged: settings.soundEnabled = checked + } + + CameraTextSwitch { + text: qsTr("Preview images and videos after capturing") + visible: false + checked: settings.enablePreview + onCheckedChanged: settings.enablePreview = checked + } + + CameraTextSwitch { + id: useGps + text: qsTr("Use GPS") + + checked: settings.useGps + onCheckedChanged: settings.useGps = checked + } + + CameraTextSwitch { + // TODO: transition when hiding/showing and we should scroll a bit to show it + visible: useGps.checked + + text: qsTr("Use geotags") + checked: settings.useGeotags + onCheckedChanged: settings.useGeotags = checked + } }