From fc52870431a229d9017cfb8f009c131c0c8b3480 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Tue, 30 Jan 2024 18:04:10 +0800 Subject: [PATCH] Add setting 4 SpeedPingTestUrl --- v2rayN/v2rayN/Global.cs | 3 ++ v2rayN/v2rayN/Mode/ConfigItems.cs | 1 - v2rayN/v2rayN/Resx/ResUI.Designer.cs | 9 ++++ v2rayN/v2rayN/Resx/ResUI.resx | 3 ++ v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx | 3 ++ v2rayN/v2rayN/Resx/ResUI.zh-Hant.resx | 3 ++ .../v2rayN/ViewModels/MainWindowViewModel.cs | 1 - .../ViewModels/OptionSettingViewModel.cs | 3 ++ v2rayN/v2rayN/Views/OptionSettingWindow.xaml | 53 ++++++++++++------- .../v2rayN/Views/OptionSettingWindow.xaml.cs | 5 ++ 10 files changed, 64 insertions(+), 20 deletions(-) diff --git a/v2rayN/v2rayN/Global.cs b/v2rayN/v2rayN/Global.cs index 52e090e4..bf449a45 100644 --- a/v2rayN/v2rayN/Global.cs +++ b/v2rayN/v2rayN/Global.cs @@ -118,6 +118,9 @@ namespace v2rayN @"http://cachefly.cachefly.net/100mb.test", @"http://cachefly.cachefly.net/10mb.test" }; + public static readonly List SpeedPingTestUrls = new() { + @"https://www.google.com/generate_204", + }; public static readonly Dictionary UserAgentTxts = new() { diff --git a/v2rayN/v2rayN/Mode/ConfigItems.cs b/v2rayN/v2rayN/Mode/ConfigItems.cs index 57068635..8c1fdafe 100644 --- a/v2rayN/v2rayN/Mode/ConfigItems.cs +++ b/v2rayN/v2rayN/Mode/ConfigItems.cs @@ -123,7 +123,6 @@ namespace v2rayN.Mode public bool doubleClick2Activate { get; set; } public bool autoHideStartup { get; set; } = true; public string mainMsgFilter { get; set; } - public bool showTrayTip { get; set; } public List mainColumnItem { get; set; } } diff --git a/v2rayN/v2rayN/Resx/ResUI.Designer.cs b/v2rayN/v2rayN/Resx/ResUI.Designer.cs index fb9e9175..1e749021 100644 --- a/v2rayN/v2rayN/Resx/ResUI.Designer.cs +++ b/v2rayN/v2rayN/Resx/ResUI.Designer.cs @@ -2851,6 +2851,15 @@ namespace v2rayN.Resx { } } + /// + /// 查找类似 Speed Ping Test Url 的本地化字符串。 + /// + public static string TbSettingsSpeedPingTestUrl { + get { + return ResourceManager.GetString("TbSettingsSpeedPingTestUrl", resourceCulture); + } + } + /// /// 查找类似 SpeedTest Single Timeout Value 的本地化字符串。 /// diff --git a/v2rayN/v2rayN/Resx/ResUI.resx b/v2rayN/v2rayN/Resx/ResUI.resx index a6ada925..8de9d591 100644 --- a/v2rayN/v2rayN/Resx/ResUI.resx +++ b/v2rayN/v2rayN/Resx/ResUI.resx @@ -1189,4 +1189,7 @@ Auto ScrollToEnd + + Speed Ping Test Url + \ No newline at end of file diff --git a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx index 079af3ea..d98faff9 100644 --- a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx @@ -1186,4 +1186,7 @@ 自动滚动到末尾 + + 真连接测试地址 + \ No newline at end of file diff --git a/v2rayN/v2rayN/Resx/ResUI.zh-Hant.resx b/v2rayN/v2rayN/Resx/ResUI.zh-Hant.resx index f2cd572c..1e40e8e7 100644 --- a/v2rayN/v2rayN/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/v2rayN/Resx/ResUI.zh-Hant.resx @@ -1159,4 +1159,7 @@ 自动滚动到末尾 + + 真連接測試地址 + \ No newline at end of file diff --git a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs index 52419d19..a0935c36 100644 --- a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs @@ -1700,7 +1700,6 @@ namespace v2rayN.ViewModels } CurrentFontSize = _config.uiItem.currentFontSize; CurrentLanguage = _config.uiItem.currentLanguage; - //BlShowTrayTip = _config.uiItem.showTrayTip; this.WhenAnyValue( x => x.ColorModeDark, diff --git a/v2rayN/v2rayN/ViewModels/OptionSettingViewModel.cs b/v2rayN/v2rayN/ViewModels/OptionSettingViewModel.cs index da871a2f..18139d8b 100644 --- a/v2rayN/v2rayN/ViewModels/OptionSettingViewModel.cs +++ b/v2rayN/v2rayN/ViewModels/OptionSettingViewModel.cs @@ -66,6 +66,7 @@ namespace v2rayN.ViewModels [Reactive] public string currentFontFamily { get; set; } [Reactive] public int SpeedTestTimeout { get; set; } [Reactive] public string SpeedTestUrl { get; set; } + [Reactive] public string SpeedPingTestUrl { get; set; } [Reactive] public bool EnableHWA { get; set; } [Reactive] public string SubConvertUrl { get; set; } @@ -159,6 +160,7 @@ namespace v2rayN.ViewModels currentFontFamily = _config.uiItem.currentFontFamily; SpeedTestTimeout = _config.speedTestItem.speedTestTimeout; SpeedTestUrl = _config.speedTestItem.speedTestUrl; + SpeedPingTestUrl = _config.speedTestItem.speedPingTestUrl; EnableHWA = _config.guiItem.enableHWA; SubConvertUrl = _config.constItem.subConvertUrl; @@ -312,6 +314,7 @@ namespace v2rayN.ViewModels _config.uiItem.currentFontFamily = currentFontFamily; _config.speedTestItem.speedTestTimeout = SpeedTestTimeout; _config.speedTestItem.speedTestUrl = SpeedTestUrl; + _config.speedTestItem.speedPingTestUrl = SpeedPingTestUrl; _config.guiItem.enableHWA = EnableHWA; _config.constItem.subConvertUrl = SubConvertUrl; diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml index e3672783..9999b282 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml @@ -482,6 +482,7 @@ + @@ -643,10 +644,24 @@ Margin="{StaticResource SettingItemMargin}" VerticalAlignment="Center" Style="{StaticResource ToolbarTextBlock}" + Text="{x:Static resx:ResUI.TbSettingsEnableHWA}" /> + + + - + + IsEditable="True" + Style="{StaticResource DefComboBox}" /> + { + cmbSpeedPingTestUrl.Items.Add(it); + }); Global.SubConvertUrls.ForEach(it => { cmbSubConvertUrl.Items.Add(it); @@ -176,6 +180,7 @@ namespace v2rayN.Views this.Bind(ViewModel, vm => vm.currentFontFamily, v => v.cmbcurrentFontFamily.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SpeedTestTimeout, v => v.cmbSpeedTestTimeout.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SpeedTestUrl, v => v.cmbSpeedTestUrl.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SpeedPingTestUrl, v => v.cmbSpeedPingTestUrl.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableHWA, v => v.togEnableHWA.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SubConvertUrl, v => v.cmbSubConvertUrl.Text).DisposeWith(disposables);