]> git.tdb.fi Git - xinema.git/commitdiff
Enable navigation between BrowsePage and PlaybackPage
authorMikko Rasa <tdb@tdb.fi>
Fri, 16 Oct 2015 22:05:03 +0000 (01:05 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 16 Oct 2015 22:05:03 +0000 (01:05 +0300)
remote/qml/pages/BrowsePage.qml
remote/qml/pages/ConnectPage.qml

index cfd518b02412acdc3c82e59894538a7fb871824b..d1b74e606b7f1b34983c78be4532b27692adeece 100644 (file)
@@ -30,6 +30,22 @@ Page
        {
                anchors.fill: parent
 
+               PullDownMenu
+               {
+                       MenuItem
+                       {
+                               text: "Set as default location"
+                       }
+
+                       MenuItem
+                       {
+                               visible: streamControl.title
+                               text: streamControl.title
+
+                               onClicked: pageStack.push("PlaybackPage.qml");
+                       }
+               }
+
                header: PageHeader
                {
                        title: qsTr("Browse files")
@@ -73,20 +89,25 @@ Page
                control: xinemaControl
        }
 
-       Connections
-       {
-               target: xinemaControl
-               onConnectedChanged:
-               {
-                       if(xinemaControl.connected)
-                               browseDirectory.directory = "/";
-               }
-       }
-
        Component.onCompleted:
        {
                if(xinemaControl.connected)
                        browseDirectory.directory = "/";
        }
+
+       StreamControl
+       {
+               id: streamControl
+               control: xinemaControl
+               onPlaybackStateChanged:
+               {
+                       if(playbackState==StreamControl.Playing)
+                       {
+                               if(pageContainer.busy)
+                                       pageContainer.completeAnimation();
+                               pageStack.push("PlaybackPage.qml");
+                       }
+               }
+       }
 }
 
index 4117cc70b47750a79fc55e18ff7159ed99a2b046..c0dfe48f38d0d9f0110605fcb86bdc27ba241fd2 100644 (file)
@@ -45,9 +45,18 @@ Page
                        {
                                discovery.active = false;
                                xinemaControl.connect(discovery.serverName);
-                               pageStack.replace("BrowsePage.qml");
                        }
                }
        }
+
+       Connections
+       {
+               target: xinemaControl
+               onConnectedChanged:
+               {
+                       if(xinemaControl.connected)
+                               pageStack.replace("BrowsePage.qml");
+               }
+       }
 }