[vlc-devel] [PATCH 06/10] qml: add addressbar in services tab
Prince Gupta
guptaprince8832 at gmail.com
Fri Nov 20 18:29:39 CET 2020
---
.../gui/qt/network/qml/DiscoverDisplay.qml | 1 +
.../qt/network/qml/ServicesHomeDisplay.qml | 31 +++++++++++++++++--
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt/network/qml/DiscoverDisplay.qml b/modules/gui/qt/network/qml/DiscoverDisplay.qml
index 49b0f21f24..8d7543c007 100644
--- a/modules/gui/qt/network/qml/DiscoverDisplay.qml
+++ b/modules/gui/qt/network/qml/DiscoverDisplay.qml
@@ -49,6 +49,7 @@ Widgets.PageLoader {
onCurrentItemChanged: {
sortModel = currentItem.sortModel
contentModel = currentItem.model
+ localMenuDelegate = !!currentItem.localMenuDelegate ? currentItem.localMenuDelegate : menuDelegate
}
diff --git a/modules/gui/qt/network/qml/ServicesHomeDisplay.qml b/modules/gui/qt/network/qml/ServicesHomeDisplay.qml
index 3ee2bbab1a..89de1f6104 100644
--- a/modules/gui/qt/network/qml/ServicesHomeDisplay.qml
+++ b/modules/gui/qt/network/qml/ServicesHomeDisplay.qml
@@ -32,6 +32,7 @@ Widgets.PageLoader {
property var sortModel
property var model
+ property Component localMenuDelegate: null
defaultPage: "all"
pageModel: [{
@@ -51,6 +52,7 @@ Widgets.PageLoader {
onCurrentItemChanged: {
sortModel = currentItem.sortModel
model = currentItem.model
+ localMenuDelegate = !!currentItem.addressBar ? currentItem.addressBar : null
}
Component {
@@ -58,12 +60,20 @@ Widgets.PageLoader {
NetworkBrowseDisplay {
property alias source_name: deviceModel.source_name
+ property Component addressBar: NetworkAddressbar {
+ path: [{display: deviceModel.name, tree: {}}]
+
+ onHomeButtonClicked: history.push(["mc", "discover", "services"])
+
+ function changeTree(new_tree) {
+ }
+ }
providerModel: deviceModel
contextMenu: contextMenu
function changeTree(new_tree) {
- history.push(["mc", "discover", "services", "source_browse", { tree: new_tree }]);
+ history.push(["mc", "discover", "services", "source_browse", { tree: new_tree, "root_name": deviceModel.name, "source_name": source_name }]);
}
NetworkDeviceModel {
@@ -87,9 +97,26 @@ Widgets.PageLoader {
providerModel: mediaModel
contextMenu: contextMenu
+ property string root_name
+ property string source_name
+ property Component addressBar: NetworkAddressbar {
+ path: {
+ var _path = mediaModel.path
+ _path.unshift({display: root_name, tree: {"source_name": source_name, "isRoot": true}})
+ return _path
+ }
+
+ onHomeButtonClicked: history.push(["mc", "discover", "services"])
+ function changeTree(new_tree) {
+ if (!!new_tree.isRoot)
+ history.push(["mc", "discover", "services", "source_root", { source_name: new_tree.source_name }])
+ else
+ history.push(["mc", "discover", "services", "source_browse", { tree: new_tree, "root": root_name }]);
+ }
+ }
function changeTree(new_tree) {
- history.push(["mc", "discover", "services", "source_browse", { tree: new_tree }]);
+ history.push(["mc", "discover", "services", "source_browse", { tree: new_tree, "root": root_name }]);
}
NetworkMediaModel {
--
2.25.1
More information about the vlc-devel
mailing list