diff --git a/fmt/AbstractBean.cpp b/fmt/AbstractBean.cpp index e62068f..348e607 100644 --- a/fmt/AbstractBean.cpp +++ b/fmt/AbstractBean.cpp @@ -36,7 +36,7 @@ namespace NekoRay::fmt { } QString AbstractBean::DisplayTypeAndName() { - return QString(" [%1] %2").arg(DisplayType(), DisplayName()); + return QString("[%1] %2").arg(DisplayType(), DisplayName()); } void AbstractBean::ResolveDomainToIP(const std::function &onFinished) { diff --git a/go/protect_bindinterface_windows.go b/go/protect_bindinterface_windows.go index 2993023..489e37a 100644 --- a/go/protect_bindinterface_windows.go +++ b/go/protect_bindinterface_windows.go @@ -47,6 +47,7 @@ func init() { } return nil }) + updateRoutes() iphlpapi.RegisterNotifyRouteChange2(func(callerContext uintptr, row uintptr, notificationType uint32) uintptr { updateRoutes() return 0 @@ -77,10 +78,6 @@ func getBindInterfaceIndex(address string) uint32 { lock.Lock() defer lock.Unlock() - if routes == nil { - log.Println("warning: no routes info") - return 0 - } if interfaces == nil { log.Println("warning: no interfaces info") return 0 @@ -101,6 +98,11 @@ func getBindInterfaceIndex(address string) uint32 { return 0 } + if routes == nil { + log.Println("warning: no routes info") + return 0 + } + for _, route := range routes { // MIB_IPROUTE_TYPE_INDIRECT if route.ForwardType == 4 { diff --git a/libs/build_go.sh b/libs/build_go.sh index 31aedee..6327c9d 100755 --- a/libs/build_go.sh +++ b/libs/build_go.sh @@ -33,7 +33,7 @@ if [ "$GOOS" != "windows" ]; then fi #### Go ext: sing-box #### -curl -Lso sing-box.zip https://github.com/SagerNet/sing-box/releases/download/v1.1-beta2/sing-box-1.1-beta2-windows-amd64.zip +curl -Lso sing-box.zip https://github.com/SagerNet/sing-box/releases/download/v1.1-beta7/sing-box-1.1-beta7-windows-amd64.zip unzip sing-box.zip mv sing-box-*/sing-box.exe $DEST rm -rf sing-box.zip sing-box-* diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index ae790c5..6cd4fb1 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -459,7 +459,7 @@ void MainWindow::dialog_message_impl(const QString &sender, const QString &info) // 订阅完毕 refresh_proxy_list(); if (!info.contains("dingyue")) { - MessageBoxInfo("NekoRay", tr("Imported %1 profile(s)").arg(NekoRay::dataStore->imported_count)); + showLog(tr("Imported %1 profile(s)").arg(NekoRay::dataStore->imported_count)); } } else if (sender == "ExternalProcess") { if (info == "Crashed") { @@ -956,7 +956,7 @@ void MainWindow::on_menu_copy_links_triggered() { } if (links.length() == 0) return; QApplication::clipboard()->setText(links.join("\n")); - MessageBoxInfo("NekoRay", tr("Copied %1 item(s)").arg(links.length())); + showLog(tr("Copied %1 item(s)").arg(links.length())); } void MainWindow::on_menu_copy_links_nkr_triggered() { @@ -967,7 +967,7 @@ void MainWindow::on_menu_copy_links_nkr_triggered() { } if (links.length() == 0) return; QApplication::clipboard()->setText(links.join("\n")); - MessageBoxInfo("NekoRay", tr("Copied %1 item(s)").arg(links.length())); + showLog(tr("Copied %1 item(s)").arg(links.length())); } void MainWindow::on_menu_export_config_triggered() {