Upload dragonrelaybackend.cpp
This commit is contained in:
parent
2612ce2936
commit
1c9bc1e670
1 changed files with 19 additions and 0 deletions
|
|
@ -89,6 +89,7 @@ void DragonRelayBackend::disconnectRelay() {
|
|||
m_relay.deleteVPNPeer(); // fire-and-forget
|
||||
|
||||
m_hosts.clear();
|
||||
m_hostDisplays.clear();
|
||||
m_tunnelIP.clear();
|
||||
emit hostsChanged();
|
||||
emit tunnelIPChanged();
|
||||
|
|
@ -128,6 +129,19 @@ void DragonRelayBackend::streamHost(const QString &ip, const QString &app) {
|
|||
#endif
|
||||
}
|
||||
|
||||
// ── displaysForHost ───────────────────────────────────────────────────────────
|
||||
|
||||
QVariantList DragonRelayBackend::displaysForHost(const QString &hostIP) const {
|
||||
return m_hostDisplays.value(hostIP);
|
||||
}
|
||||
|
||||
// ── streamHostDisplay ─────────────────────────────────────────────────────────
|
||||
|
||||
void DragonRelayBackend::streamHostDisplay(const QString &hostIP, int displayIndex) {
|
||||
qDebug() << "Streaming host" << hostIP << "display index" << displayIndex;
|
||||
streamHost(hostIP); // Task 24 will wire actual display param
|
||||
}
|
||||
|
||||
// ── refreshHosts ─────────────────────────────────────────────────────────────
|
||||
|
||||
void DragonRelayBackend::refreshHosts() {
|
||||
|
|
@ -182,6 +196,8 @@ void DragonRelayBackend::onVPNError(const QString &err) {
|
|||
|
||||
void DragonRelayBackend::onHostsFetched(const QList<RelayHost> &hosts) {
|
||||
m_hosts.clear();
|
||||
m_hostDisplays.clear();
|
||||
|
||||
for (const auto &h : hosts) {
|
||||
QVariantMap m;
|
||||
m[QStringLiteral("name")] = h.name;
|
||||
|
|
@ -190,6 +206,9 @@ void DragonRelayBackend::onHostsFetched(const QList<RelayHost> &hosts) {
|
|||
m[QStringLiteral("online")] = true;
|
||||
m[QStringLiteral("source")] = QStringLiteral("relay");
|
||||
m_hosts.append(m);
|
||||
|
||||
// Store displays for this host
|
||||
m_hostDisplays[h.ip] = h.displays;
|
||||
}
|
||||
emit hostsChanged();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue