This commit is contained in:
Nekotekina 2014-03-02 10:24:18 +04:00
commit c978fe377d
17 changed files with 160 additions and 18 deletions

View file

@ -8,6 +8,7 @@ END_EVENT_TABLE()
DbgConsole::DbgConsole()
: FrameBase(nullptr, wxID_ANY, "DbgConsole", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxDEFAULT_FRAME_STYLE, true)
, ThreadBase("DbgConsole thread")
, m_output(nullptr)
{
m_console = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxSize(500, 500), wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH2);
@ -16,6 +17,9 @@ DbgConsole::DbgConsole()
m_color_white = new wxTextAttr(wxColour(255, 255, 255));
m_color_red = new wxTextAttr(wxColour(255, 0, 0));
if (Ini.HLESaveTTY.GetValue())
m_output = new wxFile("tty.log", wxFile::write);
}
DbgConsole::~DbgConsole()
@ -63,6 +67,9 @@ void DbgConsole::Task()
m_console->SetInsertionPointEnd();
m_console->WriteText(packet.m_text);
if (m_output && Ini.HLESaveTTY.GetValue())
m_output->Write(packet.m_text);
if(!DbgConsole::IsShown()) Show();
}
}
@ -71,5 +78,12 @@ void DbgConsole::OnQuit(wxCloseEvent& event)
{
ThreadBase::Stop(false);
Hide();
if (m_output)
{
m_output->Close();
m_output = nullptr;
}
//event.Skip();
}