diff --git a/LenovoLegionToolkit.Lib.Automation/AutomationProcessor.cs b/LenovoLegionToolkit.Lib.Automation/AutomationProcessor.cs index 6a2c7761b7..114e8a1bc9 100644 --- a/LenovoLegionToolkit.Lib.Automation/AutomationProcessor.cs +++ b/LenovoLegionToolkit.Lib.Automation/AutomationProcessor.cs @@ -43,7 +43,7 @@ public async Task InitializeAsync() { using (await _ioLock.LockAsync().ConfigureAwait(false)) { - displayConfigurationListener.Changed += DisplayConfigurationListener_Changed; ; + displayConfigurationListener.Changed += DisplayConfigurationListener_Changed; nativeWindowsMessageListener.Changed += NativeWindowsMessageListener_Changed; powerStateListener.Changed += PowerStateListener_Changed; powerModeListener.Changed += PowerModeListener_Changed; diff --git a/LenovoLegionToolkit.WPF/Pages/SettingsPage.xaml.cs b/LenovoLegionToolkit.WPF/Pages/SettingsPage.xaml.cs index f4401dc7d7..20e96780f0 100644 --- a/LenovoLegionToolkit.WPF/Pages/SettingsPage.xaml.cs +++ b/LenovoLegionToolkit.WPF/Pages/SettingsPage.xaml.cs @@ -111,15 +111,25 @@ private async Task RefreshAsync() _bootLogoCard.Visibility = await BootLogo.IsSupportedAsync() ? Visibility.Visible : Visibility.Collapsed; - var mi = await Compatibility.GetMachineInformationAsync(); - if (mi.Features[CapabilityID.GodModeFnQSwitchable]) + try { - _godModeFnQSwitchableCard.Visibility = Visibility.Visible; - _godModeFnQSwitchableToggle.IsChecked = await WMI.LenovoOtherMethod.GetFeatureValueAsync(CapabilityID.GodModeFnQSwitchable) == 1; + var mi = await Compatibility.GetMachineInformationAsync(); + if (mi.Features[CapabilityID.GodModeFnQSwitchable]) + { + _godModeFnQSwitchableCard.Visibility = Visibility.Visible; + _godModeFnQSwitchableToggle.IsChecked = await WMI.LenovoOtherMethod.GetFeatureValueAsync(CapabilityID.GodModeFnQSwitchable) == 1; + } + else + { + _godModeFnQSwitchableCard.Visibility = Visibility.Collapsed; + } } - else + catch (Exception ex) { _godModeFnQSwitchableCard.Visibility = Visibility.Collapsed; + + if (Log.Instance.IsTraceEnabled) + Log.Instance.Trace($"Failed to get GodModeFnQSwitchable status.", ex); } _powerModeMappingComboBox.SetItems(Enum.GetValues(), _settings.Store.PowerModeMappingMode, t => t.GetDisplayName());