disable mux in ui when vision is selected

This commit is contained in:
Nova 2025-07-07 00:10:19 +03:30
parent e98acff889
commit 5ff1ae8de9
3 changed files with 14 additions and 0 deletions

View File

@ -22,6 +22,8 @@ public:
bool onEnd() override; bool onEnd() override;
QComboBox* flow_;
private: private:
Ui::EditTrojanVLESS *ui; Ui::EditTrojanVLESS *ui;
std::shared_ptr<NekoGui::ProxyEntity> ent; std::shared_ptr<NekoGui::ProxyEntity> ent;

View File

@ -18,6 +18,7 @@
#include "include/global/GuiUtils.hpp" #include "include/global/GuiUtils.hpp"
#include <QInputDialog> #include <QInputDialog>
#include <QToolTip>
#define ADJUST_SIZE runOnUiThread([=] { adjustSize(); adjustPosition(mainwindow); }, this); #define ADJUST_SIZE runOnUiThread([=] { adjustSize(); adjustPosition(mainwindow); }, this);
#define LOAD_TYPE(a) ui->type->addItem(NekoGui::ProfileManager::NewProxyEntity(a)->bean->DisplayType(), a); #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); auto _innerWidget = new EditTrojanVLESS(this);
innerWidget = _innerWidget; innerWidget = _innerWidget;
innerEditor = _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") { } else if (type == "hysteria" || type == "hysteria2" || type == "tuic") {
auto _innerWidget = new EditQUIC(this); auto _innerWidget = new EditQUIC(this);
innerWidget = _innerWidget; innerWidget = _innerWidget;

View File

@ -5,6 +5,7 @@
EditTrojanVLESS::EditTrojanVLESS(QWidget *parent) : QWidget(parent), ui(new Ui::EditTrojanVLESS) { EditTrojanVLESS::EditTrojanVLESS(QWidget *parent) : QWidget(parent), ui(new Ui::EditTrojanVLESS) {
ui->setupUi(this); ui->setupUi(this);
flow_ = ui->flow;
} }
EditTrojanVLESS::~EditTrojanVLESS() { EditTrojanVLESS::~EditTrojanVLESS() {