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

Commit df9782d

Browse files
committed
Final v1.5.0 commit
Added option to toggle grid lines from issue #51 Added option to toggle 86Box logging to specified file from issue #48
1 parent 3139df8 commit df9782d

File tree

3 files changed

+115
-31
lines changed

3 files changed

+115
-31
lines changed

86BoxManager/dlgSettings.Designer.cs

Lines changed: 54 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

86BoxManager/dlgSettings.cs

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private void btnOK_Click(object sender, EventArgs e)
6464
private void txt_TextChanged(object sender, EventArgs e)
6565
{
6666
if (string.IsNullOrWhiteSpace(txtEXEdir.Text) || string.IsNullOrWhiteSpace(txtCFGdir.Text) ||
67-
string.IsNullOrWhiteSpace(txtLaunchTimeout.Text))
67+
string.IsNullOrWhiteSpace(txtLaunchTimeout.Text) || string.IsNullOrWhiteSpace(txtLogPath.Text))
6868
{
6969
btnApply.Enabled = false;
7070
}
@@ -93,7 +93,7 @@ private void Get86BoxVersion()
9393
}
9494
else //Completely unsupported, since version info can't be obtained anyway
9595
{
96-
lbl86BoxVer1.Text = "2.0 (pre-1763) - not supported";
96+
lbl86BoxVer1.Text = "2.0 (pre-1763) - no support / unofficial build - support level unknown";
9797
lbl86BoxVer1.ForeColor = Color.Red;
9898
}
9999
}
@@ -131,6 +131,8 @@ private void SaveSettings()
131131
regkey.SetValue("CloseToTray", cbxCloseTray.Checked, RegistryValueKind.DWord);
132132
regkey.SetValue("LaunchTimeout", int.Parse(txtLaunchTimeout.Text), RegistryValueKind.DWord);
133133
regkey.SetValue("EnableLogging", cbxLogging.Checked, RegistryValueKind.DWord);
134+
regkey.SetValue("LogPath", txtLogPath.Text, RegistryValueKind.String);
135+
regkey.SetValue("EnableGridLines", cbxGrid.Checked, RegistryValueKind.DWord);
134136
regkey.Close();
135137

136138
settingsChanged = CheckForChanges();
@@ -173,6 +175,10 @@ private void LoadSettings()
173175
cbxCloseTray.Checked = false;
174176
cbxLogging.Checked = false;
175177
txtLaunchTimeout.Text = "5000";
178+
txtLogPath.Text = "";
179+
cbxGrid.Checked = false;
180+
btnBrowse3.Enabled = false;
181+
txtLogPath.Enabled = false;
176182

177183
SaveSettings(); //This will write the default values to the registry
178184
}
@@ -186,6 +192,10 @@ private void LoadSettings()
186192
cbxCloseTray.Checked = Convert.ToBoolean(regkey.GetValue("CloseToTray"));
187193
cbxLogging.Checked = Convert.ToBoolean(regkey.GetValue("EnableLogging"));
188194
txtLaunchTimeout.Text = Convert.ToString(regkey.GetValue("LaunchTimeout"));
195+
txtLogPath.Text = Convert.ToString(regkey.GetValue("LogPath"));
196+
cbxGrid.Checked = Convert.ToBoolean(regkey.GetValue("EnableGridLines"));
197+
txtLogPath.Enabled = cbxLogging.Checked;
198+
btnBrowse3.Enabled = cbxLogging.Checked;
189199
}
190200

191201
regkey.Close();
@@ -200,6 +210,10 @@ private void LoadSettings()
200210
cbxCloseTray.Checked = false;
201211
cbxLogging.Checked = false;
202212
txtLaunchTimeout.Text = "5000";
213+
txtLogPath.Text = "";
214+
cbxGrid.Checked = false;
215+
txtLogPath.Enabled = false;
216+
btnBrowse3.Enabled = false;
203217
}
204218
}
205219

@@ -268,6 +282,10 @@ private void ResetSettings()
268282
cbxCloseTray.Checked = false;
269283
cbxLogging.Checked = false;
270284
txtLaunchTimeout.Text = "5000";
285+
txtLogPath.Text = "";
286+
cbxGrid.Checked = false;
287+
txtLogPath.Enabled = false;
288+
btnBrowse3.Enabled = false;
271289

272290
SaveSettings();
273291
regkey.Close();
@@ -287,7 +305,9 @@ private bool CheckForChanges()
287305
cbxMinimizeTray.Checked != Convert.ToBoolean(regkey.GetValue("MinimizeToTray")) ||
288306
cbxCloseTray.Checked != Convert.ToBoolean(regkey.GetValue("CloseToTray")) ||
289307
txtLaunchTimeout.Text != Convert.ToString(regkey.GetValue("LaunchTimeout")) ||
290-
cbxLogging.Checked != Convert.ToBoolean(regkey.GetValue("EnableLogging")));
308+
cbxLogging.Checked != Convert.ToBoolean(regkey.GetValue("EnableLogging")) ||
309+
txtLogPath.Text != regkey.GetValue("LogPath").ToString() ||
310+
cbxGrid.Checked != Convert.ToBoolean(regkey.GetValue("EnableGridLines")));
291311

292312
return btnApply.Enabled;
293313
}
@@ -305,5 +325,27 @@ private void cbx_CheckedChanged(object sender, EventArgs e)
305325
{
306326
settingsChanged = CheckForChanges();
307327
}
328+
329+
private void cbxLogging_CheckedChanged(object sender, EventArgs e)
330+
{
331+
settingsChanged = CheckForChanges();
332+
txt_TextChanged(sender, e); //Needed so the Apply button doesn't get enabled on an empty logpath textbox. Too lazy to write a duplicated empty check...
333+
txtLogPath.Enabled = cbxLogging.Checked;
334+
btnBrowse3.Enabled = cbxLogging.Checked;
335+
}
336+
337+
private void btnBrowse3_Click(object sender, EventArgs e)
338+
{
339+
SaveFileDialog ofd = new SaveFileDialog();
340+
ofd.DefaultExt = "log";
341+
ofd.Title = "Select a file where 86Box logs will be saved";
342+
ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
343+
ofd.Filter = "Log files (*.log)|*.log";
344+
345+
if (ofd.ShowDialog() == DialogResult.OK)
346+
{
347+
txtLogPath.Text = ofd.FileName;
348+
}
349+
}
308350
}
309351
}

86BoxManager/frmMain.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public struct COPYDATASTRUCT
4141
private int sortColumn = -1; //For column sorting's asc/desc capability
4242
private int launchTimeout = 5000; //Timeout for waiting for 86Box.exe to initialize
4343
private bool logging = false; //Logging enabled for 86Box.exe (-L parameter)?
44+
private string logpath = ""; //Path to log file
45+
private bool gridlines = false; //Are grid lines enabled for VM list?
4446

4547
public frmMain()
4648
{
@@ -206,6 +208,11 @@ private void LoadSettings()
206208
minimizeTray = Convert.ToBoolean(regkey.GetValue("MinimizeToTray"));
207209
closeTray = Convert.ToBoolean(regkey.GetValue("CloseToTray"));
208210
launchTimeout = int.Parse(regkey.GetValue("LaunchTimeout").ToString());
211+
logpath = regkey.GetValue("LogPath").ToString();
212+
logging = Convert.ToBoolean(regkey.GetValue("EnableLogging"));
213+
gridlines = Convert.ToBoolean(regkey.GetValue("EnableGridLines"));
214+
215+
lstVMs.GridLines = gridlines;
209216
}
210217
catch (Exception ex)
211218
{
@@ -226,6 +233,11 @@ private void LoadSettings()
226233
minimizeTray = false;
227234
closeTray = false;
228235
launchTimeout = 5000;
236+
logging = false;
237+
logpath = "";
238+
gridlines = false;
239+
240+
lstVMs.GridLines = false;
229241

230242
//Defaults must also be written to the registry
231243
regkey.SetValue("EXEdir", exepath, RegistryValueKind.String);
@@ -235,6 +247,9 @@ private void LoadSettings()
235247
regkey.SetValue("MinimizeToTray", minimizeTray, RegistryValueKind.DWord);
236248
regkey.SetValue("CloseToTray", closeTray, RegistryValueKind.DWord);
237249
regkey.SetValue("LaunchTimeout", launchTimeout, RegistryValueKind.DWord);
250+
regkey.SetValue("EnableLogging", logging, RegistryValueKind.DWord);
251+
regkey.SetValue("LogPath", logpath, RegistryValueKind.String);
252+
regkey.SetValue("EnableGridLines", gridlines, RegistryValueKind.DWord);
238253
}
239254
finally
240255
{
@@ -513,7 +528,7 @@ private void VMStart()
513528
p.StartInfo.Arguments = "-P \"" + lstVMs.SelectedItems[0].SubItems[2].Text + "\" -H " + ZEROID + "," + hWndHex;
514529
if (logging)
515530
{
516-
p.StartInfo.Arguments += " -L";
531+
p.StartInfo.Arguments += " -L \"" + logpath + "\"";
517532
}
518533
if (!showConsole)
519534
{

0 commit comments

Comments
 (0)