Skip to content

Commit

Permalink
Fixed issue where change of power plan from UI didn't change Windows …
Browse files Browse the repository at this point in the history
…power mode.
  • Loading branch information
BartoszCichecki committed Nov 22, 2021
1 parent 56e0da8 commit 6447e7b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion AboutWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public AboutWindow()
{
InitializeComponent();

versionLbl.Content += Assembly.GetEntryAssembly().GetName().Version.ToString(2);
versionLbl.Content += Assembly.GetEntryAssembly().GetName().Version.ToString(3);
}

private void hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
Expand Down
4 changes: 2 additions & 2 deletions LenovoLegionToolkit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<ApplicationIcon>icon.ico</ApplicationIcon>
<AssemblyName>Lenovo Legion Toolkit</AssemblyName>
<Copyright>© 2021 Bartosz Cichecki</Copyright>
<FileVersion>1.3</FileVersion>
<Version>1.3</Version>
<FileVersion>1.3.1</FileVersion>
<Version>1.3.1</Version>
<Nullable>disable</Nullable>
<UseWPF>true</UseWPF>
<SelfContained>false</SelfContained>
Expand Down
2 changes: 1 addition & 1 deletion Lib/Features/AbstractWmiFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public T GetState()
return FromInternal(ExecuteGamezone("Get" + _methodNameSuffix, "Data"));
}

public void SetState(T state)
public virtual void SetState(T state)
{
ExecuteGamezone("Set" + _methodNameSuffix, "Data",
new Dictionary<string, string>
Expand Down
11 changes: 10 additions & 1 deletion Lib/Features/PowerModeFeature.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
namespace LenovoLegionToolkit.Lib.Features
using LenovoLegionToolkit.Lib.Utils;

namespace LenovoLegionToolkit.Lib.Features
{
public class PowerModeFeature : AbstractWmiFeature<PowerModeState>
{
public PowerModeFeature() : base("SmartFanMode", 1, "IsSupportSmartFan") { }

public override void SetState(PowerModeState state)
{
base.SetState(state);

OS.SetPowerPlan(state.GetPowerPlanGuid());
}
}
}

0 comments on commit 6447e7b

Please sign in to comment.