From 18005b96e812e9e209842165155f0a43fd1c8379 Mon Sep 17 00:00:00 2001 From: fonaix Date: Mon, 4 Nov 2024 09:44:03 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=8F=8C?= =?UTF-8?q?=E5=87=BB=E8=A1=A8=E5=A4=B4=E5=BC=B9=E5=87=BA=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E7=9A=84=E9=97=AE=E9=A2=98=20(#5984)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复:日志文本框垂直显示上下空白问题 * 修复:双击表头弹出编辑窗口的问题 --- v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs index e03edc46..83a5e32a 100644 --- a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs @@ -189,6 +189,8 @@ namespace v2rayN.Desktop.Views private void LstProfiles_DoubleTapped(object? sender, Avalonia.Input.TappedEventArgs e) { + var source = e.Source as Border; + if (source == null || source.Name != "CellBorder") return; if (_config.UiItem.DoubleClick2Activate) { ViewModel?.SetDefaultServer(); From 911dc7f90e05ac4732add83ca6147df6cd0a4316 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 4 Nov 2024 10:37:44 +0800 Subject: [PATCH 2/5] Revert 9fd20ff0010bdeadd77a3c8ff9fe9f45fed9b055 --- v2rayN/ServiceLib/Services/UpdateService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2rayN/ServiceLib/Services/UpdateService.cs b/v2rayN/ServiceLib/Services/UpdateService.cs index 1a8e8d64..c0266614 100644 --- a/v2rayN/ServiceLib/Services/UpdateService.cs +++ b/v2rayN/ServiceLib/Services/UpdateService.cs @@ -228,7 +228,7 @@ namespace ServiceLib.Services } _updateFunc?.Invoke(false, "-------------------------------------------------------"); - await ConfigHandler.DedupServerList(config, id); + //await ConfigHandler.DedupServerList(config, id); } _updateFunc?.Invoke(true, $"{ResUI.MsgUpdateSubscriptionEnd}"); From 4eda3dd8fa0482399d463f3129fba2d3994f6da9 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 4 Nov 2024 10:42:42 +0800 Subject: [PATCH 3/5] Add Memo attribute to subscription group https://github.com/2dust/v2rayN/issues/5981 --- v2rayN/ServiceLib/Handler/ConfigHandler.cs | 1 + v2rayN/ServiceLib/Models/SubItem.cs | 2 ++ v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 9 ++++++ v2rayN/ServiceLib/Resx/ResUI.resx | 3 ++ v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx | 3 ++ v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx | 3 ++ .../v2rayN.Desktop/Views/SubEditWindow.axaml | 19 ++++++++++-- .../Views/SubEditWindow.axaml.cs | 1 + v2rayN/v2rayN/Views/SubEditWindow.xaml | 29 +++++++++++++++---- v2rayN/v2rayN/Views/SubEditWindow.xaml.cs | 1 + 10 files changed, 64 insertions(+), 7 deletions(-) diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs index e2cc4c45..774c6d3f 100644 --- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs @@ -1358,6 +1358,7 @@ namespace ServiceLib.Handler item.PrevProfile = subItem.PrevProfile; item.NextProfile = subItem.NextProfile; item.PreSocksPort = subItem.PreSocksPort; + item.Memo = subItem.Memo; } if (Utils.IsNullOrEmpty(item.Id)) diff --git a/v2rayN/ServiceLib/Models/SubItem.cs b/v2rayN/ServiceLib/Models/SubItem.cs index 851733bf..b6caa374 100644 --- a/v2rayN/ServiceLib/Models/SubItem.cs +++ b/v2rayN/ServiceLib/Models/SubItem.cs @@ -33,5 +33,7 @@ namespace ServiceLib.Models public string? NextProfile { get; set; } public int? PreSocksPort { get; set; } + + public string? Memo { get; set; } } } \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index 45fdab2f..26864bef 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -447,6 +447,15 @@ namespace ServiceLib.Resx { } } + /// + /// 查找类似 Remarks Memo 的本地化字符串。 + /// + public static string LvMemo { + get { + return ResourceManager.GetString("LvMemo", resourceCulture); + } + } + /// /// 查找类似 More URLs, separated by commas; Subscription conversion will be invalid 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index 2b3ea353..0ef7eaef 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -1366,4 +1366,7 @@ Are you sure to exit? + + Remarks Memo + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx index 304bb387..54951788 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -1363,4 +1363,7 @@ 是否确定退出? + + 备注备忘 + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx index 78113195..6f122426 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -1243,4 +1243,7 @@ 是否確定退出? + + 備註備忘 + \ No newline at end of file diff --git a/v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml b/v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml index c5d22cfd..bd7e01f0 100644 --- a/v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml @@ -52,6 +52,7 @@ + @@ -114,7 +115,7 @@ + + + vm.SelectedSource.PrevProfile, v => v.txtPrevProfile.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.NextProfile, v => v.txtNextProfile.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.PreSocksPort, v => v.txtPreSocksPort.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SelectedSource.Memo, v => v.txtMemo.Text).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables); }); diff --git a/v2rayN/v2rayN/Views/SubEditWindow.xaml b/v2rayN/v2rayN/Views/SubEditWindow.xaml index d6594e70..3853afd8 100644 --- a/v2rayN/v2rayN/Views/SubEditWindow.xaml +++ b/v2rayN/v2rayN/Views/SubEditWindow.xaml @@ -1,14 +1,14 @@  + @@ -165,7 +166,7 @@ + + + + diff --git a/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs b/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs index 18ff5da1..f070af78 100644 --- a/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs @@ -34,6 +34,7 @@ namespace v2rayN.Views this.Bind(ViewModel, vm => vm.SelectedSource.PrevProfile, v => v.txtPrevProfile.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.NextProfile, v => v.txtNextProfile.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.PreSocksPort, v => v.txtPreSocksPort.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SelectedSource.Memo, v => v.txtMemo.Text).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables); }); From ee57d5b8e6cfa011c5f51ae2db5f56c0426d5459 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:15:59 +0800 Subject: [PATCH 4/5] Improve checkup date --- v2rayN/ServiceLib/Handler/ConfigHandler.cs | 1 + ...CheckUpdateItem.cs => CheckUpdateModel.cs} | 2 +- v2rayN/ServiceLib/Models/Config.cs | 14 +-- v2rayN/ServiceLib/Models/ConfigItems.cs | 11 ++- .../ViewModels/CheckUpdateViewModel.cs | 93 +++++++++---------- .../ViewModels/OptionSettingViewModel.cs | 3 - .../Views/CheckUpdateView.axaml | 2 +- .../Views/CheckUpdateView.axaml.cs | 4 +- .../Views/OptionSettingWindow.axaml | 13 +-- .../Views/OptionSettingWindow.axaml.cs | 1 - v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs | 4 +- v2rayN/v2rayN/Views/OptionSettingWindow.xaml | 14 --- .../v2rayN/Views/OptionSettingWindow.xaml.cs | 1 - 13 files changed, 65 insertions(+), 98 deletions(-) rename v2rayN/ServiceLib/Models/{CheckUpdateItem.cs => CheckUpdateModel.cs} (88%) diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs index 774c6d3f..87030e41 100644 --- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs @@ -162,6 +162,7 @@ namespace ServiceLib.Handler config.ClashUIItem ??= new(); config.SystemProxyItem ??= new(); config.WebDavItem ??= new(); + config.CheckUpdateItem ??= new(); return config; } diff --git a/v2rayN/ServiceLib/Models/CheckUpdateItem.cs b/v2rayN/ServiceLib/Models/CheckUpdateModel.cs similarity index 88% rename from v2rayN/ServiceLib/Models/CheckUpdateItem.cs rename to v2rayN/ServiceLib/Models/CheckUpdateModel.cs index 4ce1c74f..03080c79 100644 --- a/v2rayN/ServiceLib/Models/CheckUpdateItem.cs +++ b/v2rayN/ServiceLib/Models/CheckUpdateModel.cs @@ -1,6 +1,6 @@ namespace ServiceLib.Models { - public class CheckUpdateItem + public class CheckUpdateModel { public bool? IsSelected { get; set; } public string? CoreType { get; set; } diff --git a/v2rayN/ServiceLib/Models/Config.cs b/v2rayN/ServiceLib/Models/Config.cs index fce57300..075f5049 100644 --- a/v2rayN/ServiceLib/Models/Config.cs +++ b/v2rayN/ServiceLib/Models/Config.cs @@ -15,15 +15,14 @@ public bool IsRunningCore(ECoreType type) { - if (type == ECoreType.Xray && RunningCoreType is ECoreType.Xray or ECoreType.v2fly or ECoreType.v2fly_v5) + switch (type) { - return true; + case ECoreType.Xray when RunningCoreType is ECoreType.Xray or ECoreType.v2fly or ECoreType.v2fly_v5: + case ECoreType.sing_box when RunningCoreType is ECoreType.sing_box or ECoreType.mihomo: + return true; + default: + return false; } - if (type == ECoreType.sing_box && RunningCoreType is ECoreType.sing_box or ECoreType.mihomo) - { - return true; - } - return false; } #endregion property @@ -46,6 +45,7 @@ public ClashUIItem ClashUIItem { get; set; } public SystemProxyItem SystemProxyItem { get; set; } public WebDavItem WebDavItem { get; set; } + public CheckUpdateItem CheckUpdateItem { get; set; } public List Inbound { get; set; } public List GlobalHotkeys { get; set; } public List CoreTypeItem { get; set; } diff --git a/v2rayN/ServiceLib/Models/ConfigItems.cs b/v2rayN/ServiceLib/Models/ConfigItems.cs index 08414081..84c9ff3f 100644 --- a/v2rayN/ServiceLib/Models/ConfigItems.cs +++ b/v2rayN/ServiceLib/Models/ConfigItems.cs @@ -80,9 +80,7 @@ public bool IgnoreGeoUpdateCore { get; set; } = true; public int AutoUpdateInterval { get; set; } - - public bool CheckPreReleaseUpdate { get; set; } = false; - + public bool EnableSecurityProtocolTls13 { get; set; } public int TrayMenuServersLimit { get; set; } = 20; @@ -245,4 +243,11 @@ public string? Password { get; set; } public string? DirName { get; set; } } + + [Serializable] + public class CheckUpdateItem + { + public bool CheckPreReleaseUpdate { get; set; } + public List? SelectedCoreTypes { get; set; } + } } \ No newline at end of file diff --git a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs index a467f746..a62c3f2a 100644 --- a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs @@ -12,10 +12,10 @@ namespace ServiceLib.ViewModels { private const string _geo = "GeoFiles"; private string _v2rayN = ECoreType.v2rayN.ToString(); - private List _lstUpdated = []; + private List _lstUpdated = []; - private IObservableCollection _checkUpdateItem = new ObservableCollectionExtended(); - public IObservableCollection CheckUpdateItems => _checkUpdateItem; + private IObservableCollection _checkUpdateModel = new ObservableCollectionExtended(); + public IObservableCollection CheckUpdateModels => _checkUpdateModel; public ReactiveCommand CheckUpdateCmd { get; } [Reactive] public bool EnableCheckPreReleaseUpdate { get; set; } @@ -29,65 +29,56 @@ namespace ServiceLib.ViewModels await CheckUpdate(); }); - EnableCheckPreReleaseUpdate = _config.GuiItem.CheckPreReleaseUpdate; + EnableCheckPreReleaseUpdate = _config.CheckUpdateItem.CheckPreReleaseUpdate; this.WhenAnyValue( x => x.EnableCheckPreReleaseUpdate, y => y == true) - .Subscribe(c => { _config.GuiItem.CheckPreReleaseUpdate = EnableCheckPreReleaseUpdate; }); + .Subscribe(c => { _config.CheckUpdateItem.CheckPreReleaseUpdate = EnableCheckPreReleaseUpdate; }); - RefreshSubItems(); + RefreshCheckUpdateItems(); } - private void RefreshSubItems() + private void RefreshCheckUpdateItems() { - _checkUpdateItem.Clear(); + _checkUpdateModel.Clear(); if (RuntimeInformation.ProcessArchitecture != Architecture.X86) { - _checkUpdateItem.Add(new CheckUpdateItem() - { - IsSelected = false, - CoreType = _v2rayN, - Remarks = ResUI.menuCheckUpdate, - }); - _checkUpdateItem.Add(new CheckUpdateItem() - { - IsSelected = true, - CoreType = ECoreType.Xray.ToString(), - Remarks = ResUI.menuCheckUpdate, - }); - _checkUpdateItem.Add(new CheckUpdateItem() - { - IsSelected = true, - CoreType = ECoreType.mihomo.ToString(), - Remarks = ResUI.menuCheckUpdate, - }); - _checkUpdateItem.Add(new CheckUpdateItem() - { - IsSelected = true, - CoreType = ECoreType.sing_box.ToString(), - Remarks = ResUI.menuCheckUpdate, - }); + _checkUpdateModel.Add(GetCheckUpdateModel(_v2rayN)); + _checkUpdateModel.Add(GetCheckUpdateModel(ECoreType.Xray.ToString())); + _checkUpdateModel.Add(GetCheckUpdateModel(ECoreType.mihomo.ToString())); + _checkUpdateModel.Add(GetCheckUpdateModel(ECoreType.sing_box.ToString())); } + _checkUpdateModel.Add(GetCheckUpdateModel(_geo)); + } - _checkUpdateItem.Add(new CheckUpdateItem() + private CheckUpdateModel GetCheckUpdateModel(string coreType) + { + return new() { - IsSelected = true, - CoreType = _geo, + IsSelected = _config.CheckUpdateItem.SelectedCoreTypes?.Contains(coreType) ?? true, + CoreType = coreType, Remarks = ResUI.menuCheckUpdate, - }); + }; + } + + private async Task SaveSelectedCoreTypes() + { + _config.CheckUpdateItem.SelectedCoreTypes = _checkUpdateModel.Where(t => t.IsSelected == true).Select(t => t.CoreType ?? "").ToList(); + await ConfigHandler.SaveConfig(_config); } private async Task CheckUpdate() { _lstUpdated.Clear(); - _lstUpdated = _checkUpdateItem.Where(x => x.IsSelected == true) - .Select(x => new CheckUpdateItem() { CoreType = x.CoreType }).ToList(); + _lstUpdated = _checkUpdateModel.Where(x => x.IsSelected == true) + .Select(x => new CheckUpdateModel() { CoreType = x.CoreType }).ToList(); + await SaveSelectedCoreTypes(); - for (var k = _checkUpdateItem.Count - 1; k >= 0; k--) + for (var k = _checkUpdateModel.Count - 1; k >= 0; k--) { - var item = _checkUpdateItem[k]; + var item = _checkUpdateModel[k]; if (item.IsSelected != true) continue; UpdateView(item.CoreType, "..."); @@ -161,23 +152,23 @@ namespace ServiceLib.ViewModels }); } - private async Task CheckUpdateCore(CheckUpdateItem item, bool preRelease) + private async Task CheckUpdateCore(CheckUpdateModel model, bool preRelease) { void _updateUI(bool success, string msg) { - UpdateView(item.CoreType, msg); + UpdateView(model.CoreType, msg); if (success) { - UpdateView(item.CoreType, ResUI.MsgUpdateV2rayCoreSuccessfullyMore); + UpdateView(model.CoreType, ResUI.MsgUpdateV2rayCoreSuccessfullyMore); - UpdatedPlusPlus(item.CoreType, msg); + UpdatedPlusPlus(model.CoreType, msg); } } - var type = (ECoreType)Enum.Parse(typeof(ECoreType), item.CoreType); + var type = (ECoreType)Enum.Parse(typeof(ECoreType), model.CoreType); await (new UpdateService()).CheckUpdateCore(type, _config, _updateUI, preRelease) .ContinueWith(t => { - UpdatedPlusPlus(item.CoreType, ""); + UpdatedPlusPlus(model.CoreType, ""); }); } @@ -291,7 +282,7 @@ namespace ServiceLib.ViewModels private void UpdateView(string coreType, string msg) { - var item = new CheckUpdateItem() + var item = new CheckUpdateModel() { CoreType = coreType, Remarks = msg, @@ -299,13 +290,13 @@ namespace ServiceLib.ViewModels _updateView?.Invoke(EViewAction.DispatcherCheckUpdate, item); } - public void UpdateViewResult(CheckUpdateItem item) + public void UpdateViewResult(CheckUpdateModel model) { - var found = _checkUpdateItem.FirstOrDefault(t => t.CoreType == item.CoreType); + var found = _checkUpdateModel.FirstOrDefault(t => t.CoreType == model.CoreType); if (found == null) return; var itemCopy = JsonUtils.DeepCopy(found); - itemCopy.Remarks = item.Remarks; - _checkUpdateItem.Replace(found, itemCopy); + itemCopy.Remarks = model.Remarks; + _checkUpdateModel.Replace(found, itemCopy); } } } \ No newline at end of file diff --git a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs index 26a78152..65369944 100644 --- a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs @@ -53,7 +53,6 @@ namespace ServiceLib.ViewModels [Reactive] public bool EnableUpdateSubOnlyRemarksExist { get; set; } [Reactive] public bool EnableSecurityProtocolTls13 { get; set; } [Reactive] public bool AutoHideStartup { get; set; } - [Reactive] public bool EnableCheckPreReleaseUpdate { get; set; } [Reactive] public bool EnableDragDropSort { get; set; } [Reactive] public bool DoubleClick2Activate { get; set; } [Reactive] public int AutoUpdateInterval { get; set; } @@ -166,7 +165,6 @@ namespace ServiceLib.ViewModels EnableUpdateSubOnlyRemarksExist = _config.UiItem.EnableUpdateSubOnlyRemarksExist; EnableSecurityProtocolTls13 = _config.GuiItem.EnableSecurityProtocolTls13; AutoHideStartup = _config.UiItem.AutoHideStartup; - EnableCheckPreReleaseUpdate = _config.GuiItem.CheckPreReleaseUpdate; EnableDragDropSort = _config.UiItem.EnableDragDropSort; DoubleClick2Activate = _config.UiItem.DoubleClick2Activate; AutoUpdateInterval = _config.GuiItem.AutoUpdateInterval; @@ -317,7 +315,6 @@ namespace ServiceLib.ViewModels _config.GuiItem.EnableSecurityProtocolTls13 = EnableSecurityProtocolTls13; _config.UiItem.AutoHideStartup = AutoHideStartup; _config.GuiItem.AutoUpdateInterval = AutoUpdateInterval; - _config.GuiItem.CheckPreReleaseUpdate = EnableCheckPreReleaseUpdate; _config.UiItem.EnableDragDropSort = EnableDragDropSort; _config.UiItem.DoubleClick2Activate = DoubleClick2Activate; _config.GuiItem.TrayMenuServersLimit = TrayMenuServersLimit; diff --git a/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml b/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml index cd6f3843..8ccd0f07 100644 --- a/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml +++ b/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml @@ -39,7 +39,7 @@ + ItemsSource="{Binding CheckUpdateModels}"> diff --git a/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml.cs index 6859b577..5395b1c3 100644 --- a/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml.cs @@ -15,7 +15,7 @@ namespace v2rayN.Desktop.Views this.WhenActivated(disposables => { - this.OneWayBind(ViewModel, vm => vm.CheckUpdateItems, v => v.lstCheckUpdates.ItemsSource).DisposeWith(disposables); + this.OneWayBind(ViewModel, vm => vm.CheckUpdateModels, v => v.lstCheckUpdates.ItemsSource).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableCheckPreReleaseUpdate, v => v.togEnableCheckPreReleaseUpdate.IsChecked).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.CheckUpdateCmd, v => v.btnCheckUpdate).DisposeWith(disposables); @@ -29,7 +29,7 @@ namespace v2rayN.Desktop.Views case EViewAction.DispatcherCheckUpdate: if (obj is null) return false; Dispatcher.UIThread.Post(() => - ViewModel?.UpdateViewResult((CheckUpdateItem)obj), + ViewModel?.UpdateViewResult((CheckUpdateModel)obj), DispatcherPriority.Default); break; diff --git a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml index 8ac6dedc..e56e6c56 100644 --- a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml @@ -489,18 +489,7 @@ HorizontalAlignment="Left" Classes="Margin8" /> - - + vm.EnableUpdateSubOnlyRemarksExist, v => v.togEnableUpdateSubOnlyRemarksExist.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableSecurityProtocolTls13, v => v.togEnableSecurityProtocolTls13.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.AutoHideStartup, v => v.togAutoHideStartup.IsChecked).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.EnableCheckPreReleaseUpdate, v => v.togEnableCheckPreReleaseUpdate.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.DoubleClick2Activate, v => v.togDoubleClick2Activate.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.AutoUpdateInterval, v => v.txtautoUpdateInterval.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.CurrentFontFamily, v => v.cmbcurrentFontFamily.SelectedValue).DisposeWith(disposables); diff --git a/v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs b/v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs index ad676092..27200ee9 100644 --- a/v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs +++ b/v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs @@ -15,7 +15,7 @@ namespace v2rayN.Views this.WhenActivated(disposables => { - this.OneWayBind(ViewModel, vm => vm.CheckUpdateItems, v => v.lstCheckUpdates.ItemsSource).DisposeWith(disposables); + this.OneWayBind(ViewModel, vm => vm.CheckUpdateModels, v => v.lstCheckUpdates.ItemsSource).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableCheckPreReleaseUpdate, v => v.togEnableCheckPreReleaseUpdate.IsChecked).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.CheckUpdateCmd, v => v.btnCheckUpdate).DisposeWith(disposables); @@ -30,7 +30,7 @@ namespace v2rayN.Views if (obj is null) return false; Application.Current?.Dispatcher.Invoke((() => { - ViewModel?.UpdateViewResult((CheckUpdateItem)obj); + ViewModel?.UpdateViewResult((CheckUpdateModel)obj); }), DispatcherPriority.Normal); break; diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml index a9e51859..61ce6d2c 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml @@ -661,20 +661,6 @@ Margin="{StaticResource Margin8}" HorizontalAlignment="Left" /> - - - vm.EnableUpdateSubOnlyRemarksExist, v => v.togEnableUpdateSubOnlyRemarksExist.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableSecurityProtocolTls13, v => v.togEnableSecurityProtocolTls13.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.AutoHideStartup, v => v.togAutoHideStartup.IsChecked).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.EnableCheckPreReleaseUpdate, v => v.togEnableCheckPreReleaseUpdate.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableDragDropSort, v => v.togEnableDragDropSort.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.DoubleClick2Activate, v => v.togDoubleClick2Activate.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.AutoUpdateInterval, v => v.txtautoUpdateInterval.Text).DisposeWith(disposables); From be13446e690fe7ce529cea18ddbe30cc916ca767 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:21:11 +0800 Subject: [PATCH 5/5] =?UTF-8?q?Speed=20=E2=80=8B=E2=80=8Btest=20address=20?= =?UTF-8?q?maintenance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2rayN/ServiceLib/Global.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2rayN/ServiceLib/Global.cs b/v2rayN/ServiceLib/Global.cs index 90f23a56..3e379136 100644 --- a/v2rayN/ServiceLib/Global.cs +++ b/v2rayN/ServiceLib/Global.cs @@ -105,9 +105,9 @@ public static readonly List SpeedTestUrls = new() { @"https://speed.cloudflare.com/__down?bytes=100000000", + @"https://speed.cloudflare.com/__down?bytes=50000000", @"https://speed.cloudflare.com/__down?bytes=10000000", - @"http://cachefly.cachefly.net/50mb.test", - @"http://cachefly.cachefly.net/10mb.test" + @"https://cachefly.cachefly.net/50mb.test", }; public static readonly List SpeedPingTestUrls = new() {