1 /*****************************************************************************
2 * Copyright (C) 2019 VLC authors and VideoLAN
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * ( at your option ) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
17 *****************************************************************************/
20 import QtQuick.Controls 2.4
21 import QtQuick.Layouts 1.3
22 import QtQml.Models 2.2
24 import org.videolan.medialib 0.1
26 import "qrc:///widgets/" as Widgets
27 import "qrc:///style/"
32 //---------------------------------------------------------------------------------------------
34 //---------------------------------------------------------------------------------------------
36 property bool isViewMultiView: true
38 property var contentModel
39 property var sortModel
41 property var tabModel: ListModel {
42 Component.onCompleted: {
43 pageModel.forEach(function(e) {
46 displayText: e.displayText
52 property Component localMenuDelegate: Widgets.LocalTabBar {
53 currentView: root.view
57 onClicked: root.loadIndex(index)
60 //---------------------------------------------------------------------------------------------
62 //---------------------------------------------------------------------------------------------
68 displayText: i18n.qtr("All"),
69 url: "qrc:///medialibrary/VideoAllDisplay.qml"
72 displayText: i18n.qtr("Playlists"),
73 url: "qrc:///medialibrary/VideoPlaylistsDisplay.qml"
77 onCurrentItemChanged: {
78 isViewMultiView = (currentItem.isViewMultiView === undefined
80 currentItem.isViewMultiView);
82 contentModel = currentItem.model;
83 sortModel = currentItem.sortModel;
86 //---------------------------------------------------------------------------------------------
88 //---------------------------------------------------------------------------------------------
90 function loadIndex(index) {
91 history.push(["mc", "video", root.pageModel[index].name]);