Skip to content
This repository was archived by the owner on Aug 23, 2025. It is now read-only.

Commit 4023ffb

Browse files
committed
Version 1.3.1
Fixed issue #34 Fixed issue #33 , which also fixes the Apply button Moved the kill VM code from toolstrip item click event to VMKill() function Added a try-catch block around p.Kill() just in case
1 parent 7f99564 commit 4023ffb

File tree

5 files changed

+46
-14
lines changed

5 files changed

+46
-14
lines changed

86BoxManager/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
//
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
34-
[assembly: AssemblyVersion("1.3.0.0")]
35-
[assembly: AssemblyFileVersion("1.3.0.0")]
34+
[assembly: AssemblyVersion("1.3.1.0")]
35+
[assembly: AssemblyFileVersion("1.3.1.0")]

86BoxManager/dlgSettings.Designer.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

86BoxManager/dlgSettings.cs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ private void btnCancel_Click(object sender, EventArgs e)
4444
private void btnApply_Click(object sender, EventArgs e)
4545
{
4646
SaveSettings();
47+
btnApply.Enabled = false;
4748
}
4849

4950
private void btnOK_Click(object sender, EventArgs e)
@@ -60,8 +61,7 @@ private void txt_TextChanged(object sender, EventArgs e)
6061
}
6162
else
6263
{
63-
//btnApply.Enabled = true;
64-
settingsChanged = true;
64+
settingsChanged = CheckForChanges(); //true;
6565
btnOK.Enabled = true;
6666
}
6767
}
@@ -168,12 +168,12 @@ private void btnBrowse2_Click(object sender, EventArgs e)
168168

169169
private void cbxMinimize_CheckedChanged(object sender, EventArgs e)
170170
{
171-
settingsChanged = true;
171+
settingsChanged = CheckForChanges();//true;
172172
}
173173

174174
private void cbxShowConsole_CheckedChanged(object sender, EventArgs e)
175175
{
176-
settingsChanged = true;
176+
settingsChanged = CheckForChanges();//true;
177177
}
178178

179179
private void btnDefaults_Click(object sender, EventArgs e)
@@ -201,12 +201,27 @@ private void ResetSettings()
201201

202202
private void cbxCloseTray_CheckedChanged(object sender, EventArgs e)
203203
{
204-
settingsChanged = true;
204+
settingsChanged = CheckForChanges();//true;
205205
}
206206

207207
private void cbxMinimizeTray_CheckedChanged(object sender, EventArgs e)
208208
{
209-
settingsChanged = true;
209+
settingsChanged = CheckForChanges();//true;
210+
}
211+
212+
//Checks if all controls match the currently saved settings to determine if any changes were made
213+
private bool CheckForChanges()
214+
{
215+
RegistryKey regkey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\86Box");
216+
217+
btnApply.Enabled = (txtEXEdir.Text != regkey.GetValue("EXEdir").ToString() ||
218+
txtCFGdir.Text != regkey.GetValue("CFGdir").ToString() ||
219+
cbxMinimize.Checked != Convert.ToBoolean(regkey.GetValue("MinimizeOnVMStart")) ||
220+
cbxShowConsole.Checked != Convert.ToBoolean(regkey.GetValue("ShowConsole")) ||
221+
cbxMinimizeTray.Checked != Convert.ToBoolean(regkey.GetValue("MinimizeToTray")) ||
222+
cbxCloseTray.Checked != Convert.ToBoolean(regkey.GetValue("CloseToTray")));
223+
224+
return btnApply.Enabled;
210225
}
211226
}
212227
}

86BoxManager/frmMain.cs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ private void LoadVMs()
251251
}
252252

253253
//Wait for the associated window of a VM to close
254-
private void backgroundWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
254+
private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
255255
{
256256
VM vm = e.Argument as VM;
257257
try
@@ -264,7 +264,6 @@ private void backgroundWorker_DoWork(object sender, System.ComponentModel.DoWork
264264
MessageBox.Show("An error has occurred. Please provide the following details to the developer:\n" + ex.Message + "\n" + ex.StackTrace, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
265265
}
266266
e.Result = vm;
267-
268267
}
269268

270269
//Update the UI once the VM's window is closed
@@ -1090,8 +1089,8 @@ private void exitToolStripMenuItem_Click(object sender, EventArgs e)
10901089
{
10911090
return;
10921091
}
1093-
Application.Exit();
10941092
}
1093+
Application.Exit();
10951094
}
10961095

10971096
//Handles things when WindowState changes
@@ -1130,13 +1129,26 @@ private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
11301129

11311130
private void killToolStripMenuItem_Click(object sender, EventArgs e)
11321131
{
1133-
//Ask the user to confirm and kill the VM's process
1132+
VMKill();
1133+
}
1134+
1135+
//Kills the process associated with the selected VM
1136+
private void VMKill()
1137+
{
1138+
//Ask the user to confirm
11341139
DialogResult = MessageBox.Show("Killing a virtual machine can cause data loss. Only do this if 86Box.exe process gets stuck. Do you wish to continue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
1135-
if(DialogResult == DialogResult.Yes)
1140+
if (DialogResult == DialogResult.Yes)
11361141
{
11371142
VM vm = (VM)lstVMs.FocusedItem.Tag;
11381143
Process p = Process.GetProcessById(vm.Pid);
1139-
p.Kill();
1144+
try
1145+
{
1146+
p.Kill();
1147+
}
1148+
catch (Exception ex)
1149+
{
1150+
MessageBox.Show("Could not kill 86Box.exe. The process may have already ended on its own or access was denied.", "Could not kill process", MessageBoxButtons.OK, MessageBoxIcon.Error);
1151+
}
11401152

11411153
//We need to cleanup afterwards to make sure the VM is put back into a valid state
11421154
vm.Status = VM.STATUS_STOPPED;

AUTHORS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The following individuals or organizations have contributed at least some code to the 86Box Manager project:
2+
3+
David Simunič (@daviunic)
4+
David Lee (@DL444)

0 commit comments

Comments
 (0)