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/WatchWidget.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/WatchWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/WatchWidget.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/Source/Core/DolphinQt/Debugger/WatchWidget.cpp b/Source/Core/DolphinQt/Debugger/WatchWidget.cpp index c122318f20..3a19ed26a4 100644 --- a/Source/Core/DolphinQt/Debugger/WatchWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/WatchWidget.cpp @@ -43,12 +43,7 @@ WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent) ConnectWidgets(); connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this](Core::State state) { - if (!Settings::Instance().IsDebugModeEnabled()) - return; - - m_load->setEnabled(Core::IsRunning()); - m_save->setEnabled(Core::IsRunning()); - + UpdateButtonsEnabled(); if (state != Core::State::Starting) Update(); }); @@ -61,8 +56,6 @@ WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent) connect(&Settings::Instance(), &Settings::ThemeChanged, this, &WatchWidget::UpdateIcons); UpdateIcons(); - - Update(); } WatchWidget::~WatchWidget() @@ -117,8 +110,20 @@ void WatchWidget::UpdateIcons() m_save->setIcon(Resources::GetScaledThemeIcon("debugger_save")); } +void WatchWidget::UpdateButtonsEnabled() +{ + if (!isVisible()) + return; + + m_load->setEnabled(Core::IsRunning()); + m_save->setEnabled(Core::IsRunning()); +} + void WatchWidget::Update() { + if (!isVisible()) + return; + m_updating = true; m_table->clear(); @@ -200,6 +205,12 @@ void WatchWidget::closeEvent(QCloseEvent*) Settings::Instance().SetWatchVisible(false); } +void WatchWidget::showEvent(QShowEvent* event) +{ + UpdateButtonsEnabled(); + Update(); +} + void WatchWidget::OnLoad() { IniFile ini; |
