Skip to content

Commit f921414

Browse files
Fix charge limit "Enabled" check box not having any effect when disabled
1 parent 2716c9d commit f921414

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

YAMDCC.ConfigEditor/MainWindow.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ private void tsiSaveConf_Click(object sender, EventArgs e)
351351

352352
if (sfd.ShowDialog() == DialogResult.OK)
353353
{
354+
Config.ChargeLimitConf.CurVal = (byte)(chkChgLim.Checked
355+
? numChgLim.Value : 0);
354356
Config.Save(sfd.FileName);
355357
SetLastConfPath(sfd.FileName);
356358
btnRevert.Enabled = tsiRevert.Enabled = false;
@@ -699,7 +701,6 @@ private void numChgLim_Changed(object sender, EventArgs e)
699701
{
700702
if (Config is not null)
701703
{
702-
Config.ChargeLimitConf.CurVal = (byte)numChgLim.Value;
703704
btnRevert.Enabled = tsiRevert.Enabled = true;
704705
}
705706
}
@@ -895,6 +896,8 @@ private void LoadConf(YAMDCC_Config config)
895896
private void ApplyConf()
896897
{
897898
// Save the updated config
899+
Config.ChargeLimitConf.CurVal = (byte)(chkChgLim.Checked
900+
? numChgLim.Value : 0);
898901
Config.Save(Paths.CurrentConfig);
899902

900903
// Tell the service to reload and apply the updated config

0 commit comments

Comments
 (0)