X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=remote%2Fqml%2Fpages%2FBrowsePage.qml;h=74758a69c74e8e0ca42bb47087aa09c42fbf843a;hb=6962c02f4f1b83a1367883fcdee6c54e245283fd;hp=cfd518b02412acdc3c82e59894538a7fb871824b;hpb=2c4dde7be7cc32b027812204b152c9f514d2e6aa;p=xinema.git diff --git a/remote/qml/pages/BrowsePage.qml b/remote/qml/pages/BrowsePage.qml index cfd518b..74758a6 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,42 @@ Page control: xinemaControl } + Component.onCompleted: + { + if(xinemaControl.connected) + browseDirectory.directory = defaultLocation.value; + } + Connections { target: xinemaControl onConnectedChanged: { - if(xinemaControl.connected) - browseDirectory.directory = "/"; + if(!xinemaControl.connected) + pageStack.replace("ConnectPage.qml"); } } - Component.onCompleted: + StreamControl { - if(xinemaControl.connected) - browseDirectory.directory = "/"; + id: streamControl + control: xinemaControl + onPlaybackStateChanged: + { + if(playbackState==StreamControl.Playing && pageContainer.currentPage==page) + { + if(pageContainer.busy) + pageContainer.completeAnimation(); + pageStack.push("PlaybackPage.qml"); + } + } + } + + ConfigurationValue + { + id: defaultLocation + key: "/fi/mikkosoft/xinema-remote/defaultLocation" + defaultValue: "/" } }