diff --git a/v2rayN/ServiceLib/Models/ConfigItems.cs b/v2rayN/ServiceLib/Models/ConfigItems.cs index b9b305bb..c7ccf2e6 100644 --- a/v2rayN/ServiceLib/Models/ConfigItems.cs +++ b/v2rayN/ServiceLib/Models/ConfigItems.cs @@ -100,6 +100,7 @@ public class UIItem public bool EnableDragDropSort { get; set; } public bool DoubleClick2Activate { get; set; } public bool AutoHideStartup { get; set; } + public bool SilentStartup { get; set; } public bool Hide2TrayWhenClose { get; set; } public bool ShowInTaskbar { get; set; } public bool MacOSShowInDock { get; set; } diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index 088f9b96..16fc1e97 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -3750,6 +3750,15 @@ namespace ServiceLib.Resx { } } + /// + /// 查找类似 Silent Startup 的本地化字符串。 + /// + public static string TbSettingsSilentStartup { + get { + return ResourceManager.GetString("TbSettingsSilentStartup", resourceCulture); + } + } + /// /// 查找类似 Turn on Sniffing 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx index 280231d8..d1537bc0 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx @@ -1,17 +1,17 @@ - @@ -1560,4 +1560,7 @@ Multi-Configuration Fallback by Xray + + آغاز سکوت + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx index 09796e2d..e2d29075 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx @@ -1,17 +1,17 @@ - @@ -1560,4 +1560,7 @@ Multi-Configuration Fallback by Xray + + Némán indítás + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index bf9f40a5..14fd8dbf 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -1,17 +1,17 @@ - @@ -1560,4 +1560,7 @@ Multi-Configuration Fallback by Xray + + Silent Startup + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx index cde36277..41cfbb40 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -1,17 +1,17 @@ - @@ -1560,4 +1560,7 @@ Multi-Configuration Fallback by Xray + + Тихий запуск + \ 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 1506de01..ca806287 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -1,17 +1,17 @@ - @@ -993,6 +993,9 @@ 更多地址 (url),用逗号 (,) 分隔;订阅转换将失效 + + {0} : {1}/s↑ | {2}/s↓ + 自动更新间隔 (分钟) @@ -1557,4 +1560,7 @@ 多配置文件故障转移 Xray + + 静默启动 + \ 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 3101cb2f..42f72578 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -1,17 +1,17 @@ - @@ -993,6 +993,9 @@ 更多位址 (url),用逗號 (,) 分隔;訂閱轉換將失效 + + {0} : {1}/s↑ | {2}/s↓ + 自動更新間隔 (分鐘) @@ -1557,4 +1560,7 @@ Multi-Configuration Fallback by Xray + + 静默启动 + \ No newline at end of file diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index 06ca3184..2fa650b8 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -578,7 +578,7 @@ public class MainWindowViewModel : MyReactiveObject private async Task AutoHideStartup() { - if (_config.UiItem.AutoHideStartup) + if (_config.UiItem.AutoHideStartup && !_config.UiItem.SilentStartup) { AppEvents.ShowHideWindowRequested.Publish(false); } diff --git a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs index 7f446cf2..4712efe4 100644 --- a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs @@ -54,6 +54,7 @@ public class OptionSettingViewModel : MyReactiveObject [Reactive] public bool EnableUpdateSubOnlyRemarksExist { get; set; } [Reactive] public bool EnableSecurityProtocolTls13 { get; set; } [Reactive] public bool AutoHideStartup { get; set; } + [Reactive] public bool SilentStartup { get; set; } [Reactive] public bool Hide2TrayWhenClose { get; set; } [Reactive] public bool EnableDragDropSort { get; set; } [Reactive] public bool DoubleClick2Activate { get; set; } @@ -172,6 +173,7 @@ public class OptionSettingViewModel : MyReactiveObject EnableUpdateSubOnlyRemarksExist = _config.UiItem.EnableUpdateSubOnlyRemarksExist; EnableSecurityProtocolTls13 = _config.GuiItem.EnableSecurityProtocolTls13; AutoHideStartup = _config.UiItem.AutoHideStartup; + SilentStartup = _config.UiItem.SilentStartup; Hide2TrayWhenClose = _config.UiItem.Hide2TrayWhenClose; EnableDragDropSort = _config.UiItem.EnableDragDropSort; DoubleClick2Activate = _config.UiItem.DoubleClick2Activate; @@ -332,6 +334,7 @@ public class OptionSettingViewModel : MyReactiveObject _config.UiItem.EnableUpdateSubOnlyRemarksExist = EnableUpdateSubOnlyRemarksExist; _config.GuiItem.EnableSecurityProtocolTls13 = EnableSecurityProtocolTls13; _config.UiItem.AutoHideStartup = AutoHideStartup; + _config.UiItem.SilentStartup = SilentStartup; _config.UiItem.Hide2TrayWhenClose = Hide2TrayWhenClose; _config.GuiItem.AutoUpdateInterval = AutoUpdateInterval; _config.UiItem.EnableDragDropSort = EnableDragDropSort; diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index 82d33833..b379107a 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -31,6 +31,11 @@ public partial class MainWindow : WindowBase _config = AppManager.Instance.Config; _manager = new WindowNotificationManager(TopLevel.GetTopLevel(this)) { MaxItems = 3, Position = NotificationPosition.TopRight }; + if (_config.UiItem.SilentStartup) + { + this.WindowState = WindowState.Minimized; + } + this.KeyDown += MainWindow_KeyDown; menuSettingsSetUWP.Click += menuSettingsSetUWP_Click; menuPromotion.Click += menuPromotion_Click; @@ -438,6 +443,10 @@ public partial class MainWindow : WindowBase protected override void OnLoaded(object? sender, RoutedEventArgs e) { base.OnLoaded(sender, e); + if (_config.UiItem.SilentStartup) + { + this.Hide(); + } RestoreUI(); } diff --git a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml index 727f96a0..750b533c 100644 --- a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml @@ -340,7 +340,7 @@ + RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"> + + + this.Bind(ViewModel, vm => 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.SilentStartup, v => v.togSilentStartup.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.Hide2TrayWhenClose, v => v.togHide2TrayWhenClose.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);