调整:协议统一 Moonlight,移除 RDP 选项
- 三张桌面默认协议全部 Moonlight(Ubuntu/麒麟装 Sunshine 后即可直连) - 设置对话框移除协议选择行,保存时固定 Moonlight - RDP 内嵌代码保留作网关备用,不再从本地配置暴露
This commit is contained in:
parent
8ee0cd2038
commit
653c4f627e
@ -43,10 +43,7 @@ DesktopSettingsDialog::DesktopSettingsDialog(std::vector<DesktopInfo> desktops,
|
|||||||
}
|
}
|
||||||
form->addRow(QStringLiteral("桌面"), comboDesktop_);
|
form->addRow(QStringLiteral("桌面"), comboDesktop_);
|
||||||
|
|
||||||
comboProtocol_ = new QComboBox(this);
|
// 协议统一 Moonlight(RDP 渲染实测差,已不提供选项;代码保留作网关备用)
|
||||||
comboProtocol_->addItem(QStringLiteral("Moonlight"), QStringLiteral("moonlight"));
|
|
||||||
comboProtocol_->addItem(QStringLiteral("RDP"), QStringLiteral("rdp"));
|
|
||||||
form->addRow(QStringLiteral("协议"), comboProtocol_);
|
|
||||||
|
|
||||||
editEndpoint_ = new QLineEdit(this);
|
editEndpoint_ = new QLineEdit(this);
|
||||||
editEndpoint_->setPlaceholderText(QStringLiteral("例如 192.168.1.70 或 VPN 隧道地址"));
|
editEndpoint_->setPlaceholderText(QStringLiteral("例如 192.168.1.70 或 VPN 隧道地址"));
|
||||||
@ -54,7 +51,7 @@ DesktopSettingsDialog::DesktopSettingsDialog(std::vector<DesktopInfo> desktops,
|
|||||||
|
|
||||||
editApp_ = new QLineEdit(this);
|
editApp_ = new QLineEdit(this);
|
||||||
editApp_->setPlaceholderText(QStringLiteral("Sunshine 应用名,通常为 Desktop"));
|
editApp_->setPlaceholderText(QStringLiteral("Sunshine 应用名,通常为 Desktop"));
|
||||||
form->addRow(QStringLiteral("应用名(Moonlight)"), editApp_);
|
form->addRow(QStringLiteral("应用名"), editApp_);
|
||||||
|
|
||||||
comboResolution_ = new QComboBox(this);
|
comboResolution_ = new QComboBox(this);
|
||||||
const char* resolutions[] = {"1920x1080", "2560x1440", "1920x1440", "3840x2160", "1280x720"};
|
const char* resolutions[] = {"1920x1080", "2560x1440", "1920x1440", "3840x2160", "1280x720"};
|
||||||
@ -106,7 +103,6 @@ void DesktopSettingsDialog::loadCurrent() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
loading_ = true;
|
loading_ = true;
|
||||||
comboProtocol_->setCurrentIndex(d.protocol == Protocol::kRdp ? 1 : 0);
|
|
||||||
editEndpoint_->setText(d.endpoint);
|
editEndpoint_->setText(d.endpoint);
|
||||||
editApp_->setText(d.app);
|
editApp_->setText(d.app);
|
||||||
int resIndex = comboResolution_->findData(
|
int resIndex = comboResolution_->findData(
|
||||||
@ -125,9 +121,7 @@ void DesktopSettingsDialog::onAccepted() {
|
|||||||
if (d.id != id) {
|
if (d.id != id) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
d.protocol = comboProtocol_->currentData().toString() == QStringLiteral("rdp")
|
d.protocol = Protocol::kMoonlight;
|
||||||
? Protocol::kRdp
|
|
||||||
: Protocol::kMoonlight;
|
|
||||||
d.endpoint = editEndpoint_->text().trimmed();
|
d.endpoint = editEndpoint_->text().trimmed();
|
||||||
d.app = editApp_->text().trimmed();
|
d.app = editApp_->text().trimmed();
|
||||||
const QString res = comboResolution_->currentData().toString();
|
const QString res = comboResolution_->currentData().toString();
|
||||||
|
|||||||
@ -39,7 +39,6 @@ private:
|
|||||||
std::vector<DesktopInfo> desktops_;
|
std::vector<DesktopInfo> desktops_;
|
||||||
|
|
||||||
QComboBox* comboDesktop_ = nullptr;
|
QComboBox* comboDesktop_ = nullptr;
|
||||||
QComboBox* comboProtocol_ = nullptr;
|
|
||||||
QLineEdit* editEndpoint_ = nullptr;
|
QLineEdit* editEndpoint_ = nullptr;
|
||||||
QLineEdit* editApp_ = nullptr;
|
QLineEdit* editApp_ = nullptr;
|
||||||
QComboBox* comboResolution_ = nullptr;
|
QComboBox* comboResolution_ = nullptr;
|
||||||
|
|||||||
@ -33,14 +33,14 @@ std::vector<DesktopInfo> defaultDesktops(const QString& migratedServer) {
|
|||||||
ubuntu.id = QStringLiteral("desk-ubuntu-01");
|
ubuntu.id = QStringLiteral("desk-ubuntu-01");
|
||||||
ubuntu.name = QStringLiteral("Ubuntu");
|
ubuntu.name = QStringLiteral("Ubuntu");
|
||||||
ubuntu.os = QStringLiteral("Ubuntu 桌面");
|
ubuntu.os = QStringLiteral("Ubuntu 桌面");
|
||||||
ubuntu.protocol = Protocol::kRdp;
|
ubuntu.protocol = Protocol::kMoonlight;
|
||||||
list.push_back(ubuntu);
|
list.push_back(ubuntu);
|
||||||
|
|
||||||
DesktopInfo kylin;
|
DesktopInfo kylin;
|
||||||
kylin.id = QStringLiteral("desk-kylin-01");
|
kylin.id = QStringLiteral("desk-kylin-01");
|
||||||
kylin.name = QStringLiteral("麒麟");
|
kylin.name = QStringLiteral("麒麟");
|
||||||
kylin.os = QStringLiteral("银河麒麟桌面");
|
kylin.os = QStringLiteral("银河麒麟桌面");
|
||||||
kylin.protocol = Protocol::kRdp;
|
kylin.protocol = Protocol::kMoonlight;
|
||||||
list.push_back(kylin);
|
list.push_back(kylin);
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
@ -51,9 +51,9 @@ DesktopInfo fromJson(const QJsonObject& obj) {
|
|||||||
d.id = obj.value(QStringLiteral("id")).toString();
|
d.id = obj.value(QStringLiteral("id")).toString();
|
||||||
d.name = obj.value(QStringLiteral("name")).toString();
|
d.name = obj.value(QStringLiteral("name")).toString();
|
||||||
d.os = obj.value(QStringLiteral("os")).toString();
|
d.os = obj.value(QStringLiteral("os")).toString();
|
||||||
d.protocol = obj.value(QStringLiteral("protocol")).toString() == QStringLiteral("rdp")
|
// 协议统一 Moonlight:RDP 渲染路径实测差(CPU 高、卷帘),本地配置不再提供
|
||||||
? Protocol::kRdp
|
// RDP 选项;RDP 代码保留作网关备用,协议字段仅在平台票据层区分。
|
||||||
: Protocol::kMoonlight;
|
d.protocol = Protocol::kMoonlight;
|
||||||
d.endpoint = obj.value(QStringLiteral("endpoint")).toString();
|
d.endpoint = obj.value(QStringLiteral("endpoint")).toString();
|
||||||
d.app = obj.value(QStringLiteral("app")).toString();
|
d.app = obj.value(QStringLiteral("app")).toString();
|
||||||
d.width = obj.value(QStringLiteral("width")).toInt(1920);
|
d.width = obj.value(QStringLiteral("width")).toInt(1920);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user