Fixed stop program disablement

The stop program wasn't actually able to be stopped through the GUI due to the fact I missed updating the save and load functions to store that information :/. This has now been rectified.
This commit is contained in:
Terry MacDonald 2022-01-04 23:16:45 +13:00
parent 5f6c7d6e54
commit 4444d2b93b
2 changed files with 28 additions and 9 deletions

View File

@ -26,8 +26,8 @@ using System.Resources;
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
// Version information
[assembly: AssemblyVersion("2.1.5.32")]
[assembly: AssemblyFileVersion("2.1.5.32")]
[assembly: AssemblyVersion("2.1.5.37")]
[assembly: AssemblyFileVersion("2.1.5.37")]
[assembly: NeutralResourcesLanguageAttribute( "en" )]
[assembly: CLSCompliant(true)]

View File

@ -465,7 +465,14 @@ namespace DisplayMagician.UIForms
stopProgram.Executable = txt_run_cmd_afterwards.Text;
stopProgram.Priority = 0;
stopProgram.DontStartIfAlreadyRunning = false;
stopProgram.Disabled = false;
if (cb_run_cmd_afterwards.Checked)
{
stopProgram.Disabled = false;
}
else
{
stopProgram.Disabled = true;
}
if (cb_run_cmd_afterwards_args.Checked)
{
stopProgram.ExecutableArgumentsRequired = true;
@ -1827,13 +1834,25 @@ namespace DisplayMagician.UIForms
// Setup the single stop program we're beginning with
if (_shortcutToEdit.StopPrograms is List<StopProgram> && _shortcutToEdit.StopPrograms.Count > 0)
{
txt_run_cmd_afterwards.Enabled = true;
btn_run_cmd_afterwards.Enabled = true;
cb_run_cmd_afterwards_args.Enabled = true;
cb_run_cmd_afterwards_dont_start.Enabled = true;
cb_run_cmd_afterwards_run_as_administrator.Enabled = true;
if (_shortcutToEdit.StopPrograms[0].Disabled == false)
{
txt_run_cmd_afterwards.Enabled = true;
btn_run_cmd_afterwards.Enabled = true;
cb_run_cmd_afterwards_args.Enabled = true;
cb_run_cmd_afterwards_dont_start.Enabled = true;
cb_run_cmd_afterwards_run_as_administrator.Enabled = true;
cb_run_cmd_afterwards.Checked = true;
}
else
{
txt_run_cmd_afterwards.Enabled = false;
btn_run_cmd_afterwards.Enabled = false;
cb_run_cmd_afterwards_args.Enabled = false;
cb_run_cmd_afterwards_dont_start.Enabled = false;
cb_run_cmd_afterwards_run_as_administrator.Enabled = false;
cb_run_cmd_afterwards.Checked = false;
}
cb_run_cmd_afterwards.Checked = true;
txt_run_cmd_afterwards.Text = _shortcutToEdit.StopPrograms[0].Executable;
if (_shortcutToEdit.StopPrograms[0].ExecutableArgumentsRequired)
{