diff options
| author | JMC47 <JMC4789@gmail.com> | 2019-07-07 07:35:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-07 07:35:06 -0400 |
| commit | 398aa2a9f976169c4ac8228f0969971f3e2ba2f3 (patch) | |
| tree | d5526290d2c6552dfb6affaff63443ad8aaf60a7 /Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp | |
| parent | ba20d30a0567aa28f922aecf59cb1a02f854bffc (diff) | |
| parent | 92a655c8b90c62255bcd3fcc160e240c98f79217 (diff) | |
Merge pull request #8231 from JosJuice/debugger-hidden
DolphinQt: Don't update debug widgets when hidden
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp index d855b1af3a..66d178c5b2 100644 --- a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp @@ -41,14 +41,8 @@ BreakpointWidget::BreakpointWidget(QWidget* parent) : QDockWidget(parent) CreateWidgets(); connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this](Core::State state) { - if (!Settings::Instance().IsDebugModeEnabled()) - return; - - bool is_initialised = state != Core::State::Uninitialized; - m_new->setEnabled(is_initialised); - m_load->setEnabled(is_initialised); - m_save->setEnabled(is_initialised); - if (!is_initialised) + UpdateButtonsEnabled(); + if (state == Core::State::Uninitialized) { PowerPC::breakpoints.Clear(); PowerPC::memchecks.Clear(); @@ -65,8 +59,6 @@ BreakpointWidget::BreakpointWidget(QWidget* parent) : QDockWidget(parent) connect(&Settings::Instance(), &Settings::ThemeChanged, this, &BreakpointWidget::UpdateIcons); UpdateIcons(); - - Update(); } BreakpointWidget::~BreakpointWidget() @@ -138,8 +130,28 @@ void BreakpointWidget::closeEvent(QCloseEvent*) Settings::Instance().SetBreakpointsVisible(false); } +void BreakpointWidget::showEvent(QShowEvent* event) +{ + UpdateButtonsEnabled(); + Update(); +} + +void BreakpointWidget::UpdateButtonsEnabled() +{ + if (!isVisible()) + return; + + const bool is_initialised = Core::GetState() != Core::State::Uninitialized; + m_new->setEnabled(is_initialised); + m_load->setEnabled(is_initialised); + m_save->setEnabled(is_initialised); +} + void BreakpointWidget::Update() { + if (!isVisible()) + return; + m_table->clear(); m_table->setHorizontalHeaderLabels( |
