Skip to content

Commit

Permalink
Fix #1311
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszCichecki committed May 29, 2024
1 parent f3ad658 commit 0c26829
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LenovoLegionToolkit.Lib.Automation/AutomationProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 15 additions & 5 deletions LenovoLegionToolkit.WPF/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PowerModeMappingMode>(), _settings.Store.PowerModeMappingMode, t => t.GetDisplayName());
Expand Down

0 comments on commit 0c26829

Please sign in to comment.