From 1e9fa7eab43fd7271999ad09aee3d58c685f3116 Mon Sep 17 00:00:00 2001
From: arm64v8a <48624112+arm64v8a@users.noreply.github.com>
Date: Sun, 4 Jun 2023 11:33:47 +0900
Subject: [PATCH] fix
---
go/cmd/nekoray_core/go.mod | 1 -
go/cmd/nekoray_core/go.sum | 2 --
go/grpc_server/go.mod | 1 -
go/grpc_server/go.sum | 2 --
translations/fa_IR.ts | 12 ++++--------
translations/zh_CN.ts | 8 ++------
ui/dialog_vpn_settings.cpp | 9 ++++++++-
ui/mainwindow.cpp | 10 ++++++----
ui/mainwindow.ui | 2 +-
9 files changed, 21 insertions(+), 26 deletions(-)
diff --git a/go/cmd/nekoray_core/go.mod b/go/cmd/nekoray_core/go.mod
index 5288d8a1d..7c74eb4e7 100644
--- a/go/cmd/nekoray_core/go.mod
+++ b/go/cmd/nekoray_core/go.mod
@@ -67,7 +67,6 @@ require (
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
- golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.2.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
diff --git a/go/cmd/nekoray_core/go.sum b/go/cmd/nekoray_core/go.sum
index 0f9fd1039..5f7b49173 100644
--- a/go/cmd/nekoray_core/go.sum
+++ b/go/cmd/nekoray_core/go.sum
@@ -572,8 +572,6 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
-golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
diff --git a/go/grpc_server/go.mod b/go/grpc_server/go.mod
index 2b4e2d09d..2e7a85e19 100644
--- a/go/grpc_server/go.mod
+++ b/go/grpc_server/go.mod
@@ -5,7 +5,6 @@ go 1.19
require (
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/matsuridayo/libneko v1.0.0 // replaced
- golang.org/x/time v0.3.0
google.golang.org/grpc v1.49.0
google.golang.org/protobuf v1.28.1
)
diff --git a/go/grpc_server/go.sum b/go/grpc_server/go.sum
index c37689858..6140d8804 100644
--- a/go/grpc_server/go.sum
+++ b/go/grpc_server/go.sum
@@ -124,8 +124,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
-golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
diff --git a/translations/fa_IR.ts b/translations/fa_IR.ts
index 04f568c40..be49b4216 100644
--- a/translations/fa_IR.ts
+++ b/translations/fa_IR.ts
@@ -1051,10 +1051,6 @@ This needs to be run NekoBox with administrator privileges.
MainWindow
-
-
-
-
برنامه
@@ -1454,10 +1450,6 @@ End: %2
تنظیمات تغییر کرد
-
-
- برای اعمال تغییرات nekoray را مجددا راه اندازی کنید.
-
@@ -1502,6 +1494,10 @@ End: %2
+
+
+
+
ProxyItem
diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts
index f2994e32b..16efe9687 100644
--- a/translations/zh_CN.ts
+++ b/translations/zh_CN.ts
@@ -1185,10 +1185,6 @@ This needs to be run NekoBox with administrator privileges.
清除
-
-
-
-
@@ -1450,8 +1446,8 @@ Split by line.
设置改变
-
- 重启 nekoray 生效。
+
+ 重启程序生效。
diff --git a/ui/dialog_vpn_settings.cpp b/ui/dialog_vpn_settings.cpp
index 81432918c..ec193f8cd 100644
--- a/ui/dialog_vpn_settings.cpp
+++ b/ui/dialog_vpn_settings.cpp
@@ -55,12 +55,19 @@ void DialogVPNSettings::accept() {
NekoGui::dataStore->vpn_hide_console = ui->hide_console->isChecked();
NekoGui::dataStore->vpn_strict_route = ui->strict_route->isChecked();
NekoGui::dataStore->vpn_rule_white = ui->whitelist_mode->isChecked();
+ bool isInternalChanged = NekoGui::dataStore->vpn_internal_tun != ui->single_core->isChecked();
NekoGui::dataStore->vpn_internal_tun = ui->single_core->isChecked();
//
D_SAVE_STRING_PLAIN(vpn_rule_cidr)
D_SAVE_STRING_PLAIN(vpn_rule_process)
//
- MW_dialog_message("", "UpdateDataStore,VPNChanged");
+ QStringList msg{"UpdateDataStore"};
+ if (isInternalChanged) {
+ msg << "NeedRestart";
+ } else {
+ msg << "VPNChanged";
+ }
+ MW_dialog_message("", msg.join(","));
QDialog::accept();
}
diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp
index 845299059..5664988ce 100644
--- a/ui/mainwindow.cpp
+++ b/ui/mainwindow.cpp
@@ -541,7 +541,7 @@ void MainWindow::dialog_message_impl(const QString &sender, const QString &info)
refresh_status();
}
if (info.contains("NeedRestart")) {
- auto n = QMessageBox::warning(GetMessageBoxParent(), tr("Settings changed"), tr("Restart nekoray to take effect."), QMessageBox::Yes | QMessageBox::No);
+ auto n = QMessageBox::warning(GetMessageBoxParent(), tr("Settings changed"), tr("Restart the program to take effect."), QMessageBox::Yes | QMessageBox::No);
if (n == QMessageBox::Yes) {
this->exit_reason = 2;
on_menu_exit_triggered();
@@ -795,7 +795,7 @@ void MainWindow::neko_set_spmode_vpn(bool enable, bool save) {
NekoGui::dataStore->spmode_vpn = enable;
refresh_status();
- if (NekoGui::dataStore->started_id >= 0) neko_start(NekoGui::dataStore->started_id);
+ if (IS_NEKO_BOX_INTERNAL_TUN && NekoGui::dataStore->started_id >= 0) neko_start(NekoGui::dataStore->started_id);
}
void MainWindow::refresh_status(const QString &traffic_update) {
@@ -1107,8 +1107,10 @@ void MainWindow::on_menu_move_triggered() {
if (ents.isEmpty()) return;
auto items = QStringList{};
- for (auto &&group: NekoGui::profileManager->groups) {
- items += Int2String(group->id) + " " + group->name;
+ for (auto gid: NekoGui::profileManager->_groups) {
+ auto group = NekoGui::profileManager->GetGroup(gid);
+ if (group == nullptr) continue;
+ items += Int2String(gid) + " " + group->name;
}
bool ok;
diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui
index 6196df771..317f89aab 100644
--- a/ui/mainwindow.ui
+++ b/ui/mainwindow.ui
@@ -17,7 +17,7 @@
- NekoRay
+ nya