summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2019-07-07 07:35:06 -0400
committerGitHub <noreply@github.com>2019-07-07 07:35:06 -0400
commit398aa2a9f976169c4ac8228f0969971f3e2ba2f3 (patch)
treed5526290d2c6552dfb6affaff63443ad8aaf60a7 /Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
parentba20d30a0567aa28f922aecf59cb1a02f854bffc (diff)
parent92a655c8b90c62255bcd3fcc160e240c98f79217 (diff)
Merge pull request #8231 from JosJuice/debugger-hidden
DolphinQt: Don't update debug widgets when hidden
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/RegisterWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Debugger/RegisterWidget.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
index 0c829ed6df..7d2c61d88b 100644
--- a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
@@ -38,14 +38,7 @@ RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent)
PopulateTable();
ConnectWidgets();
- connect(Host::GetInstance(), &Host::UpdateDisasmDialog, this, [this] {
- if (Settings::Instance().IsDebugModeEnabled() && Core::GetState() == Core::State::Paused)
- {
- m_updating = true;
- emit UpdateTable();
- m_updating = false;
- }
- });
+ connect(Host::GetInstance(), &Host::UpdateDisasmDialog, this, &RegisterWidget::Update);
connect(&Settings::Instance(), &Settings::RegistersVisibilityChanged,
[this](bool visible) { setHidden(!visible); });
@@ -68,6 +61,11 @@ void RegisterWidget::closeEvent(QCloseEvent*)
Settings::Instance().SetRegistersVisible(false);
}
+void RegisterWidget::showEvent(QShowEvent* event)
+{
+ Update();
+}
+
void RegisterWidget::CreateWidgets()
{
m_table = new QTableWidget;
@@ -375,3 +373,13 @@ void RegisterWidget::AddRegister(int row, int column, RegisterType type, std::st
connect(this, &RegisterWidget::UpdateTable, [value] { value->RefreshValue(); });
}
+
+void RegisterWidget::Update()
+{
+ if (isVisible() && Core::GetState() == Core::State::Paused)
+ {
+ m_updating = true;
+ emit UpdateTable();
+ m_updating = false;
+ }
+}