X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=remote%2Fqml%2Fpages%2FBrowsePage.qml;h=2a3a123363f5c8f781bc250fcdfcddb3170110d1;hb=afa557f5c0b0debaaaf6c4c777ccc2ba10965c50;hp=cfd518b02412acdc3c82e59894538a7fb871824b;hpb=2c4dde7be7cc32b027812204b152c9f514d2e6aa;p=xinema.git diff --git a/remote/qml/pages/BrowsePage.qml b/remote/qml/pages/BrowsePage.qml index cfd518b..2a3a123 100644 --- a/remote/qml/pages/BrowsePage.qml +++ b/remote/qml/pages/BrowsePage.qml @@ -1,6 +1,8 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 +import org.nemomobile.configuration 1.0 import fi.mikkosoft.xinema 0.1 +import "../components" Page { @@ -30,6 +32,24 @@ Page { anchors.fill: parent + PullDownMenu + { + MenuItem + { + text: "Set as default location" + + onClicked: defaultLocation.value = browseDirectory.directory + } + + MenuItem + { + visible: streamControl.title + text: streamControl.title + + onClicked: pageStack.push("PlaybackPage.qml"); + } + } + header: PageHeader { title: qsTr("Browse files") @@ -73,20 +93,32 @@ Page control: xinemaControl } - Connections + Component.onCompleted: + { + if(xinemaControl.connected) + browseDirectory.directory = defaultLocation.value; + } + + StreamControl { - target: xinemaControl - onConnectedChanged: + id: streamControl + control: xinemaControl + onPlaybackStateChanged: { - if(xinemaControl.connected) - browseDirectory.directory = "/"; + if(playbackState==StreamControl.Playing && pageContainer.currentPage==page) + { + if(pageContainer.busy) + pageContainer.completeAnimation(); + pageStack.push("PlaybackPage.qml"); + } } } - Component.onCompleted: + ConfigurationValue { - if(xinemaControl.connected) - browseDirectory.directory = "/"; + id: defaultLocation + key: "/fi/mikkosoft/xinema-remote/defaultLocation" + defaultValue: "/" } }