Skip to content

Commit

Permalink
Fix charge limit "Enabled" check box not having any effect when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparronator9999 committed Jan 5, 2025
1 parent 2716c9d commit f921414
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion YAMDCC.ConfigEditor/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ private void tsiSaveConf_Click(object sender, EventArgs e)

if (sfd.ShowDialog() == DialogResult.OK)
{
Config.ChargeLimitConf.CurVal = (byte)(chkChgLim.Checked
? numChgLim.Value : 0);
Config.Save(sfd.FileName);
SetLastConfPath(sfd.FileName);
btnRevert.Enabled = tsiRevert.Enabled = false;
Expand Down Expand Up @@ -699,7 +701,6 @@ private void numChgLim_Changed(object sender, EventArgs e)
{
if (Config is not null)
{
Config.ChargeLimitConf.CurVal = (byte)numChgLim.Value;
btnRevert.Enabled = tsiRevert.Enabled = true;
}
}
Expand Down Expand Up @@ -895,6 +896,8 @@ private void LoadConf(YAMDCC_Config config)
private void ApplyConf()
{
// Save the updated config
Config.ChargeLimitConf.CurVal = (byte)(chkChgLim.Checked
? numChgLim.Value : 0);
Config.Save(Paths.CurrentConfig);

// Tell the service to reload and apply the updated config
Expand Down

0 comments on commit f921414

Please sign in to comment.