调整:协议统一 Moonlight,移除 RDP 选项

This commit is contained in:
宋一鸣 2026-10-29 02:55:41 -04:00
parent 487d473fc8
commit 01c2a0c336

View File

@ -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();