Added indicators for video and image resolutions
authorMohammed Sameer <msameer@foolab.org>
Sat, 22 Sep 2012 23:07:56 +0000 (02:07 +0300)
committerMohammed Sameer <msameer@foolab.org>
Sat, 22 Sep 2012 23:07:56 +0000 (02:07 +0300)
qml/ImagePage.qml
qml/VideoPage.qml
qml/data.js
qml/main.qml

index 24f40b8..b19d771 100644 (file)
@@ -115,7 +115,7 @@ CameraPage {
 
                         Indicator {
                                 id: resolutionIndicator
-                                // TODO:
+                                source: "image://theme/" + Data.imageIcon(settings.imageAspectRatio, settings.imageResolution);
                         }
 
                         Indicator {
index 5d91b9c..b6b93be 100644 (file)
@@ -168,7 +168,7 @@ CameraPage {
 
                         Indicator {
                                 id: resolutionIndicator
-                                // TODO:
+                                source: "image://theme/" + Data.videoIcon(settings.videoResolution);
                         }
 
                         Indicator {
index d1723ff..58b2c8a 100644 (file)
@@ -85,6 +85,24 @@ var __iso = [
     [800, "icon-m-camera-iso-800"]
 ];
 
+var __image = [
+    ["3:2", "low", "icon-m-camera-resolution-3m"],
+    ["3:2", "medium", "icon-m-camera-resolution-6m"],
+    ["3:2", "high", "icon-m-camera-resolution-7m"],
+    ["4:3", "low", "icon-m-camera-resolution-3m"],
+    ["4:3", "medium", "icon-m-camera-resolution-6m"],
+    ["4:3", "high", "icon-m-camera-resolution-8m"],
+    ["16:9", "low", "icon-m-camera-resolution-3m"],
+    ["16:9", "medium", "icon-m-camera-resolution-6m"],
+    ["16:9", "high", "icon-m-camera-resolution-7m"]
+];
+
+var __video = [
+    ["low", "icon-m-camera-video-low-resolution"],
+    ["medium", "icon-m-camera-video-fine-resolution"],
+    ["high", "icon-m-camera-video-high-resolution"],
+];
+
 function filterData(val, data, item) {
     var x = 0;
     var i = data.length;
@@ -154,3 +172,19 @@ function isoIcon(value) {
 
     return "";
 }
+
+function imageIcon(aspect, res) {
+    var x = 0;
+    var len = __image.length;
+    for (x = 0; x < len; x++) {
+       if (__image[x][0] == aspect && __image[x][1] == res) {
+           return __image[x][2];
+       }
+    }
+
+    return "";
+}
+
+function videoIcon(res) {
+    return filterData(res, __video, 1);
+}
index c0a3067..27c686f 100644 (file)
@@ -28,7 +28,6 @@ import CameraPlus 1.0
 import QtMobility.systeminfo 1.2
 import QtMobility.location 1.2
 
-// TODO: resolutions and aspect ratios
 // TODO: postcapture
 // TODO: battery low state
 // TODO: disk space