Skip to content

Commit

Permalink
Merge pull request #1062 from seerge/power_modes
Browse files Browse the repository at this point in the history
Power Mode control
  • Loading branch information
seerge authored Aug 12, 2023
2 parents 708e3aa + 3075e22 commit 07d81e6
Show file tree
Hide file tree
Showing 10 changed files with 226 additions and 116 deletions.
5 changes: 5 additions & 0 deletions app/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ public static void Remove(string name)
Write();
}

public static void RemoveMode(string name)
{
Remove(name + "_" + Modes.GetCurrent());
}

public static string GgetParamName(AsusFan device, string paramName = "fan_profile")
{
int mode = Modes.GetCurrent();
Expand Down
24 changes: 4 additions & 20 deletions app/Extra.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions app/Extra.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public Extra()
checkNoOverdrive.Text = Properties.Strings.DisableOverdrive;
checkTopmost.Text = Properties.Strings.WindowTop;
checkUSBC.Text = Properties.Strings.OptimizedUSBC;
checkAutoApplyWindowsPowerMode.Text = Properties.Strings.ApplyWindowsPowerPlan;
checkAutoToggleClamshellMode.Text = Properties.Strings.ToggleClamshellMode;

labelBacklightKeyboard.Text = Properties.Strings.Keyboard;
Expand Down Expand Up @@ -293,9 +292,6 @@ public Extra()
checkUSBC.Checked = AppConfig.Is("optimized_usbc");
checkUSBC.CheckedChanged += CheckUSBC_CheckedChanged;

checkAutoApplyWindowsPowerMode.Checked = (AppConfig.Get("auto_apply_power_plan") != 0);
checkAutoApplyWindowsPowerMode.CheckedChanged += checkAutoApplyWindowsPowerMode_CheckedChanged;

sliderBrightness.Value = InputDispatcher.GetBacklight();
sliderBrightness.ValueChanged += SliderBrightness_ValueChanged;

Expand Down Expand Up @@ -563,10 +559,6 @@ private void Keyboard_Shown(object? sender, EventArgs e)
Left = Program.settingsForm.Left - Width - 5;
}

private void checkAutoApplyWindowsPowerMode_CheckedChanged(object? sender, EventArgs e)
{
AppConfig.Set("auto_apply_power_plan", checkAutoApplyWindowsPowerMode.Checked ? 1 : 0);
}

private void checkAutoToggleClamshellMode_CheckedChanged(object? sender, EventArgs e)
{
Expand Down
Loading

0 comments on commit 07d81e6

Please sign in to comment.