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 *****************************************************************************/
19 import QtQuick.Controls 2.4
20 import QtQml.Models 2.2
22 import org.videolan.vlc 0.1
23 import org.videolan.medialib 0.1
25 import "qrc:///utils/" as Utils
26 import "qrc:///style/"
32 height: VLCStyle.icon_normal + VLCStyle.margin_small
36 color: VLCStyle.colors.getBgColor(element.DelegateModel.inSelected, this.hovered, this.activeFocus)
40 fillMode: Image.PreserveAspectFit
43 case MLNetworkMediaModel.TYPE_DISC:
44 return "qrc:///type/disc.svg"
45 case MLNetworkMediaModel.TYPE_CARD:
46 return "qrc:///type/capture-card.svg"
47 case MLNetworkMediaModel.TYPE_STREAM:
48 return "qrc:///type/stream.svg"
49 case MLNetworkMediaModel.TYPE_PLAYLIST:
50 return "qrc:///type/playlist.svg"
51 case MLNetworkMediaModel.TYPE_FILE:
52 return "qrc:///type/file_black.svg"
54 return "qrc:///type/directory_black.svg"
58 line1: model.name || qsTr("Unknown share")
60 imageText: (model.type !== MLNetworkMediaModel.TYPE_DIRECTORY && model.type !== MLNetworkMediaModel.TYPE_NODE) ? model.protocol : ""
62 showContextButton: true