diff --git a/include/ui/profile/edit_trojan_vless.h b/include/ui/profile/edit_trojan_vless.h index f45cca7..8031762 100644 --- a/include/ui/profile/edit_trojan_vless.h +++ b/include/ui/profile/edit_trojan_vless.h @@ -22,6 +22,8 @@ public: bool onEnd() override; + QComboBox* flow_; + private: Ui::EditTrojanVLESS *ui; std::shared_ptr ent; diff --git a/src/ui/profile/dialog_edit_profile.cpp b/src/ui/profile/dialog_edit_profile.cpp index 6bf8aa3..501232b 100644 --- a/src/ui/profile/dialog_edit_profile.cpp +++ b/src/ui/profile/dialog_edit_profile.cpp @@ -18,6 +18,7 @@ #include "include/global/GuiUtils.hpp" #include +#include #define ADJUST_SIZE runOnUiThread([=] { adjustSize(); adjustPosition(mainwindow); }, this); #define LOAD_TYPE(a) ui->type->addItem(NekoGui::ProfileManager::NewProxyEntity(a)->bean->DisplayType(), a); @@ -212,6 +213,16 @@ void DialogEditProfile::typeSelected(const QString &newType) { auto _innerWidget = new EditTrojanVLESS(this); innerWidget = _innerWidget; innerEditor = _innerWidget; + connect(_innerWidget->flow_, &QComboBox::currentTextChanged, _innerWidget, [=](const QString &txt) + { + if (txt == "xtls-rprx-vision") + { + ui->multiplex->setDisabled(true); + } else + { + ui->multiplex->setDisabled(false); + } + }); } else if (type == "hysteria" || type == "hysteria2" || type == "tuic") { auto _innerWidget = new EditQUIC(this); innerWidget = _innerWidget; diff --git a/src/ui/profile/edit_trojan_vless.cpp b/src/ui/profile/edit_trojan_vless.cpp index 29db679..c2e90d3 100644 --- a/src/ui/profile/edit_trojan_vless.cpp +++ b/src/ui/profile/edit_trojan_vless.cpp @@ -5,6 +5,7 @@ EditTrojanVLESS::EditTrojanVLESS(QWidget *parent) : QWidget(parent), ui(new Ui::EditTrojanVLESS) { ui->setupUi(this); + flow_ = ui->flow; } EditTrojanVLESS::~EditTrojanVLESS() {