import QtQuick 2.0
import Sailfish.Silica 1.0
+import org.nemomobile.configuration 1.0
import fi.mikkosoft.xinema 0.1
+import "../components"
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")
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: "/"
}
}