Add GUI menu item for toggling the log window as console option, and move said option to the config file

This commit is contained in:
andres.delikat 2011-09-21 00:48:40 +00:00
parent e91352e040
commit 80d01b6512
7 changed files with 1873 additions and 1827 deletions

View File

@ -133,6 +133,7 @@
public bool AutofireLagFrames = true;
public int SaveSlot = 0; //currently selected savestate slot
public bool AutoLoadLastSaveSlot = false;
public bool WIN32_CONSOLE = true;
// Run-Control settings
public int FrameProgressDelayMs = 500; //how long until a frame advance hold turns into a frame progress?

View File

@ -25,6 +25,7 @@ namespace BizHawk.MultiClient
static LogWindow window;
static LogStream logStream;
static StringBuilder sbLog;
bool NeedToRelease = false;
class LogStream : Stream
{
@ -205,16 +206,14 @@ namespace BizHawk.MultiClient
hasConsole = false;
}
const bool WIN32_CONSOLE = true;
public static void ShowConsole()
{
if (ConsoleVisible) return;
ConsoleVisible = true;
if (WIN32_CONSOLE)
if (Global.Config.WIN32_CONSOLE)
{
NeedToRelease = true;
CreateConsole();
//not sure whether we need to set a buffer size here
//var sout = new StreamWriter(Console.OpenStandardOutput(),Encoding.ASCII,1) { AutoFlush = true };
@ -242,7 +241,7 @@ namespace BizHawk.MultiClient
if (ConsoleVisible == false) return;
Console.SetOut(TextWriter.Null);
ConsoleVisible = false;
if (WIN32_CONSOLE)
if (NeedToRelease)
{
ReleaseConsole();
}

View File

@ -96,6 +96,7 @@
this.Name = "LogWindow";
this.ShowIcon = false;
this.Text = "Log Window";
this.Load += new System.EventHandler(this.LogWindow_Load);
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -58,5 +58,10 @@ namespace BizHawk.MultiClient
Close();
}
private void LogWindow_Load(object sender, EventArgs e)
{
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1128,7 +1128,8 @@ namespace BizHawk.MultiClient
singleInstanceModeToolStripMenuItem.Checked = Global.Config.SingleInstanceMode;
enableContextMenuToolStripMenuItem.Checked = Global.Config.ShowContextMenu;
backupSavestatesToolStripMenuItem.Checked = Global.Config.BackupSavestates;
saveScreenshotWithSavestatesToolStripMenuItem.Checked = Global.Config.SaveScreenshotWithStates;
saveScreenshotWithSavestatesToolStripMenuItem.Checked = Global.Config.SaveScreenshotWithStates;
logWindowAsConsoleToolStripMenuItem.Checked = Global.Config.WIN32_CONSOLE;
}
private void MainForm_Load(object sender, EventArgs e)

View File

@ -2419,5 +2419,10 @@ namespace BizHawk.MultiClient
{
Global.Config.AutoLoadLastSaveSlot ^= true;
}
private void logWindowAsConsoleToolStripMenuItem_Click(object sender, EventArgs e)
{
Global.Config.WIN32_CONSOLE ^= true;
}
}
}