Replace the topmost rectangle with a ToolBar and show creation time
authorMohammed Sameer <msameer@foolab.org>
Wed, 12 Dec 2012 15:41:45 +0000 (17:41 +0200)
committerMohammed Sameer <msameer@foolab.org>
Wed, 12 Dec 2012 15:41:45 +0000 (17:41 +0200)
qml/PostCaptureItem.qml
qml/PostCapturePage.qml

index 7d3c97b..b96eef5 100644 (file)
@@ -33,6 +33,7 @@ Item {
         onIsCurrentItemChanged: page.currentItem = item;
 
         property string fileName: filename
+        property string creationDate: created
 
         function startPlayback() {
                 openFileNow("VideoPlayerPage.qml");
index 95ea955..75133c6 100644 (file)
@@ -30,7 +30,6 @@ import CameraPlus 1.0
 // Most of the ideas (and some code) for loading and displaying images are stolen from
 // N9QmlPhotoPicker https://github.com/petrumotrescu/N9QmlPhotoPicker
 
-// TODO: this is really basic.
 // TODO: Seems losing resources in post capture will not be recovered from.
 
 CameraPage {
@@ -42,6 +41,13 @@ CameraPage {
 
         property Item currentItem: null
 
+        function parseDate(str) {
+                var parts = str.split('T');
+                var dates = parts[0].split('-');
+                var times = parts[1].split(':');
+                return new Date(dates[0], dates[1], dates[2], times[0], times[1], times[2]);
+        }
+
         Rectangle {
                 color: "black"
                 anchors.fill: parent
@@ -76,7 +82,8 @@ CameraPage {
 
                                 function checkStatus(status) {
                                         if (status == SparqlConnection.Error) {
-                                                console.log("Error = "+connection.errorString());
+                                                // TODO: report error
+                                                console.log("Error = " + connection.errorString());
                                         }
                                 }
                         }
@@ -98,27 +105,29 @@ CameraPage {
                 }
         }
 
-        Rectangle {
-                // TODO: transitions
-                id: rect
-                anchors.top: parent.top
-                height: toolBar.height
-                width: parent.width
-                color: "black"
+        ToolBar {
                 opacity: toolBar.opacity
+                anchors.top: parent.top
                 visible: toolBar.visible
 
-                Row {
-                        anchors.fill: parent
-                        anchors.leftMargin: 10
-
+                tools: ToolBarLayout {
                         Label {
+                                id: filename
                                 text: currentItem ? currentItem.fileName : ""
+                                anchors.top: parent.top
+                                anchors.bottom: parent.bottom
+                                anchors.left: parent.left
+                                font.bold: true
                                 verticalAlignment: Text.AlignVCenter
                         }
 
                         Label {
-
+                                text: currentItem ? Qt.formatDateTime(parseDate(currentItem.creationDate)) : ""
+                                font.bold: true
+                                anchors.top: parent.top
+                                anchors.bottom: parent.bottom
+                                anchors.right: parent.right
+                                verticalAlignment: Text.AlignVCenter
                         }
                 }
         }