gui: Fix trace logging panel misc section behaviour

This enables/disables the misc section when the master trace log toggle
checkbox has changed state.
This commit is contained in:
Jonathan Li 2018-02-04 00:10:15 +00:00
parent 8dfeeb354f
commit faa4be49c7
2 changed files with 6 additions and 4 deletions

View File

@ -206,7 +206,7 @@ Panels::LogOptionsPanel::LogOptionsPanel(wxWindow* parent )
: BaseApplicableConfigPanel( parent )
, m_checks( new pxCheckBox*[traceLogCount] )
{
wxStaticBoxSizer& s_misc = *new wxStaticBoxSizer( wxHORIZONTAL, this, L"Misc" );
m_miscSection = new wxStaticBoxSizer( wxHORIZONTAL, this, L"Misc" );
m_eeSection = new eeLogOptionsPanel( this );
m_iopSection = new iopLogOptionsPanel( this );
@ -238,8 +238,8 @@ Panels::LogOptionsPanel::LogOptionsPanel(wxWindow* parent )
}
else
{
addsizer = &s_misc;
addparent = this;
addsizer = m_miscSection;
addparent = m_miscSection->GetStaticBox();
}
*addsizer += m_checks[i] = new pxCheckBox( addparent, item.GetName() );
@ -263,7 +263,7 @@ Panels::LogOptionsPanel::LogOptionsPanel(wxWindow* parent )
*this += new wxStaticLine( this ) | StdExpand().Border(wxLEFT | wxRIGHT, 20);
*this += 5;
*this += topSizer | StdExpand();
*this += s_misc | StdSpace().Centre();
*this += m_miscSection | StdSpace().Centre();
Bind(wxEVT_CHECKBOX, &LogOptionsPanel::OnCheckBoxClicked, this, m_masterEnabler->GetWxPtr()->GetId());
}
@ -299,6 +299,7 @@ void Panels::LogOptionsPanel::OnUpdateEnableAll()
m_eeSection->Enable( enabled );
m_iopSection->Enable( enabled );
m_miscSection->GetStaticBox()->Enable( enabled );
}
void Panels::LogOptionsPanel::OnCheckBoxClicked(wxCommandEvent &evt)

View File

@ -76,6 +76,7 @@ namespace Panels
protected:
eeLogOptionsPanel* m_eeSection;
iopLogOptionsPanel* m_iopSection;
wxStaticBoxSizer* m_miscSection;
pxCheckBox* m_masterEnabler;