little Logwindow feature - enable/disable all logs

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@314 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2008-08-25 21:02:56 +00:00
parent ab4333ebac
commit 84336bd7b6
3 changed files with 20 additions and 0 deletions

View File

@ -24,6 +24,7 @@ enum
IDM_UPDATELOG, IDM_UPDATELOG,
IDM_CLEARLOG, IDM_CLEARLOG,
IDM_LOGCHECKS, IDM_LOGCHECKS,
IDM_ENABLEALL,
IDM_SUBMITCMD = 300, IDM_SUBMITCMD = 300,
}; };

View File

@ -31,6 +31,7 @@ BEGIN_EVENT_TABLE(CLogWindow, wxDialog)
EVT_BUTTON(IDM_SUBMITCMD, CLogWindow::OnSubmit) EVT_BUTTON(IDM_SUBMITCMD, CLogWindow::OnSubmit)
EVT_BUTTON(IDM_UPDATELOG, CLogWindow::OnUpdateLog) EVT_BUTTON(IDM_UPDATELOG, CLogWindow::OnUpdateLog)
EVT_BUTTON(IDM_CLEARLOG, CLogWindow::OnClear) EVT_BUTTON(IDM_CLEARLOG, CLogWindow::OnClear)
EVT_BUTTON(IDM_ENABLEALL, CLogWindow::OnEnableAll)
EVT_CHECKLISTBOX(IDM_LOGCHECKS, CLogWindow::OnLogCheck) EVT_CHECKLISTBOX(IDM_LOGCHECKS, CLogWindow::OnLogCheck)
END_EVENT_TABLE() END_EVENT_TABLE()
@ -50,6 +51,7 @@ CLogWindow::CLogWindow(wxWindow* parent)
sizerTop->Add(new wxButton(this, IDM_UPDATELOG, _T("Update"))); sizerTop->Add(new wxButton(this, IDM_UPDATELOG, _T("Update")));
sizerTop->Add(new wxButton(this, IDM_CLEARLOG, _T("Clear"))); sizerTop->Add(new wxButton(this, IDM_CLEARLOG, _T("Clear")));
sizerTop->Add(new wxButton(this, IDM_ENABLEALL, _T("Enable all")));
m_checks = new wxCheckListBox(this, IDM_LOGCHECKS, wxDefaultPosition, wxSize(120, 280)); m_checks = new wxCheckListBox(this, IDM_LOGCHECKS, wxDefaultPosition, wxSize(120, 280));
sizerBottom->Add(m_cmdline, 8, wxGROW | wxRIGHT, 5); sizerBottom->Add(m_cmdline, 8, wxGROW | wxRIGHT, 5);
sizerBottom->Add(btn, 1, wxGROW, 0); sizerBottom->Add(btn, 1, wxGROW, 0);
@ -106,6 +108,22 @@ void CLogWindow::OnClear(wxCommandEvent& event)
NotifyUpdate(); NotifyUpdate();
} }
void CLogWindow::OnEnableAll(wxCommandEvent& event)
{
static bool enable = true;
IniFile ini;
ini.Load("Dolphin.ini");
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
{
m_checks->Check(i, enable);
LogManager::m_Log[i]->m_bEnable = enable;
LogManager::m_Log[i]->m_bShowInLog = enable;
ini.Set("LogManager", LogManager::m_Log[i]->m_szShortName, enable);
}
ini.Save("Dolphin.ini");
enable = !enable;
}
void CLogWindow::OnLogCheck(wxCommandEvent& event) void CLogWindow::OnLogCheck(wxCommandEvent& event)
{ {

View File

@ -46,6 +46,7 @@ class CLogWindow
void OnUpdateLog(wxCommandEvent& event); void OnUpdateLog(wxCommandEvent& event);
void OnLogCheck(wxCommandEvent& event); void OnLogCheck(wxCommandEvent& event);
void OnClear(wxCommandEvent& event); void OnClear(wxCommandEvent& event);
void OnEnableAll(wxCommandEvent& event);
void UpdateChecks(); void UpdateChecks();
void UpdateLog(); void UpdateLog();