mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-03 19:42:45 +01:00
MemoryWidget: Add "Add to watch" action
This commit is contained in:
parent
bbcaede389
commit
e3d85ffe35
@ -403,6 +403,11 @@ void MemoryViewWidget::OnContextMenu()
|
|||||||
|
|
||||||
menu->addSeparator();
|
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->addAction(tr("Toggle Breakpoint"), this, &MemoryViewWidget::ToggleBreakpoint);
|
||||||
|
|
||||||
menu->exec(QCursor::pos());
|
menu->exec(QCursor::pos());
|
||||||
|
@ -57,6 +57,7 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void BreakpointsChanged();
|
void BreakpointsChanged();
|
||||||
void ShowCode(u32 address);
|
void ShowCode(u32 address);
|
||||||
|
void RequestWatch(QString name, u32 address);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnContextMenu();
|
void OnContextMenu();
|
||||||
|
@ -272,6 +272,7 @@ void MemoryWidget::ConnectWidgets()
|
|||||||
connect(m_memory_view, &MemoryViewWidget::BreakpointsChanged, this,
|
connect(m_memory_view, &MemoryViewWidget::BreakpointsChanged, this,
|
||||||
&MemoryWidget::BreakpointsChanged);
|
&MemoryWidget::BreakpointsChanged);
|
||||||
connect(m_memory_view, &MemoryViewWidget::ShowCode, this, &MemoryWidget::ShowCode);
|
connect(m_memory_view, &MemoryViewWidget::ShowCode, this, &MemoryWidget::ShowCode);
|
||||||
|
connect(m_memory_view, &MemoryViewWidget::RequestWatch, this, &MemoryWidget::RequestWatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryWidget::closeEvent(QCloseEvent*)
|
void MemoryWidget::closeEvent(QCloseEvent*)
|
||||||
|
@ -31,6 +31,7 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void BreakpointsChanged();
|
void BreakpointsChanged();
|
||||||
void ShowCode(u32 address);
|
void ShowCode(u32 address);
|
||||||
|
void RequestWatch(QString name, u32 address);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateWidgets();
|
void CreateWidgets();
|
||||||
|
@ -442,6 +442,7 @@ void MainWindow::CreateComponents()
|
|||||||
connect(m_memory_widget, &MemoryWidget::ShowCode, m_code_widget, [this](u32 address) {
|
connect(m_memory_widget, &MemoryWidget::ShowCode, m_code_widget, [this](u32 address) {
|
||||||
m_code_widget->SetAddress(address, CodeViewWidget::SetAddressUpdate::WithDetailedUpdate);
|
m_code_widget->SetAddress(address, CodeViewWidget::SetAddressUpdate::WithDetailedUpdate);
|
||||||
});
|
});
|
||||||
|
connect(m_memory_widget, &MemoryWidget::RequestWatch, request_watch);
|
||||||
|
|
||||||
connect(m_breakpoint_widget, &BreakpointWidget::BreakpointsChanged, m_code_widget,
|
connect(m_breakpoint_widget, &BreakpointWidget::BreakpointsChanged, m_code_widget,
|
||||||
&CodeWidget::Update);
|
&CodeWidget::Update);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user