Fix TrayIcon display

pull/5829/head
2dust 2 months ago
parent fe895b1b27
commit 1f77c56eaf

@ -14,6 +14,7 @@ public partial class App : Application
public override void Initialize() public override void Initialize()
{ {
Init();
AvaloniaXamlLoader.Load(this); AvaloniaXamlLoader.Load(this);
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
@ -47,25 +48,23 @@ public partial class App : Application
//} //}
Logging.Setup(); Logging.Setup();
Init();
Logging.LoggingEnabled(_config.guiItem.enableLog); Logging.LoggingEnabled(_config.guiItem.enableLog);
Logging.SaveLog($"v2rayN start up | {Utils.GetVersion()} | {Utils.GetExePath()}"); Logging.SaveLog($"v2rayN start up | {Utils.GetVersion()} | {Utils.GetExePath()}");
Logging.SaveLog($"{Environment.OSVersion} - {(Environment.Is64BitOperatingSystem ? 64 : 32)}"); Logging.SaveLog($"{Environment.OSVersion} - {(Environment.Is64BitOperatingSystem ? 64 : 32)}");
Logging.ClearLogs(); Logging.ClearLogs();
Thread.CurrentThread.CurrentUICulture = new(_config.uiItem.currentLanguage);
} }
private void Init() private void Init()
{ {
if (ConfigHandler.LoadConfig(ref _config) != 0) if (ConfigHandler.LoadConfig(ref _config) != 0)
{ {
Logging.SaveLog($"Loading GUI configuration file is abnormal,please restart the application{Environment.NewLine}加载GUI配置文件异常,请重启应用"); //Logging.SaveLog($"Loading GUI configuration file is abnormal,please restart the application{Environment.NewLine}加载GUI配置文件异常,请重启应用");
Environment.Exit(0); Environment.Exit(0);
return; return;
} }
LazyConfig.Instance.SetConfig(_config); LazyConfig.Instance.SetConfig(_config);
Locator.CurrentMutable.RegisterLazySingleton(() => new NoticeHandler(), typeof(NoticeHandler)); Locator.CurrentMutable.RegisterLazySingleton(() => new NoticeHandler(), typeof(NoticeHandler));
Thread.CurrentThread.CurrentUICulture = new(_config.uiItem.currentLanguage);
//Under Win10 //Under Win10
if (Utils.IsWindows() && Environment.OSVersion.Version.Major < 10) if (Utils.IsWindows() && Environment.OSVersion.Version.Major < 10)

Loading…
Cancel
Save