Use replacePage() for the initial page setting to prevent having 2 video pages
authorMohammed Sameer <msameer@foolab.org>
Sun, 7 Oct 2012 15:03:34 +0000 (18:03 +0300)
committerMohammed Sameer <msameer@foolab.org>
Sun, 7 Oct 2012 15:03:34 +0000 (18:03 +0300)
qml/main.qml

index a24f4a0..81bc0b8 100644 (file)
@@ -52,11 +52,16 @@ PageStackWindow {
 
         Component.onCompleted: {
                 theme.inverted = true;
-                if (settings.mode == 0) {
-                        openFile("ImagePage.qml");
+                if (settings.mode == Camera.VideoMode) {
+                        // TODO: We will use replacePage for now.
+                        // If we use openPage() then we end up with 2 video pages
+                        // stacked on top of each other.
+                        // The first one is created when the camera mode gets
+                        // changed to video upon startup and this becomes the 2nd one.
+                        replacePage("VideoPage.qml");
                 }
                 else {
-                        openFile("VideoPage.qml");
+                        replacePage("ImagePage.qml");
                 }
         }