mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
MemoryWidget: Add "Add to watch" action
This commit is contained in:
@ -403,6 +403,11 @@ void MemoryViewWidget::OnContextMenu()
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(tr("Add to watch"), this, [this] {
|
||||
const u32 address = GetContextAddress();
|
||||
const QString name = QStringLiteral("mem_%1").arg(address, 8, 16, QLatin1Char('0'));
|
||||
emit RequestWatch(name, address);
|
||||
});
|
||||
menu->addAction(tr("Toggle Breakpoint"), this, &MemoryViewWidget::ToggleBreakpoint);
|
||||
|
||||
menu->exec(QCursor::pos());
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
signals:
|
||||
void BreakpointsChanged();
|
||||
void ShowCode(u32 address);
|
||||
void RequestWatch(QString name, u32 address);
|
||||
|
||||
private:
|
||||
void OnContextMenu();
|
||||
|
@ -272,6 +272,7 @@ void MemoryWidget::ConnectWidgets()
|
||||
connect(m_memory_view, &MemoryViewWidget::BreakpointsChanged, this,
|
||||
&MemoryWidget::BreakpointsChanged);
|
||||
connect(m_memory_view, &MemoryViewWidget::ShowCode, this, &MemoryWidget::ShowCode);
|
||||
connect(m_memory_view, &MemoryViewWidget::RequestWatch, this, &MemoryWidget::RequestWatch);
|
||||
}
|
||||
|
||||
void MemoryWidget::closeEvent(QCloseEvent*)
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
signals:
|
||||
void BreakpointsChanged();
|
||||
void ShowCode(u32 address);
|
||||
void RequestWatch(QString name, u32 address);
|
||||
|
||||
private:
|
||||
void CreateWidgets();
|
||||
|
Reference in New Issue
Block a user