From: Mikko Rasa Date: Fri, 16 Oct 2015 22:05:03 +0000 (+0300) Subject: Enable navigation between BrowsePage and PlaybackPage X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=9df8ccc2820a4ffa8e9f34810ad715d58aef3fe8;p=xinema.git Enable navigation between BrowsePage and PlaybackPage --- diff --git a/remote/qml/pages/BrowsePage.qml b/remote/qml/pages/BrowsePage.qml index cfd518b..d1b74e6 100644 --- a/remote/qml/pages/BrowsePage.qml +++ b/remote/qml/pages/BrowsePage.qml @@ -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"); + } + } + } } diff --git a/remote/qml/pages/ConnectPage.qml b/remote/qml/pages/ConnectPage.qml index 4117cc7..c0dfe48 100644 --- a/remote/qml/pages/ConnectPage.qml +++ b/remote/qml/pages/ConnectPage.qml @@ -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"); + } + } }