diff --git a/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs b/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs index 2747796a..f2d29dfa 100644 --- a/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs +++ b/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs @@ -66,7 +66,6 @@ public class GUIItem public bool DisplayRealTimeSpeed { get; set; } public bool KeepOlderDedupl { get; set; } public int AutoUpdateInterval { get; set; } - public int TrayMenuServersLimit { get; set; } = 20; public bool EnableHWA { get; set; } = false; public bool EnableLog { get; set; } = true; public string? RootCertProvider { get; set; } diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index 28e71a68..c982e32d 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -4932,15 +4932,6 @@ namespace ServiceLib.Resx { } } - /// - /// 查找类似 Tray right-click menu display limit 的本地化字符串。 - /// - public static string TbSettingsTrayMenuServersLimit { - get { - return ResourceManager.GetString("TbSettingsTrayMenuServersLimit", resourceCulture); - } - } - /// /// 查找类似 Auto Route 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.az.resx b/v2rayN/ServiceLib/Resx/ResUI.az.resx index 0c547f2f..bbd35a98 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.az.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.az.resx @@ -744,9 +744,6 @@ Sistem proksisi parametrləri - - Sistem panelinin sağ klik menyusunda göstərilən elementlərin həddi - UDP-ni aktiv et diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa.resx b/v2rayN/ServiceLib/Resx/ResUI.fa.resx index d5ca4c3e..1b2068fd 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa.resx @@ -744,9 +744,6 @@ تنظیمات پراکسی سیستم - - محدودیت نمایش سرورهای منوی سینی کلیک راست - فعال سازی UDP @@ -1812,4 +1809,4 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if پوشه ریموت XDRIVE - + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.fr.resx b/v2rayN/ServiceLib/Resx/ResUI.fr.resx index ffc9065f..795c8774 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fr.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fr.resx @@ -741,9 +741,6 @@ Paramètres du proxy système - - Limite du nombre de configurations affichées dans le menu du plateau - Activer l’UDP @@ -1806,4 +1803,4 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if Dossier distant XDRIVE - + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx index a7d5301b..edb88283 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx @@ -741,9 +741,6 @@ Rendszerproxy beállítások - - Tálca jobb egérgombos menü konfigurációk megjelenítési limitje - UDP engedélyezése @@ -1809,4 +1806,4 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if XDRIVE távoli mappa - + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.id.resx b/v2rayN/ServiceLib/Resx/ResUI.id.resx index 8e661692..b3c0ee12 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.id.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.id.resx @@ -741,9 +741,6 @@ Pengaturan proxy sistem - - Batas item pada menu klik kanan tray - Aktifkan UDP @@ -1833,4 +1830,4 @@ Tindakan "Ambil sertifikat" mungkin gagal jika sertifikat self-signed digunakan Folder jarak jauh XDRIVE - + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index 5c7ec11d..5f8b0061 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -747,9 +747,6 @@ System proxy settings - - Tray right-click menu display limit - Enable UDP @@ -1974,4 +1971,4 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if XDRIVE remote folder - + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx index 79bdcf1f..8bba384e 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -747,9 +747,6 @@ Настройки системного прокси - - Лимит отображения серверов в контекстном меню трея - Включить UDP @@ -1974,4 +1971,4 @@ Удаленная папка XDRIVE - + \ 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 27c68c37..17506416 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -747,9 +747,6 @@ 系统代理设置 - - 托盘右键菜单配置展示数量限制 - 开启 UDP @@ -1966,4 +1963,4 @@ XDRIVE 远端目录 - + \ 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 b242ac75..02dcffab 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -747,9 +747,6 @@ 系統代理設定 - - 工具列右鍵選單設定展示數量限制 - 開啟 UDP @@ -1975,4 +1972,4 @@ XDRIVE 遠端目錄 - + \ No newline at end of file diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index 88181527..17c941fd 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -308,11 +308,6 @@ public partial class MainWindowViewModel : MyReactiveObject await ShowHideWindowInteraction.HandleSafe(blShow); }); - StatusBarViewModel.SetDefaultServerRequested - .AsObservable() - .ObserveOn(RxSchedulers.MainThreadScheduler) - .SubscribeAsync(async indexId => await ProfilesViewModel.SetDefaultServer(indexId)); - StatusBarViewModel.SubscriptionsUpdateRequested .AsObservable() .ObserveOn(RxSchedulers.MainThreadScheduler) diff --git a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs index b6ee9a26..b291b54d 100644 --- a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs @@ -53,7 +53,6 @@ public partial class OptionSettingViewModel : MyReactiveObject, ICloseable [Reactive] public partial bool EnableDragDropSort { get; set; } [Reactive] public partial bool DoubleClick2Activate { get; set; } [Reactive] public partial int AutoUpdateInterval { get; set; } - [Reactive] public partial int TrayMenuServersLimit { get; set; } [Reactive] public partial string CurrentFontFamily { get; set; } [Reactive] public partial int SpeedTestTimeout { get; set; } [Reactive] public partial string SpeedTestUrl { get; set; } @@ -188,7 +187,6 @@ public partial class OptionSettingViewModel : MyReactiveObject, ICloseable EnableDragDropSort = _config.UiItem.EnableDragDropSort; DoubleClick2Activate = _config.UiItem.DoubleClick2Activate; AutoUpdateInterval = _config.GuiItem.AutoUpdateInterval; - TrayMenuServersLimit = _config.GuiItem.TrayMenuServersLimit; CurrentFontFamily = _config.UiItem.CurrentFontFamily; SpeedTestTimeout = _config.SpeedTestItem.SpeedTestTimeout; SpeedTestUrl = _config.SpeedTestItem.SpeedTestUrl; @@ -368,7 +366,6 @@ public partial class OptionSettingViewModel : MyReactiveObject, ICloseable _config.GuiItem.AutoUpdateInterval = AutoUpdateInterval; _config.UiItem.EnableDragDropSort = EnableDragDropSort; _config.UiItem.DoubleClick2Activate = DoubleClick2Activate; - _config.GuiItem.TrayMenuServersLimit = TrayMenuServersLimit; _config.UiItem.CurrentFontFamily = CurrentFontFamily; _config.SpeedTestItem.SpeedTestTimeout = SpeedTestTimeout; _config.SpeedTestItem.MixedConcurrencyCount = MixedConcurrencyCount; diff --git a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs index d6f4808a..671869f0 100644 --- a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs @@ -1,5 +1,3 @@ - - namespace ServiceLib.ViewModels; public partial class StatusBarViewModel : MyReactiveObject @@ -13,7 +11,6 @@ public partial class StatusBarViewModel : MyReactiveObject private static readonly Lazy _instance = new(() => new()); public static StatusBarViewModel Instance => _instance.Value; - public EventChannel SetDefaultServerRequested { get; } = new(); public EventChannel ReloadRequested { get; } = new(); public EventChannel AddServerViaScanRequested { get; } = new(); public EventChannel AddServerViaClipboardRequested { get; } = new(); @@ -22,17 +19,9 @@ public partial class StatusBarViewModel : MyReactiveObject public BulkObservableCollection RoutingItems { get; } = []; - public BulkObservableCollection Servers { get; } = []; - [Reactive] public partial RoutingItem SelectedRouting { get; set; } - [Reactive] - public partial ComboItem SelectedServer { get; set; } - - [Reactive] - public partial bool BlServers { get; set; } - #endregion ObservableCollection public ReactiveCommand AddServerViaClipboardCmd { get; } @@ -109,7 +98,6 @@ public partial class StatusBarViewModel : MyReactiveObject { _config = ConfigTextHandler.Config; SelectedRouting = new(); - SelectedServer = new(); RunningServerToolTipText = GetRunningServerToolTipText("-"); BlSystemProxyPacVisible = Utils.IsWindows(); BlIsNonWindows = Utils.IsNonWindows(); @@ -129,10 +117,6 @@ public partial class StatusBarViewModel : MyReactiveObject .Where(y => y != null && !y.Remarks.IsNullOrEmpty()) .SubscribeAsync(async _ => await RoutingSelectedChangedAsync()); - this.WhenAnyValue(x => x.SelectedServer) - .Where(y => y != null && !y.Text.IsNullOrEmpty()) - .Subscribe(_ => ServerSelectedChanged()); - SystemProxySelected = (int)_config.SystemProxyItem.SysProxyType; this.WhenAnyValue(x => x.SystemProxySelected) .Where(y => y >= 0) @@ -264,8 +248,6 @@ public partial class StatusBarViewModel : MyReactiveObject public async Task RefreshServersBiz() { - await RefreshServersMenu(); - //display running server var running = await ConfigTextHandler.GetDefaultServer(); if (running != null) @@ -285,38 +267,6 @@ public partial class StatusBarViewModel : MyReactiveObject return Utils.IsLinux() ? Global.AppName : serverInfo; } - private async Task RefreshServersMenu() - { - var lstModel = await ConfigDbQuery.ProfileModels(_config.SubIndexId, ""); - - if (lstModel?.Count > _config.GuiItem.TrayMenuServersLimit) - { - BlServers = false; - return; - } - - var models = lstModel.Select(it => new ComboItem { ID = it.IndexId, Text = it.GetSummary() }).ToList(); - - BlServers = true; - Servers.ReplaceRange(models); - - // Update the ItemsSource before SelectedItem so a collection reset does not clear the tray selection. - SelectedServer = models.FirstOrDefault(it => it.ID == _config.IndexId) ?? new(); - } - - private void ServerSelectedChanged() - { - if (SelectedServer == null) - { - return; - } - if (SelectedServer.ID.IsNullOrEmpty()) - { - return; - } - SetDefaultServerRequested.Publish(SelectedServer.ID); - } - public async Task TestServerAvailability() { var item = await ConfigTextHandler.GetDefaultServer(); diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml index ceed94f5..697b18d7 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml @@ -950,22 +950,6 @@ HorizontalAlignment="Left" Style="{StaticResource DefTextBox}" /> - - - 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); - this.Bind(ViewModel, vm => vm.TrayMenuServersLimit, v => v.txttrayMenuServersLimit.Text).DisposeWith(disposables); 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); diff --git a/v2rayN/v2rayN/Views/StatusBarView.xaml b/v2rayN/v2rayN/Views/StatusBarView.xaml index d337c4cd..ac4a600f 100644 --- a/v2rayN/v2rayN/Views/StatusBarView.xaml +++ b/v2rayN/v2rayN/Views/StatusBarView.xaml @@ -188,20 +188,6 @@ - - - - - - - vm.BlRouting, v => v.menuRoutings.Visibility).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.BlRouting, v => v.sepRoutings.Visibility).DisposeWith(disposables); - this.OneWayBind(ViewModel, vm => vm.Servers, v => v.cmbServers.ItemsSource).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.SelectedServer, v => v.cmbServers.SelectedItem).DisposeWith(disposables); - this.OneWayBind(ViewModel, vm => vm.BlServers, v => v.cmbServers.Visibility).DisposeWith(disposables); - //tray menu this.BindCommand(ViewModel, vm => vm.AddServerViaClipboardCmd, v => v.menuAddServerViaClipboard2).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.AddServerViaScanCmd, v => v.menuAddServerViaScan2).DisposeWith(disposables);