Fixed run afterwards program

Fixes #48. It's not a full blown "run multiple programs" fix, but it will at least allow people to start to experiment with a single program (or powershell file if more than one needed)
This commit is contained in:
Terry MacDonald 2021-11-05 15:20:35 +13:00
parent 41a75acb1a
commit ccba5cac40
6 changed files with 27 additions and 7 deletions

View File

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

View File

@ -69,7 +69,6 @@ namespace DisplayMagician
public string Executable; public string Executable;
public string Arguments; public string Arguments;
public bool ExecutableArgumentsRequired; public bool ExecutableArgumentsRequired;
public bool CloseOnFinish;
public bool DontStartIfAlreadyRunning; public bool DontStartIfAlreadyRunning;
} }

View File

@ -111,6 +111,7 @@ namespace DisplayMagician.UIForms
this.btn_add.TabIndex = 39; this.btn_add.TabIndex = 39;
this.btn_add.Text = "Add icons"; this.btn_add.Text = "Add icons";
this.btn_add.UseVisualStyleBackColor = true; this.btn_add.UseVisualStyleBackColor = true;
this.btn_add.Click += new System.EventHandler(this.btn_add_Click);
// //
// btn_select // btn_select
// //

View File

@ -97,5 +97,10 @@ namespace DisplayMagician.UIForms
} }
} }
} }
private void btn_add_Click(object sender, EventArgs e)
{
}
} }
} }

View File

@ -1260,6 +1260,7 @@ namespace DisplayMagician.UIForms
// //
// btn_run_cmd_afterwards // btn_run_cmd_afterwards
// //
this.btn_run_cmd_afterwards.Enabled = false;
this.btn_run_cmd_afterwards.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btn_run_cmd_afterwards.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_run_cmd_afterwards.ForeColor = System.Drawing.Color.White; this.btn_run_cmd_afterwards.ForeColor = System.Drawing.Color.White;
this.btn_run_cmd_afterwards.Location = new System.Drawing.Point(645, 35); this.btn_run_cmd_afterwards.Location = new System.Drawing.Point(645, 35);
@ -1268,6 +1269,7 @@ namespace DisplayMagician.UIForms
this.btn_run_cmd_afterwards.TabIndex = 11; this.btn_run_cmd_afterwards.TabIndex = 11;
this.btn_run_cmd_afterwards.Text = "Choose"; this.btn_run_cmd_afterwards.Text = "Choose";
this.btn_run_cmd_afterwards.UseVisualStyleBackColor = true; this.btn_run_cmd_afterwards.UseVisualStyleBackColor = true;
this.btn_run_cmd_afterwards.Click += new System.EventHandler(this.btn_run_cmd_afterwards_Click);
// //
// txt_run_cmd_afterwards // txt_run_cmd_afterwards
// //

View File

@ -501,9 +501,17 @@ namespace DisplayMagician.UIForms
stopProgram.Executable = txt_run_cmd_afterwards.Text; stopProgram.Executable = txt_run_cmd_afterwards.Text;
stopProgram.Priority = 0; stopProgram.Priority = 0;
stopProgram.DontStartIfAlreadyRunning = false; stopProgram.DontStartIfAlreadyRunning = false;
stopProgram.Arguments = "";
stopProgram.Disabled = false; stopProgram.Disabled = false;
if (cb_run_cmd_afterwards_args.Checked)
{
stopProgram.ExecutableArgumentsRequired = true;
stopProgram.Arguments = txt_run_cmd_afterwards_args.Text;
}
else
{
stopProgram.ExecutableArgumentsRequired = false; stopProgram.ExecutableArgumentsRequired = false;
stopProgram.Arguments = "";
}
stopProgram.ProcessPriority = ProcessPriority.Normal; stopProgram.ProcessPriority = ProcessPriority.Normal;
_stopPrograms.Add(stopProgram); _stopPrograms.Add(stopProgram);
} }
@ -2780,6 +2788,11 @@ namespace DisplayMagician.UIForms
txt_run_cmd_afterwards_args.Enabled = false; txt_run_cmd_afterwards_args.Enabled = false;
} }
} }
private void btn_run_cmd_afterwards_Click(object sender, EventArgs e)
{
txt_run_cmd_afterwards.Text = getExeFile();
}
} }
// Class used to populate combo boxes // Class used to populate combo boxes