diff --git a/db/ConfigBuilder.cpp b/db/ConfigBuilder.cpp index 6da09d9..09005a6 100644 --- a/db/ConfigBuilder.cpp +++ b/db/ConfigBuilder.cpp @@ -622,7 +622,7 @@ namespace NekoGui { status->result->outboundStats += ent->traffic_data; // mux common - auto needMux = ent->type == "vmess" || ent->type == "trojan" || ent->type == "vless" || ent->type == "shadowsocks"; + auto needMux = ent->type == "vmess" || ent->type == "trojan" || ent->type == "vless"; needMux &= dataStore->mux_concurrency > 0; if (stream != nullptr) { @@ -637,17 +637,13 @@ namespace NekoGui { } if (stream->multiplex_status == 0) { if (!dataStore->mux_default_on) needMux = false; + } else if (stream->multiplex_status == 1) { + needMux = true; } else if (stream->multiplex_status == 2) { needMux = false; } } - if (ent->type == "shadowsocks") { - if (!IS_NEKO_BOX || outbound["udp_over_tcp"] == true || !outbound["plugin"].isNull()) { - needMux = false; - } - } - // common if (IS_NEKO_BOX) { // apply domain_strategy diff --git a/translations/fa_IR.ts b/translations/fa_IR.ts index 6b4607d..cc0d9cb 100644 --- a/translations/fa_IR.ts +++ b/translations/fa_IR.ts @@ -1474,6 +1474,10 @@ End: %2 Failed to stop, please restart the program. + + Select mode, double-click or press Enter to select a profile, press ESC to exit. + + ProxyItem diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts index 63ae7b0..b8e2ba8 100644 --- a/translations/zh_CN.ts +++ b/translations/zh_CN.ts @@ -1481,6 +1481,10 @@ Split by line. If there is no response for a long time, it is recommended to restart the software. 如果长时间没有反应,建议重启软件。 + + Select mode, double-click or press Enter to select a profile, press ESC to exit. + 选择模式,双击或按回车键选择一个配置文件,按ESC键退出。 + ProxyItem diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index a92efa3..0ec5050 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -67,6 +67,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi // Setup misc UI themeManager->ApplyTheme(NekoGui::dataStore->theme); ui->setupUi(this); + // connect(ui->menu_start, &QAction::triggered, this, [=]() { neko_start(); }); connect(ui->menu_stop, &QAction::triggered, this, [=]() { neko_stop(); }); connect(ui->tabWidget->tabBar(), &QTabBar::tabMoved, this, [=](int from, int to) { @@ -79,7 +80,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi }); ui->label_running->installEventFilter(this); ui->label_inbound->installEventFilter(this); + ui->splitter->installEventFilter(this); + // RegisterHotkey(false); + // auto last_size = NekoGui::dataStore->mw_size.split("x"); if (last_size.length() == 2) { auto w = last_size[0].toInt(); @@ -827,7 +831,12 @@ void MainWindow::refresh_status(const QString &traffic_update) { // ui->checkBox_VPN->setChecked(NekoGui::dataStore->spmode_vpn); ui->checkBox_SystemProxy->setChecked(NekoGui::dataStore->spmode_system_proxy); - if (select_mode) ui->label_running->setText("[" + tr("Select") + "]"); + if (select_mode) { + ui->label_running->setText(tr("Select") + " *"); + ui->label_running->setToolTip(tr("Select mode, double-click or press Enter to select a profile, press ESC to exit.")); + } else { + ui->label_running->setToolTip({}); + } auto make_title = [=](bool isTray) { QStringList tt; @@ -1011,27 +1020,31 @@ void MainWindow::refresh_proxy_list_impl_refresh_data(const int &id) { auto profile = NekoGui::profileManager->GetProfile(profileId); if (profile == nullptr) continue; + auto isRunning = profileId == NekoGui::dataStore->started_id; auto f0 = std::make_unique(); f0->setData(114514, profileId); // Check state auto check = f0->clone(); - check->setText(profileId == NekoGui::dataStore->started_id ? "✓" : Int2String(row + 1)); + check->setText(isRunning ? "✓" : Int2String(row + 1)); ui->proxyListTable->setVerticalHeaderItem(row, check); // C0: Type auto f = f0->clone(); f->setText(profile->bean->DisplayType()); + if (isRunning) f->setForeground(palette().link()); ui->proxyListTable->setItem(row, 0, f); // C1: Address+Port f = f0->clone(); f->setText(profile->bean->DisplayAddress()); + if (isRunning) f->setForeground(palette().link()); ui->proxyListTable->setItem(row, 1, f); // C2: Name f = f0->clone(); f->setText(profile->bean->name); + if (isRunning) f->setForeground(palette().link()); ui->proxyListTable->setItem(row, 2, f); // C3: Test Result @@ -1612,6 +1625,11 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) { on_menu_basic_settings_triggered(); return true; } + } else if (event->type() == QEvent::MouseButtonDblClick) { + if (obj == ui->splitter) { + auto size = ui->splitter->size(); + ui->splitter->setSizes({size.height() / 2, size.height() / 2}); + } } return QMainWindow::eventFilter(obj, event); } diff --git a/ui/mainwindow_grpc.cpp b/ui/mainwindow_grpc.cpp index 03b03fa..fa1a1e0 100644 --- a/ui/mainwindow_grpc.cpp +++ b/ui/mainwindow_grpc.cpp @@ -278,6 +278,7 @@ void MainWindow::neko_start(int _id) { } if (!mu_stopping.tryLock()) { MessageBoxWarning(software_name, "Another profile is stopping..."); + mu_starting.unlock(); mu_stopping.unlock(); return; }