Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed Jun 4, 2023
1 parent 1b63771 commit 1e9fa7e
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 26 deletions.
1 change: 0 additions & 1 deletion go/cmd/nekoray_core/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions go/cmd/nekoray_core/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
1 change: 0 additions & 1 deletion go/grpc_server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 0 additions & 2 deletions go/grpc_server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
12 changes: 4 additions & 8 deletions translations/fa_IR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1051,10 +1051,6 @@ This needs to be run NekoBox with administrator privileges.</source>
</context>
<context>
<name>MainWindow</name>
<message>
<source>NekoRay</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Program</source>
<translation>برنامه</translation>
Expand Down Expand Up @@ -1454,10 +1450,6 @@ End: %2</source>
<source>Settings changed</source>
<translation type="unfinished">تنظیمات تغییر کرد</translation>
</message>
<message>
<source>Restart nekoray to take effect.</source>
<translation type="unfinished">برای اعمال تغییرات nekoray را مجددا راه اندازی کنید.</translation>
</message>
<message>
<source>Please run NekoBox as admin</source>
<translation type="unfinished"></translation>
Expand Down Expand Up @@ -1502,6 +1494,10 @@ End: %2</source>
<source>Test Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Restart the program to take effect.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProxyItem</name>
Expand Down
8 changes: 2 additions & 6 deletions translations/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1185,10 +1185,6 @@ This needs to be run NekoBox with administrator privileges.</source>
<source>Clear</source>
<translation>清除</translation>
</message>
<message>
<source>NekoRay</source>
<translation></translation>
</message>
<message>
<source>fake</source>
<translation></translation>
Expand Down Expand Up @@ -1450,8 +1446,8 @@ Split by line.</source>
<translation>设置改变</translation>
</message>
<message>
<source>Restart nekoray to take effect.</source>
<translation>重启 nekoray 生效。</translation>
<source>Restart the program to take effect.</source>
<translation>重启程序生效。</translation>
</message>
<message>
<source>Please run NekoBox as admin</source>
Expand Down
9 changes: 8 additions & 1 deletion ui/dialog_vpn_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
10 changes: 6 additions & 4 deletions ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ui/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</size>
</property>
<property name="windowTitle">
<string>NekoRay</string>
<string notr="true">nya</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="0,0,0">
Expand Down

0 comments on commit 1e9fa7e

Please sign in to comment.