From 4f4ff00ecf2be05419a2e209000f81e060926582 Mon Sep 17 00:00:00 2001 From: chaoticgd <43898262+chaoticgd@users.noreply.github.com> Date: Wed, 26 Feb 2025 15:05:32 +0000 Subject: [PATCH] Debugger: Add System toolbar with shutdown and reset actions --- pcsx2-qt/Debugger/DebuggerWindow.cpp | 9 +++- pcsx2-qt/Debugger/DebuggerWindow.h | 4 -- pcsx2-qt/Debugger/DebuggerWindow.ui | 68 ++++++++++++++++++++++------ 3 files changed, 61 insertions(+), 20 deletions(-) diff --git a/pcsx2-qt/Debugger/DebuggerWindow.cpp b/pcsx2-qt/Debugger/DebuggerWindow.cpp index 32283908ec..6051cc7cd6 100644 --- a/pcsx2-qt/Debugger/DebuggerWindow.cpp +++ b/pcsx2-qt/Debugger/DebuggerWindow.cpp @@ -31,12 +31,19 @@ DebuggerWindow::DebuggerWindow(QWidget* parent) m_dock_manager->loadLayouts(); + connect(m_ui.actionShutDown, &QAction::triggered, []() { g_emu_thread->shutdownVM(false); }); + connect(m_ui.actionReset, &QAction::triggered, []() { g_emu_thread->resetVM(); }); + connect(m_ui.actionClose, &QAction::triggered, this, &DebuggerWindow::close); + connect(m_ui.actionRun, &QAction::triggered, this, &DebuggerWindow::onRunPause); connect(m_ui.actionStepInto, &QAction::triggered, this, &DebuggerWindow::onStepInto); connect(m_ui.actionStepOver, &QAction::triggered, this, &DebuggerWindow::onStepOver); connect(m_ui.actionStepOut, &QAction::triggered, this, &DebuggerWindow::onStepOut); connect(m_ui.actionAnalyse, &QAction::triggered, this, &DebuggerWindow::onAnalyse); - connect(m_ui.actionOnTop, &QAction::triggered, [this] { this->setWindowFlags(this->windowFlags() ^ Qt::WindowStaysOnTopHint); this->show(); }); + connect(m_ui.actionOnTop, &QAction::triggered, this, [this] { + setWindowFlags(this->windowFlags() ^ Qt::WindowStaysOnTopHint); + show(); + }); connect(m_ui.menuTools, &QMenu::aboutToShow, this, [this]() { m_dock_manager->createToolsMenu(m_ui.menuTools); diff --git a/pcsx2-qt/Debugger/DebuggerWindow.h b/pcsx2-qt/Debugger/DebuggerWindow.h index 425bb2fc24..4c0296cf3a 100644 --- a/pcsx2-qt/Debugger/DebuggerWindow.h +++ b/pcsx2-qt/Debugger/DebuggerWindow.h @@ -43,10 +43,6 @@ private: void setupDefaultToolBarState(); Ui::DebuggerWindow m_ui; - QAction* m_actionRunPause; - QAction* m_actionStepInto; - QAction* m_actionStepOver; - QAction* m_actionStepOut; DockManager* m_dock_manager; diff --git a/pcsx2-qt/Debugger/DebuggerWindow.ui b/pcsx2-qt/Debugger/DebuggerWindow.ui index 0f76916069..86844970df 100644 --- a/pcsx2-qt/Debugger/DebuggerWindow.ui +++ b/pcsx2-qt/Debugger/DebuggerWindow.ui @@ -19,27 +19,12 @@ - - Qt::PreventContextMenu - Debug - - true - - - - 16 - 16 - - Qt::ToolButtonTextBesideIcon - - true - TopToolBarArea @@ -65,6 +50,7 @@ File + @@ -109,6 +95,9 @@ View + + Qt::ToolButtonTextBesideIcon + TopToolBarArea @@ -117,6 +106,22 @@ + + + System + + + Qt::ToolButtonTextBesideIcon + + + TopToolBarArea + + + false + + + + @@ -195,6 +200,39 @@ Reset Splitter Positions + + + + + + Shut Down + + + QAction::NoRole + + + + + + + + Reset + + + QAction::NoRole + + + + + + + + Close + + + QAction::NoRole + +