From 9df8ccc2820a4ffa8e9f34810ad715d58aef3fe8 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 17 Oct 2015 01:05:03 +0300 Subject: [PATCH] Enable navigation between BrowsePage and PlaybackPage --- remote/qml/pages/BrowsePage.qml | 41 ++++++++++++++++++++++++-------- remote/qml/pages/ConnectPage.qml | 11 ++++++++- 2 files changed, 41 insertions(+), 11 deletions(-) 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"); + } + } } -- 2.43.0