From c3c393c2f1c4571fe6a96b284a5f8668f777d0d6 Mon Sep 17 00:00:00 2001 From: WeeXnes Date: Fri, 29 Apr 2022 23:08:21 +0200 Subject: [PATCH] fixed crashing --- WeeXnes/Core/Globals.cs | 1 + WeeXnes/MVVM/View/DiscordRpcView.xaml.cs | 4 ++++ WeeXnes/MVVM/View/KeyManagerView.xaml.cs | 4 ++++ WeeXnes/MVVM/View/SettingView.xaml.cs | 10 ++++++---- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/WeeXnes/Core/Globals.cs b/WeeXnes/Core/Globals.cs index 2234c4a..e7f7364 100644 --- a/WeeXnes/Core/Globals.cs +++ b/WeeXnes/Core/Globals.cs @@ -72,6 +72,7 @@ namespace WeeXnes.Core } + Globals.settings_RpcShowElapsedTime.Value = Convert.ToBoolean(SettingsFile.GetValue("rpc", "RpcShowElapsedTime")); Globals.settings_RpcItemsPath_Bool.Value = Convert.ToBoolean(SettingsFile.GetValue("rpc", "RpcItemsPath_Bool")); if (Globals.settings_RpcItemsPath_Bool.Value) diff --git a/WeeXnes/MVVM/View/DiscordRpcView.xaml.cs b/WeeXnes/MVVM/View/DiscordRpcView.xaml.cs index 65bcf18..ff7e644 100644 --- a/WeeXnes/MVVM/View/DiscordRpcView.xaml.cs +++ b/WeeXnes/MVVM/View/DiscordRpcView.xaml.cs @@ -51,6 +51,10 @@ namespace WeeXnes.MVVM.View public void CheckFolders() { + if (!Globals.settings_RpcItemsPath_Bool.Value) + { + Globals.settings_RpcItemsPath.Value = Globals.settings_RpcItemsPath_Default; + } if (!Directory.Exists(Globals.settings_RpcItemsPath.Value)) { Directory.CreateDirectory(Globals.settings_RpcItemsPath.Value); diff --git a/WeeXnes/MVVM/View/KeyManagerView.xaml.cs b/WeeXnes/MVVM/View/KeyManagerView.xaml.cs index 1601e58..0692e36 100644 --- a/WeeXnes/MVVM/View/KeyManagerView.xaml.cs +++ b/WeeXnes/MVVM/View/KeyManagerView.xaml.cs @@ -149,6 +149,10 @@ namespace WeeXnes.MVVM.View private void CheckForFolders() { + if (!Globals.settings_KeyManagerItemsPath_Bool.Value) + { + Globals.settings_KeyManagerItemsPath.Value = Globals.settings_KeyManagerItemsPath_Default; + } if (!Directory.Exists(Globals.AppDataPath)) { Directory.CreateDirectory(Globals.AppDataPath); diff --git a/WeeXnes/MVVM/View/SettingView.xaml.cs b/WeeXnes/MVVM/View/SettingView.xaml.cs index c126f97..4853cd5 100644 --- a/WeeXnes/MVVM/View/SettingView.xaml.cs +++ b/WeeXnes/MVVM/View/SettingView.xaml.cs @@ -44,7 +44,7 @@ namespace WeeXnes.MVVM.View } else { - RpcPathLabel.Content = "Default"; + RpcPathLabel.Content = Globals.settings_RpcItemsPath_Default; } if (!String.IsNullOrEmpty(Globals.settings_KeyManagerItemsPath.Value)) { @@ -52,7 +52,7 @@ namespace WeeXnes.MVVM.View } else { - KeyPathLabel.Content = "Default"; + KeyPathLabel.Content = Globals.settings_KeyManagerItemsPath_Default; } if (Globals.settings_alwaysOnTop.Value) @@ -74,6 +74,8 @@ namespace WeeXnes.MVVM.View { ItemToClipboardSwitch.IsChecked = true; } + + tb_DefaultClientID.Text = Globals.settings_RpcDefaultClientID.Value; } private void SetUiUpdateListeners() { @@ -85,7 +87,7 @@ namespace WeeXnes.MVVM.View } else { - RpcPathLabel.Content = "Default"; + RpcPathLabel.Content = Globals.settings_RpcItemsPath_Default; } }; Globals.settings_KeyManagerItemsPath.ValueChanged += () => @@ -96,7 +98,7 @@ namespace WeeXnes.MVVM.View } else { - KeyPathLabel.Content = "Default"; + KeyPathLabel.Content = Globals.settings_KeyManagerItemsPath_Default; } }; }