From faa4be49c7e1136584774d1504e0188e2c77d3ce Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Sun, 4 Feb 2018 00:10:15 +0000 Subject: [PATCH] gui: Fix trace logging panel misc section behaviour This enables/disables the misc section when the master trace log toggle checkbox has changed state. --- pcsx2/gui/Panels/LogOptionsPanels.cpp | 9 +++++---- pcsx2/gui/Panels/LogOptionsPanels.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pcsx2/gui/Panels/LogOptionsPanels.cpp b/pcsx2/gui/Panels/LogOptionsPanels.cpp index a9a5cde453..aebda42b0b 100644 --- a/pcsx2/gui/Panels/LogOptionsPanels.cpp +++ b/pcsx2/gui/Panels/LogOptionsPanels.cpp @@ -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) diff --git a/pcsx2/gui/Panels/LogOptionsPanels.h b/pcsx2/gui/Panels/LogOptionsPanels.h index adf4be463f..020d1f2ed7 100644 --- a/pcsx2/gui/Panels/LogOptionsPanels.h +++ b/pcsx2/gui/Panels/LogOptionsPanels.h @@ -76,6 +76,7 @@ namespace Panels protected: eeLogOptionsPanel* m_eeSection; iopLogOptionsPanel* m_iopSection; + wxStaticBoxSizer* m_miscSection; pxCheckBox* m_masterEnabler;