Commit 01abb31e authored by Benjamin Arnaud's avatar Benjamin Arnaud Committed by Pierre Lamot
Browse files

qml: Create VideoGroupsDisplay


Signed-off-by: Pierre Lamot's avatarPierre Lamot <pierre@videolabs.io>
parent ed036a2e
Pipeline #88794 passed with stage
in 17 minutes and 39 seconds
......@@ -689,6 +689,7 @@ libqt_plugin_la_QML = \
gui/qt/medialibrary/qml/VideoDisplay.qml \
gui/qt/medialibrary/qml/VideoAll.qml \
gui/qt/medialibrary/qml/VideoAllDisplay.qml \
gui/qt/medialibrary/qml/VideoGroupsDisplay.qml \
gui/qt/medialibrary/qml/PlaylistMediaList.qml \
gui/qt/medialibrary/qml/PlaylistMedia.qml \
gui/qt/medialibrary/qml/PlaylistMediaDelegate.qml \
......
......@@ -67,7 +67,11 @@ Widgets.PageLoader {
name: "all",
displayText: i18n.qtr("All"),
url: "qrc:///medialibrary/VideoAllDisplay.qml"
}, {
},{
name: "groups",
displayText: i18n.qtr("Groups"),
url: "qrc:///medialibrary/VideoGroupsDisplay.qml"
},{
name: "playlists",
displayText: i18n.qtr("Playlists"),
url: "qrc:///medialibrary/VideoPlaylistsDisplay.qml"
......
/*****************************************************************************
* Copyright (C) 2021 VLC authors and VideoLAN
*
* Authors: Benjamin Arnaud <bunjee@omega.gg>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ( at your option ) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
import QtQml.Models 2.2
import org.videolan.medialib 0.1
import "qrc:///widgets/" as Widgets
import "qrc:///style/"
Widgets.PageLoader {
id: root
//---------------------------------------------------------------------------------------------
// Aliases
//---------------------------------------------------------------------------------------------
property bool isViewMultiView: true
property variant model
property variant sortModel
//---------------------------------------------------------------------------------------------
// Settings
//---------------------------------------------------------------------------------------------
defaultPage: "all"
pageModel: [{
name: "all",
component: componentAll
}, {
name: "list",
component: componentList
}]
//---------------------------------------------------------------------------------------------
// Events
//---------------------------------------------------------------------------------------------
onCurrentItemChanged: {
model = currentItem.model;
sortModel = currentItem.sortModel;
isViewMultiView = (currentItem.isViewMultiView === undefined
||
currentItem.isViewMultiView);
}
//---------------------------------------------------------------------------------------------
// Functions
//---------------------------------------------------------------------------------------------
// Private
function _updateHistoryAll(index) {
history.update(["mc", "video", "groups", "all", { "initialIndex": index }]);
}
function _updateHistoryList(list) {
history.update(["mc", "video", "groups", "list", {
"initialIndex": list.currentIndex,
"initialId" : list.parentId,
"initialName" : list.name
}]);
}
//---------------------------------------------------------------------------------------------
// Childs
//---------------------------------------------------------------------------------------------
Component {
id: componentAll
MediaGroupList {
anchors.fill: parent
onCurrentIndexChanged: _updateHistoryAll(currentIndex)
onShowList: history.push(["mc", "video", "groups", "list",
{ parentId: model.id, name: model.name }])
}
}
Component {
id: componentList
MediaGroupDisplay {
id: list
anchors.fill: parent
onCurrentIndexChanged: _updateHistoryList(list)
onParentIdChanged : _updateHistoryList(list)
onNameChanged : _updateHistoryList(list)
}
}
}
......@@ -279,6 +279,7 @@
<file alias="VideoDisplay.qml">medialibrary/qml/VideoDisplay.qml</file>
<file alias="VideoAll.qml">medialibrary/qml/VideoAll.qml</file>
<file alias="VideoAllDisplay.qml">medialibrary/qml/VideoAllDisplay.qml</file>
<file alias="VideoGroupsDisplay.qml">medialibrary/qml/VideoGroupsDisplay.qml</file>
<file alias="PlaylistMediaList.qml">medialibrary/qml/PlaylistMediaList.qml</file>
<file alias="PlaylistMedia.qml">medialibrary/qml/PlaylistMedia.qml</file>
<file alias="PlaylistMediaDelegate.qml">medialibrary/qml/PlaylistMediaDelegate.qml</file>
......
......@@ -840,6 +840,7 @@ modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
modules/gui/qt/medialibrary/qml/VideoListDisplay.qml
modules/gui/qt/medialibrary/qml/VideoAll.qml
modules/gui/qt/medialibrary/qml/VideoAllDisplay.qml
modules/gui/qt/medialibrary/qml/VideoGroupsDisplay.qml
modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml
modules/gui/qt/medialibrary/qml/PlaylistMedia.qml
modules/gui/qt/medialibrary/qml/PlaylistMediaDelegate.qml
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment