Skip to content

Commit

Permalink
GCSViews: Configuration view: add armed only speech checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
IamPete1 authored and meee1 committed Apr 28, 2022
1 parent 1a7e9fe commit 2b94491
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 84 deletions.
10 changes: 10 additions & 0 deletions GCSViews/ConfigurationView/ConfigPlanner.Designer.cs

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

9 changes: 9 additions & 0 deletions GCSViews/ConfigurationView/ConfigPlanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public void Activate()
SetCheckboxFromConfig("ShowNoFly", chk_shownofly);
SetCheckboxFromConfig("Params_BG", CHK_params_bg);
SetCheckboxFromConfig("SlowMachine", chk_slowMachine);
SetCheckboxFromConfig("speech_armed_only", CHK_speechArmedOnly);

// this can't fail because it set at startup
NUM_tracklength.Value = Settings.Instance.GetInt32("NUM_tracklength", 200);
Expand Down Expand Up @@ -337,6 +338,7 @@ private void CHK_enablespeech_CheckedChanged(object sender, EventArgs e)

if (CHK_enablespeech.Checked)
{
CHK_speechArmedOnly.Visible = true;
CHK_speechwaypoint.Visible = true;
CHK_speechaltwarning.Visible = true;
CHK_speechbattery.Visible = true;
Expand All @@ -347,6 +349,7 @@ private void CHK_enablespeech_CheckedChanged(object sender, EventArgs e)
}
else
{
CHK_speechArmedOnly.Visible = false;
CHK_speechwaypoint.Visible = false;
CHK_speechaltwarning.Visible = false;
CHK_speechbattery.Visible = false;
Expand Down Expand Up @@ -993,5 +996,11 @@ private void chk_slowMachine_CheckedChanged(object sender, EventArgs e)
{
Settings.Instance["SlowMachine"] = chk_slowMachine.Checked.ToString();
}

private void CHK_speechArmedOnly_CheckedChanged(object sender, EventArgs e)
{
MainV2.speech_armed_only = CHK_speechArmedOnly.Checked;
Settings.Instance["speech_armed_only"] = CHK_speechArmedOnly.Checked.ToString();
}
}
}
Loading

0 comments on commit 2b94491

Please sign in to comment.