diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2019-04-18 10:43:52 +0200 |
---|---|---|
committer | Dominik Holland <dominik.holland@pelagicore.com> | 2019-05-08 13:53:35 +0000 |
commit | e257e533446bde7ca9ba9ba108a8b78fc52d58d2 (patch) | |
tree | ef5ad2cd30190b180c584e0fbbcdc93b5fe4627f /examples/ivimedia/mediaplayer/main.qml | |
parent | c5bc28dfcf81469680046387c8b3914e50c11496 (diff) |
Update the mediaplayer example
Added a 'Refresh' button to reload the content of the library. This is
useful when a new USB devices is atttached.
Also better handle the removal of a USB device and reset the File browser
view.
Change-Id: Iab16e213f9022f63ebdfacd087a8eb92a2080b9b
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'examples/ivimedia/mediaplayer/main.qml')
-rw-r--r-- | examples/ivimedia/mediaplayer/main.qml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/ivimedia/mediaplayer/main.qml b/examples/ivimedia/mediaplayer/main.qml index 7977ea6..91ccc3e 100644 --- a/examples/ivimedia/mediaplayer/main.qml +++ b/examples/ivimedia/mediaplayer/main.qml @@ -186,6 +186,7 @@ ApplicationWindow { RowLayout { Label { text: "filter:" } TextField { id: filterEdit } + Button { text: "Refresh"; onClicked: searchModel.reload(); } } ListView { @@ -281,6 +282,11 @@ ApplicationWindow { model: MediaDeviceDiscoveryModel { id: discoveryModel + + onDeviceRemoved: { + if (device === filterModel.serviceObject) + browseView.model = discoveryModel + } } SearchAndBrowseModel { |