Upload DragonRelayView.qml
This commit is contained in:
parent
9fcfe8c6c8
commit
664ce94663
1 changed files with 30 additions and 2 deletions
|
|
@ -37,6 +37,12 @@ Page {
|
|||
property int currentState: stateIdle
|
||||
property string statusText: qsTr("Not connected")
|
||||
|
||||
// Display picker state
|
||||
property bool showDisplayPicker: false
|
||||
property var pickerDisplays: []
|
||||
property string pickerHostIP: ""
|
||||
property string pickerHostName: ""
|
||||
|
||||
// ── Header bar ─────────────────────────────────────────────────────────
|
||||
|
||||
header: ToolBar {
|
||||
|
|
@ -211,8 +217,15 @@ Page {
|
|||
Button {
|
||||
text: qsTr("Stream")
|
||||
onClicked: {
|
||||
// Real call: dragonRelay.streamHost(model.hostIp, "Desktop")
|
||||
console.log("stream", model.hostIp)
|
||||
var displays = dragonRelay.displaysForHost(model.hostIp)
|
||||
if (displays && displays.length > 1) {
|
||||
root.pickerHostIP = model.hostIp
|
||||
root.pickerHostName = model.hostName
|
||||
root.pickerDisplays = displays
|
||||
root.showDisplayPicker = true
|
||||
} else {
|
||||
dragonRelay.streamHost(model.hostIp, "Desktop")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -243,4 +256,19 @@ Page {
|
|||
|
||||
Item { Layout.fillHeight: true; visible: root.currentState !== root.stateConnected }
|
||||
}
|
||||
|
||||
// ── Display Picker Modal ───────────────────────────────────────────────
|
||||
|
||||
DragonDisplayPicker {
|
||||
visible: root.showDisplayPicker
|
||||
anchors.fill: parent
|
||||
hostIP: root.pickerHostIP
|
||||
hostName: root.pickerHostName
|
||||
displays: root.pickerDisplays
|
||||
onDisplaySelected: function(idx) {
|
||||
root.showDisplayPicker = false
|
||||
dragonRelay.streamHostDisplay(root.pickerHostIP, idx)
|
||||
}
|
||||
onCancelled: { root.showDisplayPicker = false }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue