b5367067c1f2ccb765d6ee115650064ce320a5eb
[harmattan/cameraplus] / qml / VideoSettingsDialog.qml
1 // -*- qml -*-
2
3 /*!
4  * This file is part of CameraPlus.
5  *
6  * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21  */
22
23 import QtQuick 1.1
24 import com.nokia.meego 1.1
25 import QtCamera 1.0
26
27 Dialog {
28         id: dialog
29
30         content: item
31
32         Connections {
33                 target: Qt.application
34                 onActiveChanged: {
35                         if (!Qt.application.active) {
36                                 dialog.close();
37                         }
38                 }
39         }
40
41         onStatusChanged: {
42                 if (status == DialogStatus.Open) {
43                         cam.renderingEnabled = false;
44                 }
45                 else if (status == DialogStatus.Closing) {
46                         cam.renderingEnabled = true;
47                 }
48         }
49
50         Item {
51                 id: item
52                 width: parent.width
53                 height: root.height
54
55
56                 Flickable {
57                         id: flickable
58                         anchors.fill: parent
59                         anchors.margins: 10
60                         contentHeight: col.height
61
62                         Column {
63                                 id: col
64
65                                 width: parent.width
66                                 spacing: 10
67
68                                 Label {
69                                         font.pixelSize: 36
70                                         text: qsTr("Video settings");
71                                 }
72
73                                 VideoResolutionSettings {
74                                         width: parent.width
75                                 }
76
77                                 CameraSettings {
78                                         anchors.horizontalCenter: parent.horizontalCenter
79                                 }
80                         }
81                 }
82         }
83 }