diff options
| author | JMC47 <JMC4789@gmail.com> | 2025-07-16 14:32:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-16 14:32:21 -0400 |
| commit | c2bace5967384140a67c1b1529f9b3fb3dddf83f (patch) | |
| tree | fb2fa880d6efd59949f1f129078d13a7d94d6a6e /Source/Core/DolphinQt/Debugger/CodeWidget.cpp | |
| parent | 5674afa63d86308caa5a1a0cbebac7dd3ab031e9 (diff) | |
| parent | d53e766d6595d8cdd74f1f8316c82f7fa9e7bb3e (diff) | |
Merge pull request #13798 from TryTwo/PR_CodeWidget_NoUpdate
CodeWidget: Add button that locks the view's address
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/CodeWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/CodeWidget.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp index 002ea47570..e5aaa1c2cd 100644 --- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp @@ -18,6 +18,7 @@ #include <QStyleHints> #include <QTabWidget> #include <QTableWidget> +#include <QToolButton> #include <QVBoxLayout> #include <QWidget> @@ -31,6 +32,7 @@ #include "Core/System.h" #include "DolphinQt/Debugger/BranchWatchDialog.h" #include "DolphinQt/Host.h" +#include "DolphinQt/Resources.h" #include "DolphinQt/Settings.h" static const QString BOX_SPLITTER_STYLESHEET = QStringLiteral( @@ -61,7 +63,7 @@ CodeWidget::CodeWidget(QWidget* parent) [this](bool visible) { setHidden(!visible); }); connect(Host::GetInstance(), &Host::UpdateDisasmDialog, this, [this] { - if (Core::GetState(m_system) == Core::State::Paused) + if (!m_lock_btn->isChecked() && Core::GetState(m_system) == Core::State::Paused) SetAddress(m_system.GetPPCState().pc, CodeViewWidget::SetAddressUpdate::WithoutUpdate); Update(); }); @@ -109,8 +111,16 @@ void CodeWidget::CreateWidgets() auto* top_layout = new QHBoxLayout; m_search_address = new QLineEdit; m_search_address->setPlaceholderText(tr("Search Address")); + + m_lock_btn = new QToolButton(); + m_lock_btn->setIcon(Resources::GetThemeIcon("pause")); + m_lock_btn->setCheckable(true); + m_lock_btn->setMinimumSize(24, 24); + m_lock_btn->setToolTip(tr("When enabled, prevents automatic updates to the code view.")); m_branch_watch = new QPushButton(tr("Branch Watch")); + top_layout->addWidget(m_search_address); + top_layout->addWidget(m_lock_btn); top_layout->addWidget(m_branch_watch); auto* right_layout = new QVBoxLayout; @@ -191,6 +201,7 @@ void CodeWidget::ConnectWidgets() connect(m_search_address, &QLineEdit::textChanged, this, &CodeWidget::OnSearchAddress); connect(m_search_address, &QLineEdit::returnPressed, this, &CodeWidget::OnSearchAddress); + connect(m_lock_btn, &QPushButton::toggled, m_code_view, &CodeViewWidget::OnLockAddress); connect(m_search_symbols, &QLineEdit::textChanged, this, &CodeWidget::OnSearchSymbols); connect(m_search_calls, &QLineEdit::textChanged, this, [this] { if (const Common::Symbol* symbol = m_ppc_symbol_db.GetSymbolFromAddr(m_code_view->GetAddress())) |
