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

Commit 6ac0799

Browse files
committed
Fixed tray icon Exit option as well
1 parent 6346174 commit 6ac0799

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

86BoxManager/frmMain.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,25 +1123,27 @@ private void trayIcon_MouseDoubleClick(object sender, MouseEventArgs e)
11231123

11241124
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
11251125
{
1126-
List<ListViewItem> vms = new List<ListViewItem>();
1126+
//List<ListViewItem> vms = new List<ListViewItem>();
1127+
int vmCount = 0;
11271128
foreach (ListViewItem item in lstVMs.Items)
11281129
{
11291130
VM vm = (VM)item.Tag;
11301131
if (vm.Status != VM.STATUS_STOPPED)
11311132
{
1132-
vms.Add(item);
1133+
vmCount++;
11331134
}
11341135
}
11351136

11361137
//If there are running VMs, display the warning and stop the VMs if user says so
1137-
if (vms.Count > 0)
1138+
if (vmCount > 0)
11381139
{
11391140
DialogResult = MessageBox.Show("It appears some virtual machines are still running. It's recommended you stop them first before closing 86Box Manager. Do you want to stop them now?", "Virtual machines are still running", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
11401141
if (DialogResult == DialogResult.Yes)
11411142
{
1142-
foreach (ListViewItem lvi in vms)
1143+
foreach (ListViewItem lvi in lstVMs.Items)
11431144
{
11441145
lvi.Focused = true;
1146+
lvi.Selected = true;
11451147
VMStop();
11461148
}
11471149
Thread.Sleep(1000); //Wait just a bit to make sure everything goes as planned

0 commit comments

Comments
 (0)