]> git.tdb.fi Git - xinema.git/blobdiff - remote/qml/pages/BrowsePage.qml
Go back to ConnectPage if connection to the server is lost
[xinema.git] / remote / qml / pages / BrowsePage.qml
index a4e1ac2ec452a68af3c633f6a6624f558d67b05c..74758a69c74e8e0ca42bb47087aa09c42fbf843a 100644 (file)
@@ -2,6 +2,7 @@ import QtQuick 2.0
 import Sailfish.Silica 1.0
 import org.nemomobile.configuration 1.0
 import fi.mikkosoft.xinema 0.1
+import "../components"
 
 Page
 {
@@ -98,13 +99,23 @@ Page
                        browseDirectory.directory = defaultLocation.value;
        }
 
+       Connections
+       {
+               target: xinemaControl
+               onConnectedChanged:
+               {
+                       if(!xinemaControl.connected)
+                               pageStack.replace("ConnectPage.qml");
+               }
+       }
+
        StreamControl
        {
                id: streamControl
                control: xinemaControl
                onPlaybackStateChanged:
                {
-                       if(playbackState==StreamControl.Playing)
+                       if(playbackState==StreamControl.Playing && pageContainer.currentPage==page)
                        {
                                if(pageContainer.busy)
                                        pageContainer.completeAnimation();