[vlc-commits] qml: assign drive image using new types
Abel Tesfaye
git at videolan.org
Wed Aug 21 15:09:04 CEST 2019
vlc | branch: master | Abel Tesfaye <Abeltesfaye45 at gmail.com> | Tue Aug 20 13:08:03 2019 +0300| [d79f286675ea19ee92afbaa14e0b6894cae862c6] | committer: Jean-Baptiste Kempf
qml: assign drive image using new types
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d79f286675ea19ee92afbaa14e0b6894cae862c6
---
modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml | 2 +-
.../gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml | 17 ++++++++++++++++-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml
index b570c73049..2fbc29bc34 100644
--- a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml
@@ -42,7 +42,7 @@ Utils.ListItem {
}
line1: model.name || qsTr("Unknown share")
line2: model.mrl
- imageText: model.type === MLNetworkModel.TYPE_SHARE ? model.protocol : ""
+ imageText: (model.type !== MLNetworkModel.TYPE_DIRECTORY && model.type !== MLNetworkModel.TYPE_NODE) ? model.protocol : ""
showContextButton: true
onContextMenuButtonClicked: {
diff --git a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml
index 807cc7daa4..0b756b5b1a 100644
--- a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml
+++ b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml
@@ -27,10 +27,25 @@ import "qrc:///style/"
Utils.GridItem {
id: item
+ function getImage(type){
+ switch (type){
+ case MLNetworkModel.TYPE_DISC:
+ return "qrc:///type/disc.svg"
+ case MLNetworkModel.TYPE_CARD:
+ return "qrc:///type/capture-card.svg"
+ case MLNetworkModel.TYPE_STREAM:
+ return "qrc:///type/stream.svg"
+ case MLNetworkModel.TYPE_PLAYLIST:
+ return "qrc:///type/playlist.svg"
+
+ default:
+ return "qrc:///type/directory_black.svg"
+ }
+ }
pictureWidth: VLCStyle.network_normal
pictureHeight: VLCStyle.network_normal
- image: "qrc:///type/directory_black.svg"
+ image: item.getImage(model.type)
subtitle: model.mrl
title: model.name || qsTr("Unknown share")
focus: true
More information about the vlc-commits
mailing list