X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=qml%2FVideoResolutionSettings.qml;h=aa89d1053280293ba52e7758640951db2b7e8c15;hb=8648b39e483ca7365ed0842c98046182264c88c9;hp=ebd8c3b29a4b7e5e2eddab18d3dd5b8cfc91185f;hpb=282d2b0c5826208eec6b2bebc6c1de9c7af5f004;p=harmattan%2Fcameraplus diff --git a/qml/VideoResolutionSettings.qml b/qml/VideoResolutionSettings.qml index ebd8c3b..aa89d10 100644 --- a/qml/VideoResolutionSettings.qml +++ b/qml/VideoResolutionSettings.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,37 +20,45 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -import QtQuick 1.1 -import com.nokia.meego 1.1 -import "VideoSettingsDialog.js" as Util +import QtQuick 2.0 +import QtCamera 1.0 Column { - spacing: 10 + property Camera camera: null - SectionHeader { - text: qsTr("Resolution"); - } + spacing: 10 + property string __resolution: settings.device == 1 ? + settings.secondaryVideoResolution : settings.primaryVideoResolution - ButtonRow { - width: parent.width + visible: videoSettings.resolutions.count > 1 - exclusive: false + SectionHeader { + text: qsTr("Resolution") + } - Repeater { - id: resolutions + CameraButtonRow { + width: parent.width + enabled: camera ? camera.idle : false + exclusive: false - model: videoSettings.resolutions + Repeater { + id: resolutions - function name(name, res) { - return name.charAt(0).toUpperCase() + name.slice(1) + " " + res; - } + model: videoSettings.resolutions - delegate: Button { - text: resolutions.name(resolutionName, resolution); - checked: settings.videoResolution == resolutionName; - onClicked: Util.setResolution(resolutionName); - } + delegate: CameraButton { + capitalize: true + text: qsTr("%1 %2").arg(resolutionName).arg(resolution) + checked: __resolution == resolutionName + onClicked: { + if (settings.device == 1) { + settings.secondaryVideoResolution = resolutionName + } else { + settings.primaryVideoResolution = resolutionName + } } + } } + } }