gui: Fix apply button on Trace Logging dialog

Instead of binding all checkbox events to an event handler, bind only
the master trace log toggle checkbox event and continue processing the
event after it has been handled. This fixes the non-functional apply
button and is also more efficient.
This commit is contained in:
Jonathan Li 2018-02-04 00:09:11 +00:00
parent 629bb23832
commit c3dbc4e945
2 changed files with 3 additions and 9 deletions

View File

@ -265,7 +265,7 @@ Panels::LogOptionsPanel::LogOptionsPanel(wxWindow* parent )
*this += topSizer | StdExpand();
*this += s_misc | StdSpace().Centre();
Bind(wxEVT_CHECKBOX, &LogOptionsPanel::OnCheckBoxClicked, this);
Bind(wxEVT_CHECKBOX, &LogOptionsPanel::OnCheckBoxClicked, this, m_masterEnabler->GetWxPtr()->GetId());
}
Panels::BaseCpuLogOptionsPanel* Panels::LogOptionsPanel::GetCpuPanel( const wxString& token ) const
@ -303,22 +303,17 @@ void Panels::LogOptionsPanel::OnUpdateEnableAll()
void Panels::LogOptionsPanel::OnCheckBoxClicked(wxCommandEvent &evt)
{
m_IsDirty = true;
if( evt.GetId() == m_masterEnabler->GetWxPtr()->GetId() )
OnUpdateEnableAll();
evt.Skip();
}
void Panels::LogOptionsPanel::Apply()
{
if( !m_IsDirty ) return;
g_Conf->EmuOptions.Trace.Enabled = m_masterEnabler->GetValue();
m_eeSection->Apply();
m_iopSection->Apply();
m_IsDirty = false;
for( uint i = 0; i<traceLogCount; ++i )
{
if (!traceLogList[i] || !m_checks[i]) continue;

View File

@ -76,7 +76,6 @@ namespace Panels
protected:
eeLogOptionsPanel* m_eeSection;
iopLogOptionsPanel* m_iopSection;
bool m_IsDirty; // any settings modified since last apply will flag this "true"
pxCheckBox* m_masterEnabler;