[vlc-commits] qml: Create MediaGroupDisplay
Benjamin Arnaud
git at videolan.org
Tue Apr 20 12:49:12 UTC 2021
vlc | branch: master | Benjamin Arnaud <benjamin.arnaud at videolabs.io> | Thu Mar 25 14:59:47 2021 +0100| [ed036a2ef66036c6c99f29515b8cf0941e311ea3] | committer: Pierre Lamot
qml: Create MediaGroupDisplay
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ed036a2ef66036c6c99f29515b8cf0941e311ea3
---
modules/gui/qt/Makefile.am | 1 +
.../gui/qt/medialibrary/qml/MediaGroupDisplay.qml | 73 ++++++++++++++++++++++
modules/gui/qt/vlc.qrc | 1 +
po/POTFILES.in | 1 +
4 files changed, 76 insertions(+)
diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index a17b5ab77f..7ecf24c34b 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -671,6 +671,7 @@ libqt_plugin_la_QML = \
gui/qt/medialibrary/qml/ArtistTopBanner.qml \
gui/qt/medialibrary/qml/AudioGridItem.qml \
gui/qt/medialibrary/qml/EmptyLabel.qml \
+ gui/qt/medialibrary/qml/MediaGroupDisplay.qml \
gui/qt/medialibrary/qml/MediaGroupList.qml \
gui/qt/medialibrary/qml/MusicAlbums.qml \
gui/qt/medialibrary/qml/MusicAlbumsDisplay.qml \
diff --git a/modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml b/modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml
new file mode 100644
index 0000000000..fd49e4ea29
--- /dev/null
+++ b/modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ * Copyright (C) 2021 VLC authors and VideoLAN
+ *
+ * Authors: Benjamin Arnaud <bunjee at 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 org.videolan.medialib 0.1
+
+import "qrc:///widgets/" as Widgets
+import "qrc:///style/"
+
+VideoAll {
+ id: root
+
+ //---------------------------------------------------------------------------------------------
+ // Properties
+ //---------------------------------------------------------------------------------------------
+
+ property int initialIndex: 0
+ property var initialId
+ property string initialName
+
+ //---------------------------------------------------------------------------------------------
+ // Aliases
+ //---------------------------------------------------------------------------------------------
+
+ // NOTE: This is used to determine which media(s) shall be displayed.
+ property alias parentId: modelGroup.parentId
+
+ // NOTE: The name of the group.
+ property string name
+
+ //---------------------------------------------------------------------------------------------
+ // Childs
+ //---------------------------------------------------------------------------------------------
+
+ model: MLVideoModel {
+ id: modelGroup
+
+ ml: medialib
+
+ parentId: initialId
+ }
+
+ header: Column {
+ topPadding: VLCStyle.margin_normal
+
+ Widgets.SubtitleLabel {
+ width: root.width
+
+ leftPadding : VLCStyle.margin_xlarge
+ bottomPadding: VLCStyle.margin_xsmall
+
+ text: root.name
+ }
+ }
+}
diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc
index 8a9ea45201..bda055dc37 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -271,6 +271,7 @@
</qresource>
<qresource prefix="/medialibrary">
<file alias="EmptyLabel.qml">medialibrary/qml/EmptyLabel.qml</file>
+ <file alias="MediaGroupDisplay.qml">medialibrary/qml/MediaGroupDisplay.qml</file>
<file alias="MediaGroupList.qml">medialibrary/qml/MediaGroupList.qml</file>
<file alias="MusicAlbums.qml">medialibrary/qml/MusicAlbums.qml</file>
<file alias="MusicDisplay.qml">medialibrary/qml/MusicDisplay.qml</file>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 75528d9bb8..dc7845e457 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -818,6 +818,7 @@ modules/gui/qt/maininterface/qml/MainInterface.qml
modules/gui/qt/maininterface/qml/NoMedialibHome.qml
modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml
modules/gui/qt/medialibrary/qml/AudioGridItem.qml
+modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml
modules/gui/qt/medialibrary/qml/MediaGroupList.qml
modules/gui/qt/medialibrary/qml/MusicAlbums.qml
modules/gui/qt/medialibrary/qml/MusicAlbumsDisplay.qml
More information about the vlc-commits
mailing list