Stop DM closing after running a shortcut

Also allow people to click on the startprograms
checkbox labels to have them change the
checkboxes themselves.
This commit is contained in:
Terry MacDonald 2021-03-17 20:44:59 +13:00
parent f9de793998
commit 77110db114
3 changed files with 38 additions and 2 deletions

View File

@ -691,6 +691,7 @@ namespace DisplayMagician.UIForms
this.lbl_start_program4.Size = new System.Drawing.Size(244, 20);
this.lbl_start_program4.TabIndex = 0;
this.lbl_start_program4.Text = "Choose a program to start fourth:";
this.lbl_start_program4.Click += new System.EventHandler(this.lbl_start_program4_Click);
//
// pnl_start_program3
//
@ -779,6 +780,7 @@ namespace DisplayMagician.UIForms
this.lbl_start_program3.Size = new System.Drawing.Size(233, 20);
this.lbl_start_program3.TabIndex = 0;
this.lbl_start_program3.Text = "Choose a program to start third:";
this.lbl_start_program3.Click += new System.EventHandler(this.lbl_start_program3_Click);
//
// pnl_start_program2
//
@ -867,6 +869,7 @@ namespace DisplayMagician.UIForms
this.lbl_start_program2.Size = new System.Drawing.Size(254, 20);
this.lbl_start_program2.TabIndex = 0;
this.lbl_start_program2.Text = "Choose a program to start second:";
this.lbl_start_program2.Click += new System.EventHandler(this.lbl_start_program2_Click);
//
// pnl_start_program1
//
@ -955,6 +958,7 @@ namespace DisplayMagician.UIForms
this.lbl_start_program1.Size = new System.Drawing.Size(228, 20);
this.lbl_start_program1.TabIndex = 0;
this.lbl_start_program1.Text = "Choose a program to start first:";
this.lbl_start_program1.Click += new System.EventHandler(this.lbl_start_program1_Click);
//
// tabp_game
//

View File

@ -1997,5 +1997,36 @@ namespace DisplayMagician.UIForms
_captureVolume = Convert.ToDecimal(nud_capture_volume.Value);
}
private void lbl_start_program1_Click(object sender, EventArgs e)
{
if (!cb_start_program1.Checked)
cb_start_program1.CheckState = CheckState.Checked;
else
cb_start_program1.CheckState = CheckState.Unchecked;
}
private void lbl_start_program2_Click(object sender, EventArgs e)
{
if (!cb_start_program2.Checked)
cb_start_program2.CheckState = CheckState.Checked;
else
cb_start_program2.CheckState = CheckState.Unchecked;
}
private void lbl_start_program3_Click(object sender, EventArgs e)
{
if (!cb_start_program3.Checked)
cb_start_program3.CheckState = CheckState.Checked;
else
cb_start_program3.CheckState = CheckState.Unchecked;
}
private void lbl_start_program4_Click(object sender, EventArgs e)
{
if (!cb_start_program4.Checked)
cb_start_program4.CheckState = CheckState.Checked;
else
cb_start_program4.CheckState = CheckState.Unchecked;
}
}
}

View File

@ -319,11 +319,12 @@ namespace DisplayMagician.UIForms
// Get the MainForm so we can access the NotifyIcon on it.
MainForm mainForm = (MainForm)this.Owner;
// Run the shortcut
ShortcutRepository.RunShortcut(_selectedShortcut, mainForm.notifyIcon);
maskedForm.Close();
// Only do this if we are NOT minimised
if (!Program.AppProgramSettings.MinimiseOnStart)
maskedForm.Close();
}
private void ilv_saved_shortcuts_ItemHover(object sender, ItemHoverEventArgs e)