[vlc-devel] [PATCH 5/7] qt: Don't load the media center view when a playback will start
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Mon Jan 6 13:38:48 CET 2020
---
.../qt/maininterface/qml/MainInterface.qml | 38 ++++++++++++++++---
1 file changed, 33 insertions(+), 5 deletions(-)
diff --git a/modules/gui/qt/maininterface/qml/MainInterface.qml b/modules/gui/qt/maininterface/qml/MainInterface.qml
index db1e3014c5..84b436ad17 100644
--- a/modules/gui/qt/maininterface/qml/MainInterface.qml
+++ b/modules/gui/qt/maininterface/qml/MainInterface.qml
@@ -33,6 +33,8 @@ import QtQuick.Window 2.11
Rectangle {
id: root
color: "transparent"
+ property bool _interfaceReady: false
+ property bool _playlistReady: false
Loader {
id: playlistWindowLoader
@@ -53,6 +55,12 @@ Rectangle {
PlaylistControllerModel {
id: mainPlaylistController
playlistPtr: mainctx.playlist
+
+ onPlaylistInitialized: {
+ root._playlistReady = true
+ if (root._interfaceReady)
+ setInitialView()
+ }
}
Component {
@@ -94,12 +102,24 @@ Rectangle {
onCurrentChanged: loadCurrentHistoryView()
}
- Component.onCompleted: {
+ function setInitialView() {
//set the initial view
- if (medialib)
- history.push(["mc", "video"], History.Go)
+ if (!mainPlaylistController.empty)
+ history.push(["player"], History.Go)
else
- history.push(["playlist"], History.Go)
+ {
+ if (medialib)
+ history.push(["mc", "video"], History.Go)
+ else
+ history.push(["playlist"], History.Go)
+ }
+ }
+
+
+ Component.onCompleted: {
+ root._interfaceReady = true;
+ if (root._playlistReady)
+ setInitialView()
}
@@ -128,7 +148,15 @@ Rectangle {
onPlayingStateChanged: {
if (player.playingState === PlayerController.PLAYING_STATE_STOPPED
&& history.current.view === "player") {
- history.previous(History.Go)
+ if (history.previousEmpty)
+ {
+ if (medialib)
+ history.push(["mc", "video"], History.Go)
+ else
+ history.push(["playlist"], History.Go)
+ }
+ else
+ history.previous(History.Go)
}
}
}
--
2.20.1
More information about the vlc-devel
mailing list