diff --git a/pcsx2-qt/CMakeLists.txt b/pcsx2-qt/CMakeLists.txt index 0f0ee4b9a3..c288bec507 100644 --- a/pcsx2-qt/CMakeLists.txt +++ b/pcsx2-qt/CMakeLists.txt @@ -164,8 +164,8 @@ target_sources(pcsx2-qt PRIVATE Debugger/DebuggerSettingsManager.cpp Debugger/DebuggerSettingsManager.h Debugger/DebuggerEvents.h - Debugger/DebuggerWidget.cpp - Debugger/DebuggerWidget.h + Debugger/DebuggerView.cpp + Debugger/DebuggerView.h Debugger/DebuggerWindow.cpp Debugger/DebuggerWindow.h Debugger/DebuggerWindow.ui diff --git a/pcsx2-qt/Debugger/Breakpoints/BreakpointWidget.cpp b/pcsx2-qt/Debugger/Breakpoints/BreakpointWidget.cpp index 41a97d0a90..66e5773044 100644 --- a/pcsx2-qt/Debugger/Breakpoints/BreakpointWidget.cpp +++ b/pcsx2-qt/Debugger/Breakpoints/BreakpointWidget.cpp @@ -10,8 +10,8 @@ #include -BreakpointWidget::BreakpointWidget(const DebuggerWidgetParameters& parameters) - : DebuggerWidget(parameters, DISALLOW_MULTIPLE_INSTANCES) +BreakpointWidget::BreakpointWidget(const DebuggerViewParameters& parameters) + : DebuggerView(parameters, DISALLOW_MULTIPLE_INSTANCES) , m_model(BreakpointModel::getInstance(cpu())) { m_ui.setupUi(this); diff --git a/pcsx2-qt/Debugger/Breakpoints/BreakpointWidget.h b/pcsx2-qt/Debugger/Breakpoints/BreakpointWidget.h index 479bdf247f..fd84196c24 100644 --- a/pcsx2-qt/Debugger/Breakpoints/BreakpointWidget.h +++ b/pcsx2-qt/Debugger/Breakpoints/BreakpointWidget.h @@ -7,7 +7,7 @@ #include "BreakpointModel.h" -#include "Debugger/DebuggerWidget.h" +#include "Debugger/DebuggerView.h" #include "DebugTools/DebugInterface.h" #include "DebugTools/DisassemblyManager.h" @@ -16,12 +16,12 @@ #include #include -class BreakpointWidget : public DebuggerWidget +class BreakpointWidget : public DebuggerView { Q_OBJECT public: - BreakpointWidget(const DebuggerWidgetParameters& parameters); + BreakpointWidget(const DebuggerViewParameters& parameters); void onDoubleClicked(const QModelIndex& index); void openContextMenu(QPoint pos); diff --git a/pcsx2-qt/Debugger/DebuggerEvents.h b/pcsx2-qt/Debugger/DebuggerEvents.h index c614b52908..04db07040c 100644 --- a/pcsx2-qt/Debugger/DebuggerEvents.h +++ b/pcsx2-qt/Debugger/DebuggerEvents.h @@ -14,8 +14,8 @@ namespace DebuggerEvents virtual ~Event() = default; }; - // Sent when a debugger widget is first created, and subsequently broadcast - // to all debugger widgets at regular intervals. + // Sent when a debugger view is first created, and subsequently broadcast to + // all debugger views at regular intervals. struct Refresh : Event { }; @@ -41,7 +41,7 @@ namespace DebuggerEvents static constexpr const char* ACTION_PREFIX = QT_TRANSLATE_NOOP("DebuggerEvents", "Go to in"); }; - // The state of the VM has changed and widgets should be updated to reflect + // The state of the VM has changed and views should be updated to reflect // the new state (e.g. the VM has been paused). struct VMUpdate : Event { diff --git a/pcsx2-qt/Debugger/DebuggerWidget.cpp b/pcsx2-qt/Debugger/DebuggerView.cpp similarity index 72% rename from pcsx2-qt/Debugger/DebuggerWidget.cpp rename to pcsx2-qt/Debugger/DebuggerView.cpp index 218c7cfd87..7568f196ed 100644 --- a/pcsx2-qt/Debugger/DebuggerWidget.cpp +++ b/pcsx2-qt/Debugger/DebuggerView.cpp @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team // SPDX-License-Identifier: GPL-3.0+ -#include "DebuggerWidget.h" +#include "DebuggerView.h" #include "Debugger/DebuggerWindow.h" #include "Debugger/JsonValueWrapper.h" @@ -12,7 +12,7 @@ #include "common/Assertions.h" -DebuggerWidget::DebuggerWidget(const DebuggerWidgetParameters& parameters, u32 flags) +DebuggerView::DebuggerView(const DebuggerViewParameters& parameters, u32 flags) : QWidget(parameters.parent) , m_id(parameters.id) , m_unique_name(parameters.unique_name) @@ -23,30 +23,30 @@ DebuggerWidget::DebuggerWidget(const DebuggerWidgetParameters& parameters, u32 f updateStyleSheet(); } -DebugInterface& DebuggerWidget::cpu() const +DebugInterface& DebuggerView::cpu() const { if (m_cpu_override.has_value()) return DebugInterface::get(*m_cpu_override); - pxAssertRel(m_cpu, "DebuggerWidget::cpu called on object with null cpu."); + pxAssertRel(m_cpu, "DebuggerView::cpu called on object with null cpu."); return *m_cpu; } -QString DebuggerWidget::uniqueName() const +QString DebuggerView::uniqueName() const { return m_unique_name; } -u64 DebuggerWidget::id() const +u64 DebuggerView::id() const { return m_id; } -QString DebuggerWidget::displayName() const +QString DebuggerView::displayName() const { QString name = displayNameWithoutSuffix(); - // If there are multiple debugger widgets of the same name, append a number + // If there are multiple debugger views with the same name, append a number // to the display name. if (m_display_name_suffix_number.has_value()) name = tr("%1 #%2").arg(name).arg(*m_display_name_suffix_number); @@ -57,17 +57,17 @@ QString DebuggerWidget::displayName() const return name; } -QString DebuggerWidget::displayNameWithoutSuffix() const +QString DebuggerView::displayNameWithoutSuffix() const { return m_translated_display_name; } -QString DebuggerWidget::customDisplayName() const +QString DebuggerView::customDisplayName() const { return m_custom_display_name; } -bool DebuggerWidget::setCustomDisplayName(QString display_name) +bool DebuggerView::setCustomDisplayName(QString display_name) { if (display_name.size() > DockUtils::MAX_DOCK_WIDGET_NAME_SIZE) return false; @@ -76,17 +76,17 @@ bool DebuggerWidget::setCustomDisplayName(QString display_name) return true; } -bool DebuggerWidget::isPrimary() const +bool DebuggerView::isPrimary() const { return m_is_primary; } -void DebuggerWidget::setPrimary(bool is_primary) +void DebuggerView::setPrimary(bool is_primary) { m_is_primary = is_primary; } -bool DebuggerWidget::setCpu(DebugInterface& new_cpu) +bool DebuggerView::setCpu(DebugInterface& new_cpu) { BreakPointCpu before = cpu().getCpuType(); m_cpu = &new_cpu; @@ -94,12 +94,12 @@ bool DebuggerWidget::setCpu(DebugInterface& new_cpu) return before == after; } -std::optional DebuggerWidget::cpuOverride() const +std::optional DebuggerView::cpuOverride() const { return m_cpu_override; } -bool DebuggerWidget::setCpuOverride(std::optional new_cpu) +bool DebuggerView::setCpuOverride(std::optional new_cpu) { BreakPointCpu before = cpu().getCpuType(); m_cpu_override = new_cpu; @@ -107,7 +107,7 @@ bool DebuggerWidget::setCpuOverride(std::optional new_cpu) return before == after; } -bool DebuggerWidget::handleEvent(const DebuggerEvents::Event& event) +bool DebuggerView::handleEvent(const DebuggerEvents::Event& event) { auto [begin, end] = m_event_handlers.equal_range(typeid(event).name()); for (auto handler = begin; handler != end; handler++) @@ -117,14 +117,14 @@ bool DebuggerWidget::handleEvent(const DebuggerEvents::Event& event) return false; } -bool DebuggerWidget::acceptsEventType(const char* event_type) +bool DebuggerView::acceptsEventType(const char* event_type) { auto [begin, end] = m_event_handlers.equal_range(event_type); return begin != end; } -void DebuggerWidget::toJson(JsonValueWrapper& json) +void DebuggerView::toJson(JsonValueWrapper& json) { std::string custom_display_name_str = m_custom_display_name.toStdString(); rapidjson::Value custom_display_name; @@ -134,7 +134,7 @@ void DebuggerWidget::toJson(JsonValueWrapper& json) json.value().AddMember("isPrimary", m_is_primary, json.allocator()); } -bool DebuggerWidget::fromJson(const JsonValueWrapper& json) +bool DebuggerView::fromJson(const JsonValueWrapper& json) { auto custom_display_name = json.value().FindMember("customDisplayName"); if (custom_display_name != json.value().MemberEnd() && custom_display_name->value.IsString()) @@ -150,17 +150,17 @@ bool DebuggerWidget::fromJson(const JsonValueWrapper& json) return true; } -void DebuggerWidget::switchToThisTab() +void DebuggerView::switchToThisTab() { - g_debugger_window->dockManager().switchToDebuggerWidget(this); + g_debugger_window->dockManager().switchToDebuggerView(this); } -bool DebuggerWidget::supportsMultipleInstances() +bool DebuggerView::supportsMultipleInstances() { return !(m_flags & DISALLOW_MULTIPLE_INSTANCES); } -void DebuggerWidget::retranslateDisplayName() +void DebuggerView::retranslateDisplayName() { if (!m_custom_display_name.isEmpty()) { @@ -168,25 +168,25 @@ void DebuggerWidget::retranslateDisplayName() } else { - auto description = DockTables::DEBUGGER_WIDGETS.find(metaObject()->className()); - if (description != DockTables::DEBUGGER_WIDGETS.end()) - m_translated_display_name = QCoreApplication::translate("DebuggerWidget", description->second.display_name); + auto description = DockTables::DEBUGGER_VIEWS.find(metaObject()->className()); + if (description != DockTables::DEBUGGER_VIEWS.end()) + m_translated_display_name = QCoreApplication::translate("DebuggerView", description->second.display_name); else m_translated_display_name = QString(); } } -std::optional DebuggerWidget::displayNameSuffixNumber() const +std::optional DebuggerView::displayNameSuffixNumber() const { return m_display_name_suffix_number; } -void DebuggerWidget::setDisplayNameSuffixNumber(std::optional suffix_number) +void DebuggerView::setDisplayNameSuffixNumber(std::optional suffix_number) { m_display_name_suffix_number = suffix_number; } -void DebuggerWidget::updateStyleSheet() +void DebuggerView::updateStyleSheet() { QString stylesheet; @@ -211,48 +211,48 @@ void DebuggerWidget::updateStyleSheet() setStyleSheet(stylesheet); } -void DebuggerWidget::goToInDisassembler(u32 address, bool switch_to_tab) +void DebuggerView::goToInDisassembler(u32 address, bool switch_to_tab) { DebuggerEvents::GoToAddress event; event.address = address; event.filter = DebuggerEvents::GoToAddress::DISASSEMBLER; event.switch_to_tab = switch_to_tab; - DebuggerWidget::sendEvent(std::move(event)); + DebuggerView::sendEvent(std::move(event)); } -void DebuggerWidget::goToInMemoryView(u32 address, bool switch_to_tab) +void DebuggerView::goToInMemoryView(u32 address, bool switch_to_tab) { DebuggerEvents::GoToAddress event; event.address = address; event.filter = DebuggerEvents::GoToAddress::MEMORY_VIEW; event.switch_to_tab = switch_to_tab; - DebuggerWidget::sendEvent(std::move(event)); + DebuggerView::sendEvent(std::move(event)); } -void DebuggerWidget::sendEventImplementation(const DebuggerEvents::Event& event) +void DebuggerView::sendEventImplementation(const DebuggerEvents::Event& event) { if (!g_debugger_window) return; - for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerWidgets()) + for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerViews()) if (widget->isPrimary() && widget->handleEvent(event)) return; - for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerWidgets()) + for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerViews()) if (!widget->isPrimary() && widget->handleEvent(event)) return; } -void DebuggerWidget::broadcastEventImplementation(const DebuggerEvents::Event& event) +void DebuggerView::broadcastEventImplementation(const DebuggerEvents::Event& event) { if (!g_debugger_window) return; - for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerWidgets()) + for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerViews()) widget->handleEvent(event); } -std::vector DebuggerWidget::createEventActionsImplementation( +std::vector DebuggerView::createEventActionsImplementation( QMenu* menu, u32 max_top_level_actions, bool skip_self, @@ -263,12 +263,12 @@ std::vector DebuggerWidget::createEventActionsImplementation( if (!g_debugger_window) return {}; - std::vector receivers; - for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerWidgets()) + std::vector receivers; + for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerViews()) if ((!skip_self || widget != this) && widget->acceptsEventType(event_type)) receivers.emplace_back(widget); - std::sort(receivers.begin(), receivers.end(), [&](const DebuggerWidget* lhs, const DebuggerWidget* rhs) { + std::sort(receivers.begin(), receivers.end(), [&](const DebuggerView* lhs, const DebuggerView* rhs) { if (lhs->displayNameWithoutSuffix() == rhs->displayNameWithoutSuffix()) return lhs->displayNameSuffixNumber() < rhs->displayNameSuffixNumber(); @@ -285,7 +285,7 @@ std::vector DebuggerWidget::createEventActionsImplementation( std::vector actions; for (size_t i = 0; i < receivers.size(); i++) { - DebuggerWidget* receiver = receivers[i]; + DebuggerView* receiver = receivers[i]; QAction* action; if (!submenu || i + 1 < max_top_level_actions) diff --git a/pcsx2-qt/Debugger/DebuggerWidget.h b/pcsx2-qt/Debugger/DebuggerView.h similarity index 87% rename from pcsx2-qt/Debugger/DebuggerWidget.h rename to pcsx2-qt/Debugger/DebuggerView.h index a17695198b..6b0a8265fc 100644 --- a/pcsx2-qt/Debugger/DebuggerWidget.h +++ b/pcsx2-qt/Debugger/DebuggerView.h @@ -12,8 +12,8 @@ class JsonValueWrapper; -// Container for variables to be passed to the constructor of DebuggerWidget. -struct DebuggerWidgetParameters +// Container for variables to be passed to the constructor of DebuggerView. +struct DebuggerViewParameters { QString unique_name; u64 id = 0; @@ -23,7 +23,7 @@ struct DebuggerWidgetParameters }; // The base class for the contents of the dock widgets in the debugger. -class DebuggerWidget : public QWidget +class DebuggerView : public QWidget { Q_OBJECT @@ -31,7 +31,7 @@ public: QString uniqueName() const; u64 id() const; - // Get the translated name that should be displayed for this widget. + // Get the translated name that should be displayed for this view. QString displayName() const; QString displayNameWithoutSuffix() const; @@ -41,30 +41,30 @@ public: bool isPrimary() const; void setPrimary(bool is_primary); - // Get the effective debug interface associated with this particular widget + // Get the effective debug interface associated with this particular view // if it's set, otherwise return the one associated with the layout that - // contains this widget. + // contains this view. DebugInterface& cpu() const; // Set the debug interface associated with the layout. If false is returned, // we have to recreate the object. bool setCpu(DebugInterface& new_cpu); - // Get the CPU associated with this particular widget. + // Get the CPU associated with this particular view. std::optional cpuOverride() const; // Set the CPU associated with the individual dock widget. If false is // returned, we have to recreate the object. bool setCpuOverride(std::optional new_cpu); - // Send each open debugger widget an event in turn, until one handles it. + // Send each open debugger view an event in turn, until one handles it. template static void sendEvent(Event event) { if (!QtHost::IsOnUIThread()) { QtHost::RunOnUIThread([event = std::move(event)]() { - DebuggerWidget::sendEventImplementation(event); + DebuggerView::sendEventImplementation(event); }); return; } @@ -72,14 +72,14 @@ public: sendEventImplementation(event); } - // Send all open debugger widgets an event. + // Send all open debugger views an event. template static void broadcastEvent(Event event) { if (!QtHost::IsOnUIThread()) { QtHost::RunOnUIThread([event = std::move(event)]() { - DebuggerWidget::broadcastEventImplementation(event); + DebuggerView::broadcastEventImplementation(event); }); return; } @@ -112,10 +112,10 @@ public: // Call the handler callback for the specified event. bool handleEvent(const DebuggerEvents::Event& event); - // Check if this debugger widget can receive the specified type of event. + // Check if this debugger view can receive the specified type of event. bool acceptsEventType(const char* event_type); - // Generates context menu actions to send an event to each debugger widget + // Generates context menu actions to send an event to each debugger view // that can receive it. A submenu is generated if the number of possible // receivers exceeds max_top_level_actions. If skip_self is true, actions // are only generated if the sender and receiver aren't the same object. @@ -165,7 +165,7 @@ protected: MONOSPACE_FONT = 1 << 1 }; - DebuggerWidget(const DebuggerWidgetParameters& parameters, u32 flags); + DebuggerView(const DebuggerViewParameters& parameters, u32 flags); private: static void sendEventImplementation(const DebuggerEvents::Event& event); @@ -179,7 +179,7 @@ private: const char* action_prefix, std::function event_func); - // Used for sorting debugger widgets that have the same display name. Unique + // Used for sorting debugger views that have the same display name. Unique // within a single layout. u64 m_id; @@ -194,7 +194,7 @@ private: QString m_translated_display_name; std::optional m_display_name_suffix_number; - // Primary debugger widgets will be chosen to handle events first. For + // Primary debugger views will be chosen to handle events first. For // example, clicking on an address to go to it in the primary memory view. bool m_is_primary = false; diff --git a/pcsx2-qt/Debugger/DebuggerWindow.cpp b/pcsx2-qt/Debugger/DebuggerWindow.cpp index abd450f2cb..985ef6886e 100644 --- a/pcsx2-qt/Debugger/DebuggerWindow.cpp +++ b/pcsx2-qt/Debugger/DebuggerWindow.cpp @@ -3,7 +3,7 @@ #include "DebuggerWindow.h" -#include "Debugger/DebuggerWidget.h" +#include "Debugger/DebuggerView.h" #include "Debugger/Docking/DockManager.h" #include "DebugTools/DebugInterface.h" @@ -86,7 +86,7 @@ DebuggerWindow::DebuggerWindow(QWidget* parent) }); connect(g_emu_thread, &EmuThread::onVMPaused, this, []() { - DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate()); + DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); }); connect(g_emu_thread, &EmuThread::onVMStarting, this, &DebuggerWindow::onVMStarting); @@ -290,7 +290,7 @@ void DebuggerWindow::updateFromSettings() { m_refresh_timer = new QTimer(this); connect(m_refresh_timer, &QTimer::timeout, this, []() { - DebuggerWidget::broadcastEvent(DebuggerEvents::Refresh()); + DebuggerView::broadcastEvent(DebuggerEvents::Refresh()); }); m_refresh_timer->start(effective_refresh_interval); } diff --git a/pcsx2-qt/Debugger/DisassemblyWidget.cpp b/pcsx2-qt/Debugger/DisassemblyWidget.cpp index 7a640fe278..90ab4b875c 100644 --- a/pcsx2-qt/Debugger/DisassemblyWidget.cpp +++ b/pcsx2-qt/Debugger/DisassemblyWidget.cpp @@ -24,8 +24,8 @@ using namespace QtUtils; -DisassemblyWidget::DisassemblyWidget(const DebuggerWidgetParameters& parameters) - : DebuggerWidget(parameters, MONOSPACE_FONT) +DisassemblyWidget::DisassemblyWidget(const DebuggerViewParameters& parameters) + : DebuggerView(parameters, MONOSPACE_FONT) { m_ui.setupUi(this); @@ -62,7 +62,7 @@ DisassemblyWidget::~DisassemblyWidget() = default; void DisassemblyWidget::toJson(JsonValueWrapper& json) { - DebuggerWidget::toJson(json); + DebuggerView::toJson(json); json.value().AddMember("startAddress", m_visibleStart, json.allocator()); json.value().AddMember("goToPCOnPause", m_goToProgramCounterOnPause, json.allocator()); @@ -71,7 +71,7 @@ void DisassemblyWidget::toJson(JsonValueWrapper& json) bool DisassemblyWidget::fromJson(const JsonValueWrapper& json) { - if (!DebuggerWidget::fromJson(json)) + if (!DebuggerView::fromJson(json)) return false; auto start_address = json.value().FindMember("startAddress"); @@ -140,7 +140,7 @@ void DisassemblyWidget::contextAssembleInstruction() this->m_nopedInstructions.insert({i, cpu->read32(i)}); cpu->write32(i, val); } - DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate()); + DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); }); } } @@ -153,7 +153,7 @@ void DisassemblyWidget::contextNoopInstruction() this->m_nopedInstructions.insert({i, cpu->read32(i)}); cpu->write32(i, 0x00); } - DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate()); + DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); }); } @@ -168,7 +168,7 @@ void DisassemblyWidget::contextRestoreInstruction() this->m_nopedInstructions.erase(i); } } - DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate()); + DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); }); } @@ -298,7 +298,7 @@ void DisassemblyWidget::contextStubFunction() this->m_stubbedFunctions.insert({address, {cpu->read32(address), cpu->read32(address + 4)}}); cpu->write32(address, 0x03E00008); // jr ra cpu->write32(address + 4, 0x00000000); // nop - DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate()); + DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); }); } @@ -319,7 +319,7 @@ void DisassemblyWidget::contextRestoreFunction() cpu->write32(address, first_instruction); cpu->write32(address + 4, second_instruction); this->m_stubbedFunctions.erase(address); - DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate()); + DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); }); } else diff --git a/pcsx2-qt/Debugger/DisassemblyWidget.h b/pcsx2-qt/Debugger/DisassemblyWidget.h index a47263fc56..8c963242b9 100644 --- a/pcsx2-qt/Debugger/DisassemblyWidget.h +++ b/pcsx2-qt/Debugger/DisassemblyWidget.h @@ -5,19 +5,19 @@ #include "ui_DisassemblyWidget.h" -#include "DebuggerWidget.h" +#include "DebuggerView.h" #include "pcsx2/DebugTools/DisassemblyManager.h" #include #include -class DisassemblyWidget final : public DebuggerWidget +class DisassemblyWidget final : public DebuggerView { Q_OBJECT public: - DisassemblyWidget(const DebuggerWidgetParameters& parameters); + DisassemblyWidget(const DebuggerViewParameters& parameters); ~DisassemblyWidget(); void toJson(JsonValueWrapper& json) override; diff --git a/pcsx2-qt/Debugger/Docking/DockLayout.cpp b/pcsx2-qt/Debugger/Docking/DockLayout.cpp index ea73f30bf5..93b9bae183 100644 --- a/pcsx2-qt/Debugger/Docking/DockLayout.cpp +++ b/pcsx2-qt/Debugger/Docking/DockLayout.cpp @@ -3,7 +3,7 @@ #include "DockLayout.h" -#include "Debugger/DebuggerWidget.h" +#include "Debugger/DebuggerView.h" #include "Debugger/DebuggerWindow.h" #include "Debugger/JsonValueWrapper.h" @@ -77,17 +77,17 @@ DockLayout::DockLayout( { for (const auto& [unique_name, widget_to_clone] : layout_to_clone.m_widgets) { - auto widget_description = DockTables::DEBUGGER_WIDGETS.find(widget_to_clone->metaObject()->className()); - if (widget_description == DockTables::DEBUGGER_WIDGETS.end()) + auto widget_description = DockTables::DEBUGGER_VIEWS.find(widget_to_clone->metaObject()->className()); + if (widget_description == DockTables::DEBUGGER_VIEWS.end()) continue; - DebuggerWidgetParameters parameters; + DebuggerViewParameters parameters; parameters.unique_name = unique_name; parameters.id = widget_to_clone->id(); parameters.cpu = &DebugInterface::get(cpu); parameters.cpu_override = widget_to_clone->cpuOverride(); - DebuggerWidget* new_widget = widget_description->second.create_widget(parameters); + DebuggerView* new_widget = widget_description->second.create_widget(parameters); new_widget->setCustomDisplayName(widget_to_clone->customDisplayName()); new_widget->setPrimary(widget_to_clone->isPrimary()); m_widgets.emplace(unique_name, new_widget); @@ -144,7 +144,7 @@ void DockLayout::setCpu(BreakPointCpu cpu) pxAssert(widget.get()); if (!widget->setCpu(DebugInterface::get(cpu))) - recreateDebuggerWidget(unique_name); + recreateDebuggerView(unique_name); } } @@ -222,24 +222,24 @@ void DockLayout::thaw() } // Check that all the dock widgets have been restored correctly. - std::vector orphaned_debugger_widgets; + std::vector orphaned_debugger_views; for (auto& [unique_name, widget] : m_widgets) { auto [controller, view] = DockUtils::dockWidgetFromName(unique_name); if (!controller || !view) { Console.Error("Debugger: Failed to restore dock widget '%s'.", unique_name.toStdString().c_str()); - orphaned_debugger_widgets.emplace_back(unique_name); + orphaned_debugger_views.emplace_back(unique_name); } } - // Delete any debugger widgets that haven't been restored correctly. - for (const QString& unique_name : orphaned_debugger_widgets) + // Delete any debugger views that haven't been restored correctly. + for (const QString& unique_name : orphaned_debugger_views) { auto widget_iterator = m_widgets.find(unique_name); pxAssert(widget_iterator != m_widgets.end()); - setPrimaryDebuggerWidget(widget_iterator->second.get(), false); + setPrimaryDebuggerView(widget_iterator->second.get(), false); delete widget_iterator->second.get(); m_widgets.erase(widget_iterator); } @@ -274,11 +274,11 @@ void DockLayout::reset() for (size_t i = 0; i < base_layout->widgets.size(); i++) { - auto iterator = DockTables::DEBUGGER_WIDGETS.find(base_layout->widgets[i].type); - pxAssertRel(iterator != DockTables::DEBUGGER_WIDGETS.end(), "Invalid default layout."); - const DockTables::DebuggerWidgetDescription& dock_description = iterator->second; + auto iterator = DockTables::DEBUGGER_VIEWS.find(base_layout->widgets[i].type); + pxAssertRel(iterator != DockTables::DEBUGGER_VIEWS.end(), "Invalid default layout."); + const DockTables::DebuggerViewDescription& dock_description = iterator->second; - DebuggerWidgetParameters parameters; + DebuggerViewParameters parameters; std::tie(parameters.unique_name, parameters.id) = generateNewUniqueName(base_layout->widgets[i].type.c_str()); parameters.cpu = &DebugInterface::get(m_cpu); @@ -286,7 +286,7 @@ void DockLayout::reset() if (parameters.unique_name.isEmpty()) continue; - DebuggerWidget* widget = dock_description.create_widget(parameters); + DebuggerView* widget = dock_description.create_widget(parameters); widget->setPrimary(true); m_widgets.emplace(parameters.unique_name, widget); } @@ -301,7 +301,7 @@ KDDockWidgets::Core::DockWidget* DockLayout::createDockWidget(const QString& nam if (widget_iterator == m_widgets.end()) return nullptr; - DebuggerWidget* widget = widget_iterator->second; + DebuggerView* widget = widget_iterator->second; if (!widget) return nullptr; @@ -319,19 +319,19 @@ void DockLayout::updateDockWidgetTitles() if (!m_is_active) return; - // Translate default debugger widget names. + // Translate default debugger view names. for (auto& [unique_name, widget] : m_widgets) widget->retranslateDisplayName(); // Determine if any widgets have duplicate display names. - std::map> display_name_to_widgets; + std::map> display_name_to_widgets; for (auto& [unique_name, widget] : m_widgets) display_name_to_widgets[widget->displayNameWithoutSuffix()].emplace_back(widget.get()); for (auto& [display_name, widgets] : display_name_to_widgets) { std::sort(widgets.begin(), widgets.end(), - [&](const DebuggerWidget* lhs, const DebuggerWidget* rhs) { + [&](const DebuggerView* lhs, const DebuggerView* rhs) { return lhs->id() < rhs->id(); }); @@ -345,7 +345,7 @@ void DockLayout::updateDockWidgetTitles() } } - // Propagate the new names from the debugger widgets to the dock widgets. + // Propagate the new names from the debugger views to the dock widgets. for (auto& [unique_name, widget] : m_widgets) { auto [controller, view] = DockUtils::dockWidgetFromName(widget->uniqueName()); @@ -356,17 +356,17 @@ void DockLayout::updateDockWidgetTitles() } } -const std::map>& DockLayout::debuggerWidgets() +const std::map>& DockLayout::debuggerViews() { return m_widgets; } -bool DockLayout::hasDebuggerWidget(const QString& unique_name) +bool DockLayout::hasDebuggerView(const QString& unique_name) { return m_widgets.find(unique_name) != m_widgets.end(); } -size_t DockLayout::countDebuggerWidgetsOfType(const char* type) +size_t DockLayout::countDebuggerViewsOfType(const char* type) { size_t count = 0; for (const auto& [unique_name, widget] : m_widgets) @@ -378,29 +378,29 @@ size_t DockLayout::countDebuggerWidgetsOfType(const char* type) return count; } -void DockLayout::createDebuggerWidget(const std::string& type) +void DockLayout::createDebuggerView(const std::string& type) { pxAssert(m_is_active); if (!g_debugger_window) return; - auto description_iterator = DockTables::DEBUGGER_WIDGETS.find(type); - pxAssert(description_iterator != DockTables::DEBUGGER_WIDGETS.end()); + auto description_iterator = DockTables::DEBUGGER_VIEWS.find(type); + pxAssert(description_iterator != DockTables::DEBUGGER_VIEWS.end()); - const DockTables::DebuggerWidgetDescription& description = description_iterator->second; + const DockTables::DebuggerViewDescription& description = description_iterator->second; - DebuggerWidgetParameters parameters; + DebuggerViewParameters parameters; std::tie(parameters.unique_name, parameters.id) = generateNewUniqueName(type.c_str()); parameters.cpu = &DebugInterface::get(m_cpu); if (parameters.unique_name.isEmpty()) return; - DebuggerWidget* widget = description.create_widget(parameters); + DebuggerView* widget = description.create_widget(parameters); m_widgets.emplace(parameters.unique_name, widget); - setPrimaryDebuggerWidget(widget, countDebuggerWidgetsOfType(type.c_str()) == 0); + setPrimaryDebuggerView(widget, countDebuggerViewsOfType(type.c_str()) == 0); auto view = static_cast( KDDockWidgets::Config::self().viewFactory()->createDockWidget(widget->uniqueName())); @@ -413,56 +413,56 @@ void DockLayout::createDebuggerWidget(const std::string& type) updateDockWidgetTitles(); } -void DockLayout::recreateDebuggerWidget(const QString& unique_name) +void DockLayout::recreateDebuggerView(const QString& unique_name) { if (!g_debugger_window) return; - auto debugger_widget_iterator = m_widgets.find(unique_name); - pxAssert(debugger_widget_iterator != m_widgets.end()); + auto debugger_view_iterator = m_widgets.find(unique_name); + pxAssert(debugger_view_iterator != m_widgets.end()); - DebuggerWidget* old_debugger_widget = debugger_widget_iterator->second; + DebuggerView* old_debugger_view = debugger_view_iterator->second; - auto description_iterator = DockTables::DEBUGGER_WIDGETS.find(old_debugger_widget->metaObject()->className()); - pxAssert(description_iterator != DockTables::DEBUGGER_WIDGETS.end()); + auto description_iterator = DockTables::DEBUGGER_VIEWS.find(old_debugger_view->metaObject()->className()); + pxAssert(description_iterator != DockTables::DEBUGGER_VIEWS.end()); - const DockTables::DebuggerWidgetDescription& description = description_iterator->second; + const DockTables::DebuggerViewDescription& description = description_iterator->second; - DebuggerWidgetParameters parameters; - parameters.unique_name = old_debugger_widget->uniqueName(); - parameters.id = old_debugger_widget->id(); + DebuggerViewParameters parameters; + parameters.unique_name = old_debugger_view->uniqueName(); + parameters.id = old_debugger_view->id(); parameters.cpu = &DebugInterface::get(m_cpu); - parameters.cpu_override = old_debugger_widget->cpuOverride(); + parameters.cpu_override = old_debugger_view->cpuOverride(); - DebuggerWidget* new_debugger_widget = description.create_widget(parameters); - new_debugger_widget->setCustomDisplayName(old_debugger_widget->customDisplayName()); - new_debugger_widget->setPrimary(old_debugger_widget->isPrimary()); - debugger_widget_iterator->second = new_debugger_widget; + DebuggerView* new_debugger_view = description.create_widget(parameters); + new_debugger_view->setCustomDisplayName(old_debugger_view->customDisplayName()); + new_debugger_view->setPrimary(old_debugger_view->isPrimary()); + debugger_view_iterator->second = new_debugger_view; if (m_is_active) { auto [controller, view] = DockUtils::dockWidgetFromName(unique_name); if (view) - view->setWidget(new_debugger_widget); + view->setWidget(new_debugger_view); } - delete old_debugger_widget; + delete old_debugger_view; } -void DockLayout::destroyDebuggerWidget(const QString& unique_name) +void DockLayout::destroyDebuggerView(const QString& unique_name) { pxAssert(m_is_active); if (!g_debugger_window) return; - auto debugger_widget_iterator = m_widgets.find(unique_name); - if (debugger_widget_iterator == m_widgets.end()) + auto debugger_view_iterator = m_widgets.find(unique_name); + if (debugger_view_iterator == m_widgets.end()) return; - setPrimaryDebuggerWidget(debugger_widget_iterator->second.get(), false); - delete debugger_widget_iterator->second.get(); - m_widgets.erase(debugger_widget_iterator); + setPrimaryDebuggerView(debugger_view_iterator->second.get(), false); + delete debugger_view_iterator->second.get(); + m_widgets.erase(debugger_view_iterator); auto [controller, view] = DockUtils::dockWidgetFromName(unique_name); if (!controller) @@ -473,7 +473,7 @@ void DockLayout::destroyDebuggerWidget(const QString& unique_name) updateDockWidgetTitles(); } -void DockLayout::setPrimaryDebuggerWidget(DebuggerWidget* widget, bool is_primary) +void DockLayout::setPrimaryDebuggerView(DebuggerView* widget, bool is_primary) { bool present = false; for (auto& [unique_name, test_widget] : m_widgets) @@ -580,7 +580,7 @@ bool DockLayout::save(DockLayout::Index layout_index) json.AddMember("toolbars", toolbars, json.GetAllocator()); } - rapidjson::Value widgets(rapidjson::kArrayType); + rapidjson::Value dock_widgets(rapidjson::kArrayType); for (auto& [unique_name, widget] : m_widgets) { pxAssert(widget.get()); @@ -610,9 +610,9 @@ bool DockLayout::save(DockLayout::Index layout_index) JsonValueWrapper wrapper(object, json.GetAllocator()); widget->toJson(wrapper); - widgets.PushBack(object, json.GetAllocator()); + dock_widgets.PushBack(object, json.GetAllocator()); } - json.AddMember("widgets", widgets, json.GetAllocator()); + json.AddMember("dockWidgets", dock_widgets, json.GetAllocator()); if (!m_geometry.isEmpty() && !geometry.Parse(m_geometry).HasParseError()) json.AddMember("geometry", geometry, json.GetAllocator()); @@ -759,10 +759,10 @@ void DockLayout::load( if (toolbars != json.MemberEnd() && toolbars->value.IsString()) m_toolbars = QByteArray::fromBase64(toolbars->value.GetString()); - auto widgets = json.FindMember("widgets"); - if (widgets != json.MemberEnd() && widgets->value.IsArray()) + auto dock_widgets = json.FindMember("dockWidgets"); + if (dock_widgets != json.MemberEnd() && dock_widgets->value.IsArray()) { - for (rapidjson::Value& object : widgets->value.GetArray()) + for (rapidjson::Value& object : dock_widgets->value.GetArray()) { auto unique_name = object.FindMember("uniqueName"); if (unique_name == object.MemberEnd() || !unique_name->value.IsString()) @@ -780,8 +780,8 @@ void DockLayout::load( if (type == object.MemberEnd() || !type->value.IsString()) continue; - auto description = DockTables::DEBUGGER_WIDGETS.find(type->value.GetString()); - if (description == DockTables::DEBUGGER_WIDGETS.end()) + auto description = DockTables::DEBUGGER_VIEWS.find(type->value.GetString()); + if (description == DockTables::DEBUGGER_VIEWS.end()) continue; std::optional cpu_override; @@ -794,13 +794,13 @@ void DockLayout::load( cpu_override = cpu; } - DebuggerWidgetParameters parameters; + DebuggerViewParameters parameters; parameters.unique_name = unique_name->value.GetString(); parameters.id = id->value.GetUint64(); parameters.cpu = &DebugInterface::get(m_cpu); parameters.cpu_override = cpu_override; - DebuggerWidget* widget = description->second.create_widget(parameters); + DebuggerView* widget = description->second.create_widget(parameters); JsonValueWrapper wrapper(object, json.GetAllocator()); if (!widget->fromJson(wrapper)) @@ -825,12 +825,12 @@ void DockLayout::load( m_layout_file_path = path; - validatePrimaryDebuggerWidgets(); + validatePrimaryDebuggerViews(); } -void DockLayout::validatePrimaryDebuggerWidgets() +void DockLayout::validatePrimaryDebuggerViews() { - std::map> type_to_widgets; + std::map> type_to_widgets; for (const auto& [unique_name, widget] : m_widgets) type_to_widgets[widget->metaObject()->className()].emplace_back(widget.get()); @@ -839,7 +839,7 @@ void DockLayout::validatePrimaryDebuggerWidgets() u32 primary_widgets = 0; // Make sure at most one widget is marked as primary. - for (DebuggerWidget* widget : widgets) + for (DebuggerView* widget : widgets) { if (widget->isPrimary()) { @@ -875,7 +875,7 @@ void DockLayout::setupDefaultLayout() const DockTables::DefaultDockGroupDescription& group = base_layout->groups[static_cast(dock_description.group)]; - DebuggerWidget* widget = nullptr; + DebuggerView* widget = nullptr; for (auto& [unique_name, test_widget] : m_widgets) if (test_widget->metaObject()->className() == dock_description.type) widget = test_widget; @@ -920,7 +920,7 @@ std::pair DockLayout::generateNewUniqueName(const char* type) id = m_next_id; name = QStringLiteral("%1-%2").arg(type).arg(static_cast(m_next_id)); m_next_id++; - } while (hasDebuggerWidget(name)); + } while (hasDebuggerView(name)); return {name, id}; } diff --git a/pcsx2-qt/Debugger/Docking/DockLayout.h b/pcsx2-qt/Debugger/Docking/DockLayout.h index 3bf8b7ef69..fad89c2298 100644 --- a/pcsx2-qt/Debugger/Docking/DockLayout.h +++ b/pcsx2-qt/Debugger/Docking/DockLayout.h @@ -12,7 +12,7 @@ #include -class DebuggerWidget; +class DebuggerView; class DebuggerWindow; extern const char* DEBUGGER_LAYOUT_FILE_FORMAT; @@ -97,13 +97,13 @@ public: KDDockWidgets::Core::DockWidget* createDockWidget(const QString& name); void updateDockWidgetTitles(); - const std::map>& debuggerWidgets(); - bool hasDebuggerWidget(const QString& unique_name); - size_t countDebuggerWidgetsOfType(const char* type); - void createDebuggerWidget(const std::string& type); - void recreateDebuggerWidget(const QString& unique_name); - void destroyDebuggerWidget(const QString& unique_name); - void setPrimaryDebuggerWidget(DebuggerWidget* widget, bool is_primary); + const std::map>& debuggerViews(); + bool hasDebuggerView(const QString& unique_name); + size_t countDebuggerViewsOfType(const char* type); + void createDebuggerView(const std::string& type); + void recreateDebuggerView(const QString& unique_name); + void destroyDebuggerView(const QString& unique_name); + void setPrimaryDebuggerView(DebuggerView* widget, bool is_primary); void deleteFile(); @@ -115,8 +115,8 @@ private: DockLayout::LoadResult& result, DockLayout::Index& index_last_session); - // Make sure there is only a single primary debugger widget of each type. - void validatePrimaryDebuggerWidgets(); + // Make sure there is only a single primary debugger view of each type. + void validatePrimaryDebuggerViews(); void setupDefaultLayout(); @@ -147,7 +147,7 @@ private: // All the dock widgets currently open in this layout. If this is the active // layout then these will be owned by the docking system, otherwise they // won't be and will need to be cleaned up separately. - std::map> m_widgets; + std::map> m_widgets; // The geometry of all the dock widgets, converted to JSON by the // LayoutSaver class from KDDockWidgets. diff --git a/pcsx2-qt/Debugger/Docking/DockManager.cpp b/pcsx2-qt/Debugger/Docking/DockManager.cpp index 99d69d51bc..701556295d 100644 --- a/pcsx2-qt/Debugger/Docking/DockManager.cpp +++ b/pcsx2-qt/Debugger/Docking/DockManager.cpp @@ -3,7 +3,7 @@ #include "DockManager.h" -#include "Debugger/DebuggerWidget.h" +#include "Debugger/DebuggerView.h" #include "Debugger/DebuggerWindow.h" #include "Debugger/Docking/DockTables.h" #include "Debugger/Docking/DockViews.h" @@ -359,9 +359,9 @@ void DockManager::createWindowsMenu(QMenu* menu) // be opened. QMenu* add_another_menu = menu->addMenu(tr("Add Another...")); - std::vector add_another_widgets; + std::vector add_another_widgets; std::set add_another_types; - for (const auto& [unique_name, widget] : layout.debuggerWidgets()) + for (const auto& [unique_name, widget] : layout.debuggerViews()) { std::string type = widget->metaObject()->className(); @@ -373,26 +373,26 @@ void DockManager::createWindowsMenu(QMenu* menu) } std::sort(add_another_widgets.begin(), add_another_widgets.end(), - [](const DebuggerWidget* lhs, const DebuggerWidget* rhs) { + [](const DebuggerView* lhs, const DebuggerView* rhs) { if (lhs->displayNameWithoutSuffix() == rhs->displayNameWithoutSuffix()) return lhs->displayNameSuffixNumber() < rhs->displayNameSuffixNumber(); return lhs->displayNameWithoutSuffix() < rhs->displayNameWithoutSuffix(); }); - for (DebuggerWidget* widget : add_another_widgets) + for (DebuggerView* widget : add_another_widgets) { const char* type = widget->metaObject()->className(); - const auto description_iterator = DockTables::DEBUGGER_WIDGETS.find(type); - pxAssert(description_iterator != DockTables::DEBUGGER_WIDGETS.end()); + const auto description_iterator = DockTables::DEBUGGER_VIEWS.find(type); + pxAssert(description_iterator != DockTables::DEBUGGER_VIEWS.end()); QAction* action = add_another_menu->addAction(description_iterator->second.display_name); connect(action, &QAction::triggered, this, [this, type]() { if (m_current_layout == DockLayout::INVALID_INDEX) return; - m_layouts.at(m_current_layout).createDebuggerWidget(type); + m_layouts.at(m_current_layout).createDebuggerView(type); }); } @@ -401,18 +401,18 @@ void DockManager::createWindowsMenu(QMenu* menu) menu->addSeparator(); - struct DebuggerWidgetToggle + struct DebuggerViewToggle { QString display_name; std::optional suffix_number; QAction* action; }; - std::vector toggles; + std::vector toggles; std::set toggle_types; - // Create a menu item for each open debugger widget. - for (const auto& [unique_name, widget] : layout.debuggerWidgets()) + // Create a menu item for each open debugger view. + for (const auto& [unique_name, widget] : layout.debuggerViews()) { QAction* action = new QAction(menu); action->setText(widget->displayName()); @@ -422,10 +422,10 @@ void DockManager::createWindowsMenu(QMenu* menu) if (m_current_layout == DockLayout::INVALID_INDEX) return; - m_layouts.at(m_current_layout).destroyDebuggerWidget(unique_name); + m_layouts.at(m_current_layout).destroyDebuggerView(unique_name); }); - DebuggerWidgetToggle& toggle = toggles.emplace_back(); + DebuggerViewToggle& toggle = toggles.emplace_back(); toggle.display_name = widget->displayNameWithoutSuffix(); toggle.suffix_number = widget->displayNameSuffixNumber(); toggle.action = action; @@ -433,12 +433,12 @@ void DockManager::createWindowsMenu(QMenu* menu) toggle_types.emplace(widget->metaObject()->className()); } - // Create menu items to open debugger widgets without any open instances. - for (const auto& [type, desc] : DockTables::DEBUGGER_WIDGETS) + // Create menu items to open debugger views without any open instances. + for (const auto& [type, desc] : DockTables::DEBUGGER_VIEWS) { if (!toggle_types.contains(type)) { - QString display_name = QCoreApplication::translate("DebuggerWidget", desc.display_name); + QString display_name = QCoreApplication::translate("DebuggerView", desc.display_name); QAction* action = new QAction(menu); action->setText(display_name); @@ -448,10 +448,10 @@ void DockManager::createWindowsMenu(QMenu* menu) if (m_current_layout == DockLayout::INVALID_INDEX) return; - m_layouts.at(m_current_layout).createDebuggerWidget(type); + m_layouts.at(m_current_layout).createDebuggerView(type); }); - DebuggerWidgetToggle& toggle = toggles.emplace_back(); + DebuggerViewToggle& toggle = toggles.emplace_back(); toggle.display_name = display_name; toggle.suffix_number = std::nullopt; toggle.action = action; @@ -459,14 +459,14 @@ void DockManager::createWindowsMenu(QMenu* menu) } std::sort(toggles.begin(), toggles.end(), - [](const DebuggerWidgetToggle& lhs, const DebuggerWidgetToggle& rhs) { + [](const DebuggerViewToggle& lhs, const DebuggerViewToggle& rhs) { if (lhs.display_name == rhs.display_name) return lhs.suffix_number < rhs.suffix_number; return lhs.display_name < rhs.display_name; }); - for (const DebuggerWidgetToggle& toggle : toggles) + for (const DebuggerViewToggle& toggle : toggles) menu->addAction(toggle.action); } @@ -702,53 +702,53 @@ void DockManager::updateDockWidgetTitles() m_layouts.at(m_current_layout).updateDockWidgetTitles(); } -const std::map>& DockManager::debuggerWidgets() +const std::map>& DockManager::debuggerViews() { - static std::map> dummy; + static std::map> dummy; if (m_current_layout == DockLayout::INVALID_INDEX) return dummy; - return m_layouts.at(m_current_layout).debuggerWidgets(); + return m_layouts.at(m_current_layout).debuggerViews(); } -size_t DockManager::countDebuggerWidgetsOfType(const char* type) +size_t DockManager::countDebuggerViewsOfType(const char* type) { if (m_current_layout == DockLayout::INVALID_INDEX) return 0; - return m_layouts.at(m_current_layout).countDebuggerWidgetsOfType(type); + return m_layouts.at(m_current_layout).countDebuggerViewsOfType(type); } -void DockManager::recreateDebuggerWidget(const QString& unique_name) +void DockManager::recreateDebuggerView(const QString& unique_name) { if (m_current_layout == DockLayout::INVALID_INDEX) return; - m_layouts.at(m_current_layout).recreateDebuggerWidget(unique_name); + m_layouts.at(m_current_layout).recreateDebuggerView(unique_name); } -void DockManager::destroyDebuggerWidget(const QString& unique_name) +void DockManager::destroyDebuggerView(const QString& unique_name) { if (m_current_layout == DockLayout::INVALID_INDEX) return; - m_layouts.at(m_current_layout).destroyDebuggerWidget(unique_name); + m_layouts.at(m_current_layout).destroyDebuggerView(unique_name); } -void DockManager::setPrimaryDebuggerWidget(DebuggerWidget* widget, bool is_primary) +void DockManager::setPrimaryDebuggerView(DebuggerView* widget, bool is_primary) { if (m_current_layout == DockLayout::INVALID_INDEX) return; - m_layouts.at(m_current_layout).setPrimaryDebuggerWidget(widget, is_primary); + m_layouts.at(m_current_layout).setPrimaryDebuggerView(widget, is_primary); } -void DockManager::switchToDebuggerWidget(DebuggerWidget* widget) +void DockManager::switchToDebuggerView(DebuggerView* widget) { if (m_current_layout == DockLayout::INVALID_INDEX) return; - for (const auto& [unique_name, test_widget] : m_layouts.at(m_current_layout).debuggerWidgets()) + for (const auto& [unique_name, test_widget] : m_layouts.at(m_current_layout).debuggerViews()) { if (widget == test_widget) { @@ -765,7 +765,7 @@ void DockManager::updateTheme() m_menu_bar->updateTheme(); for (DockLayout& layout : m_layouts) - for (const auto& [unique_name, widget] : layout.debuggerWidgets()) + for (const auto& [unique_name, widget] : layout.debuggerViews()) widget->updateStyleSheet(); // KDDockWidgets::QtWidgets::TabBar sets its own style to a subclass of diff --git a/pcsx2-qt/Debugger/Docking/DockManager.h b/pcsx2-qt/Debugger/Docking/DockManager.h index d2a8c4ccb4..ee2c52fa73 100644 --- a/pcsx2-qt/Debugger/Docking/DockManager.h +++ b/pcsx2-qt/Debugger/Docking/DockManager.h @@ -82,12 +82,12 @@ public: void updateDockWidgetTitles(); - const std::map>& debuggerWidgets(); - size_t countDebuggerWidgetsOfType(const char* type); - void recreateDebuggerWidget(const QString& unique_name); - void destroyDebuggerWidget(const QString& unique_name); - void setPrimaryDebuggerWidget(DebuggerWidget* widget, bool is_primary); - void switchToDebuggerWidget(DebuggerWidget* widget); + const std::map>& debuggerViews(); + size_t countDebuggerViewsOfType(const char* type); + void recreateDebuggerView(const QString& unique_name); + void destroyDebuggerView(const QString& unique_name); + void setPrimaryDebuggerView(DebuggerView* widget, bool is_primary); + void switchToDebuggerView(DebuggerView* widget); void updateTheme(); diff --git a/pcsx2-qt/Debugger/Docking/DockTables.cpp b/pcsx2-qt/Debugger/Docking/DockTables.cpp index a326129bc2..60a0e8309c 100644 --- a/pcsx2-qt/Debugger/Docking/DockTables.cpp +++ b/pcsx2-qt/Debugger/Docking/DockTables.cpp @@ -22,12 +22,12 @@ static void hashDefaultDockWidget(const DockTables::DefaultDockWidgetDescription static void hashNumber(u32 number, u32& hash); static void hashString(const char* string, u32& hash); -#define DEBUGGER_WIDGET(type, display_name, preferred_location) \ +#define DEBUGGER_VIEW(type, display_name, preferred_location) \ { \ #type, \ { \ - [](const DebuggerWidgetParameters& parameters) -> DebuggerWidget* { \ - DebuggerWidget* widget = new type(parameters); \ + [](const DebuggerViewParameters& parameters) -> DebuggerView* { \ + DebuggerView* widget = new type(parameters); \ widget->handleEvent(DebuggerEvents::Refresh()); \ return widget; \ }, \ @@ -36,22 +36,22 @@ static void hashString(const char* string, u32& hash); } \ } -const std::map DockTables::DEBUGGER_WIDGETS = { - DEBUGGER_WIDGET(BreakpointWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Breakpoints"), BOTTOM_MIDDLE), - DEBUGGER_WIDGET(DisassemblyWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Disassembly"), TOP_RIGHT), - DEBUGGER_WIDGET(FunctionTreeWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Functions"), TOP_LEFT), - DEBUGGER_WIDGET(GlobalVariableTreeWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Globals"), BOTTOM_MIDDLE), - DEBUGGER_WIDGET(LocalVariableTreeWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Locals"), BOTTOM_MIDDLE), - DEBUGGER_WIDGET(MemorySearchWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Memory Search"), TOP_LEFT), - DEBUGGER_WIDGET(MemoryViewWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Memory"), BOTTOM_MIDDLE), - DEBUGGER_WIDGET(ParameterVariableTreeWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Parameters"), BOTTOM_MIDDLE), - DEBUGGER_WIDGET(RegisterWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Registers"), TOP_LEFT), - DEBUGGER_WIDGET(SavedAddressesWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Saved Addresses"), BOTTOM_MIDDLE), - DEBUGGER_WIDGET(StackWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Stack"), BOTTOM_MIDDLE), - DEBUGGER_WIDGET(ThreadWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Threads"), BOTTOM_MIDDLE), +const std::map DockTables::DEBUGGER_VIEWS = { + DEBUGGER_VIEW(BreakpointWidget, QT_TRANSLATE_NOOP("DebuggerView", "Breakpoints"), BOTTOM_MIDDLE), + DEBUGGER_VIEW(DisassemblyWidget, QT_TRANSLATE_NOOP("DebuggerView", "Disassembly"), TOP_RIGHT), + DEBUGGER_VIEW(FunctionTreeWidget, QT_TRANSLATE_NOOP("DebuggerView", "Functions"), TOP_LEFT), + DEBUGGER_VIEW(GlobalVariableTreeWidget, QT_TRANSLATE_NOOP("DebuggerView", "Globals"), BOTTOM_MIDDLE), + DEBUGGER_VIEW(LocalVariableTreeWidget, QT_TRANSLATE_NOOP("DebuggerView", "Locals"), BOTTOM_MIDDLE), + DEBUGGER_VIEW(MemorySearchWidget, QT_TRANSLATE_NOOP("DebuggerView", "Memory Search"), TOP_LEFT), + DEBUGGER_VIEW(MemoryViewWidget, QT_TRANSLATE_NOOP("DebuggerView", "Memory"), BOTTOM_MIDDLE), + DEBUGGER_VIEW(ParameterVariableTreeWidget, QT_TRANSLATE_NOOP("DebuggerView", "Parameters"), BOTTOM_MIDDLE), + DEBUGGER_VIEW(RegisterWidget, QT_TRANSLATE_NOOP("DebuggerView", "Registers"), TOP_LEFT), + DEBUGGER_VIEW(SavedAddressesWidget, QT_TRANSLATE_NOOP("DebuggerView", "Saved Addresses"), BOTTOM_MIDDLE), + DEBUGGER_VIEW(StackWidget, QT_TRANSLATE_NOOP("DebuggerView", "Stack"), BOTTOM_MIDDLE), + DEBUGGER_VIEW(ThreadWidget, QT_TRANSLATE_NOOP("DebuggerView", "Threads"), BOTTOM_MIDDLE), }; -#undef DEBUGGER_WIDGET +#undef DEBUGGER_VIEW const std::vector DockTables::DEFAULT_DOCK_LAYOUTS = { { diff --git a/pcsx2-qt/Debugger/Docking/DockTables.h b/pcsx2-qt/Debugger/Docking/DockTables.h index df99a677b4..c455616f0f 100644 --- a/pcsx2-qt/Debugger/Docking/DockTables.h +++ b/pcsx2-qt/Debugger/Docking/DockTables.h @@ -11,14 +11,14 @@ class MD5Digest; -class DebuggerWidget; -struct DebuggerWidgetParameters; +class DebuggerView; +struct DebuggerViewParameters; namespace DockTables { - struct DebuggerWidgetDescription + struct DebuggerViewDescription { - DebuggerWidget* (*create_widget)(const DebuggerWidgetParameters& parameters); + DebuggerView* (*create_widget)(const DebuggerViewParameters& parameters); // The untranslated string displayed as the dock widget tab text. const char* display_name; @@ -28,7 +28,7 @@ namespace DockTables DockUtils::PreferredLocation preferred_location; }; - extern const std::map DEBUGGER_WIDGETS; + extern const std::map DEBUGGER_VIEWS; enum class DefaultDockGroup { diff --git a/pcsx2-qt/Debugger/Docking/DockViews.cpp b/pcsx2-qt/Debugger/Docking/DockViews.cpp index f5698e11ee..ca3279ba0c 100644 --- a/pcsx2-qt/Debugger/Docking/DockViews.cpp +++ b/pcsx2-qt/Debugger/Docking/DockViews.cpp @@ -4,7 +4,7 @@ #include "DockViews.h" #include "QtUtils.h" -#include "Debugger/DebuggerWidget.h" +#include "Debugger/DebuggerView.h" #include "Debugger/DebuggerWindow.h" #include "Debugger/Docking/DockManager.h" #include "Debugger/Docking/DropIndicators.h" @@ -93,7 +93,7 @@ void DockWidget::openStateChanged(bool open) return; if (!open && g_debugger_window) - g_debugger_window->dockManager().destroyDebuggerWidget(uniqueName()); + g_debugger_window->dockManager().destroyDebuggerView(uniqueName()); } // ***************************************************************************** @@ -166,7 +166,7 @@ void DockTabBar::openContextMenu(QPoint pos) if (!widget) return; - size_t dock_widgets_of_type = g_debugger_window->dockManager().countDebuggerWidgetsOfType( + size_t dock_widgets_of_type = g_debugger_window->dockManager().countDebuggerViewsOfType( widget->metaObject()->className()); QMenu* menu = new QMenu(this); @@ -222,7 +222,7 @@ void DockTabBar::openContextMenu(QPoint pos) if (!widget) return; - g_debugger_window->dockManager().setPrimaryDebuggerWidget(widget, checked); + g_debugger_window->dockManager().setPrimaryDebuggerView(widget, checked); }); QMenu* set_target_menu = menu->addMenu(tr("Set Target")); @@ -263,7 +263,7 @@ void DockTabBar::openContextMenu(QPoint pos) if (!widget) return; - g_debugger_window->dockManager().destroyDebuggerWidget(widget->uniqueName()); + g_debugger_window->dockManager().destroyDebuggerView(widget->uniqueName()); }); menu->popup(mapToGlobal(pos)); @@ -279,7 +279,7 @@ void DockTabBar::setCpuOverrideForTab(int tab_index, std::optionalsetCpuOverride(cpu_override)) - g_debugger_window->dockManager().recreateDebuggerWidget(view->uniqueName()); + g_debugger_window->dockManager().recreateDebuggerView(view->uniqueName()); g_debugger_window->dockManager().updateDockWidgetTitles(); } @@ -296,7 +296,7 @@ DockTabBar::WidgetsFromTabIndexResult DockTabBar::widgetsFromTabIndex(int tab_in auto dock_view = static_cast(dock_controller->view()); - DebuggerWidget* widget = qobject_cast(dock_view->widget()); + DebuggerView* widget = qobject_cast(dock_view->widget()); if (!widget) return {}; diff --git a/pcsx2-qt/Debugger/Docking/DockViews.h b/pcsx2-qt/Debugger/Docking/DockViews.h index 317e14cf3f..8597d9ed47 100644 --- a/pcsx2-qt/Debugger/Docking/DockViews.h +++ b/pcsx2-qt/Debugger/Docking/DockViews.h @@ -11,7 +11,7 @@ #include #include -class DebuggerWidget; +class DebuggerView; class DockManager; class DockViewFactory : public KDDockWidgets::QtWidgets::ViewFactory @@ -101,7 +101,7 @@ protected: struct WidgetsFromTabIndexResult { - DebuggerWidget* debugger_widget = nullptr; + DebuggerView* widget = nullptr; KDDockWidgets::Core::DockWidget* controller = nullptr; KDDockWidgets::QtWidgets::DockWidget* view = nullptr; }; diff --git a/pcsx2-qt/Debugger/Memory/MemorySearchWidget.cpp b/pcsx2-qt/Debugger/Memory/MemorySearchWidget.cpp index d223dff85e..6ec30ddf0a 100644 --- a/pcsx2-qt/Debugger/Memory/MemorySearchWidget.cpp +++ b/pcsx2-qt/Debugger/Memory/MemorySearchWidget.cpp @@ -23,8 +23,8 @@ using SearchResult = MemorySearchWidget::SearchResult; using namespace QtUtils; -MemorySearchWidget::MemorySearchWidget(const DebuggerWidgetParameters& parameters) - : DebuggerWidget(parameters, MONOSPACE_FONT) +MemorySearchWidget::MemorySearchWidget(const DebuggerViewParameters& parameters) + : DebuggerView(parameters, MONOSPACE_FONT) { m_ui.setupUi(this); this->repaint(); diff --git a/pcsx2-qt/Debugger/Memory/MemorySearchWidget.h b/pcsx2-qt/Debugger/Memory/MemorySearchWidget.h index 84e2fe3fd7..3f13522e83 100644 --- a/pcsx2-qt/Debugger/Memory/MemorySearchWidget.h +++ b/pcsx2-qt/Debugger/Memory/MemorySearchWidget.h @@ -5,7 +5,7 @@ #include "ui_MemorySearchWidget.h" -#include "Debugger/DebuggerWidget.h" +#include "Debugger/DebuggerView.h" #include "DebugTools/DebugInterface.h" @@ -13,12 +13,12 @@ #include #include -class MemorySearchWidget final : public DebuggerWidget +class MemorySearchWidget final : public DebuggerView { Q_OBJECT public: - MemorySearchWidget(const DebuggerWidgetParameters& parameters); + MemorySearchWidget(const DebuggerViewParameters& parameters); ~MemorySearchWidget() = default; enum class SearchType diff --git a/pcsx2-qt/Debugger/Memory/MemoryViewWidget.cpp b/pcsx2-qt/Debugger/Memory/MemoryViewWidget.cpp index ddb596daa9..d56399b111 100644 --- a/pcsx2-qt/Debugger/Memory/MemoryViewWidget.cpp +++ b/pcsx2-qt/Debugger/Memory/MemoryViewWidget.cpp @@ -453,8 +453,8 @@ bool MemoryViewTable::KeyPress(int key, QChar keychar, DebugInterface& cpu) /* MemoryViewWidget */ -MemoryViewWidget::MemoryViewWidget(const DebuggerWidgetParameters& parameters) - : DebuggerWidget(parameters, MONOSPACE_FONT) +MemoryViewWidget::MemoryViewWidget(const DebuggerViewParameters& parameters) + : DebuggerView(parameters, MONOSPACE_FONT) , m_table(this) { ui.setupUi(this); @@ -489,7 +489,7 @@ MemoryViewWidget::~MemoryViewWidget() = default; void MemoryViewWidget::toJson(JsonValueWrapper& json) { - DebuggerWidget::toJson(json); + DebuggerView::toJson(json); json.value().AddMember("startAddress", m_table.startAddress, json.allocator()); json.value().AddMember("viewType", static_cast(m_table.GetViewType()), json.allocator()); @@ -498,7 +498,7 @@ void MemoryViewWidget::toJson(JsonValueWrapper& json) bool MemoryViewWidget::fromJson(const JsonValueWrapper& json) { - if (!DebuggerWidget::fromJson(json)) + if (!DebuggerView::fromJson(json)) return false; auto start_address = json.value().FindMember("startAddress"); @@ -701,7 +701,7 @@ void MemoryViewWidget::keyPressEvent(QKeyEvent* event) } } this->repaint(); - DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate()); + DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); } void MemoryViewWidget::gotoAddress(u32 address) diff --git a/pcsx2-qt/Debugger/Memory/MemoryViewWidget.h b/pcsx2-qt/Debugger/Memory/MemoryViewWidget.h index ce59d1c244..676e32fe27 100644 --- a/pcsx2-qt/Debugger/Memory/MemoryViewWidget.h +++ b/pcsx2-qt/Debugger/Memory/MemoryViewWidget.h @@ -5,7 +5,7 @@ #include "ui_MemoryViewWidget.h" -#include "Debugger/DebuggerWidget.h" +#include "Debugger/DebuggerView.h" #include "DebugTools/DebugInterface.h" #include "DebugTools/DisassemblyManager.h" @@ -104,12 +104,12 @@ public: } }; -class MemoryViewWidget final : public DebuggerWidget +class MemoryViewWidget final : public DebuggerView { Q_OBJECT public: - MemoryViewWidget(const DebuggerWidgetParameters& parameters); + MemoryViewWidget(const DebuggerViewParameters& parameters); ~MemoryViewWidget(); void toJson(JsonValueWrapper& json) override; diff --git a/pcsx2-qt/Debugger/Memory/SavedAddressesWidget.cpp b/pcsx2-qt/Debugger/Memory/SavedAddressesWidget.cpp index 6cfe174c85..693acb1c73 100644 --- a/pcsx2-qt/Debugger/Memory/SavedAddressesWidget.cpp +++ b/pcsx2-qt/Debugger/Memory/SavedAddressesWidget.cpp @@ -9,8 +9,8 @@ #include #include -SavedAddressesWidget::SavedAddressesWidget(const DebuggerWidgetParameters& parameters) - : DebuggerWidget(parameters, DISALLOW_MULTIPLE_INSTANCES) +SavedAddressesWidget::SavedAddressesWidget(const DebuggerViewParameters& parameters) + : DebuggerView(parameters, DISALLOW_MULTIPLE_INSTANCES) , m_model(SavedAddressesModel::getInstance(cpu())) { m_ui.setupUi(this); diff --git a/pcsx2-qt/Debugger/Memory/SavedAddressesWidget.h b/pcsx2-qt/Debugger/Memory/SavedAddressesWidget.h index 96ed901859..f4b6b07690 100644 --- a/pcsx2-qt/Debugger/Memory/SavedAddressesWidget.h +++ b/pcsx2-qt/Debugger/Memory/SavedAddressesWidget.h @@ -7,14 +7,14 @@ #include "SavedAddressesModel.h" -#include "Debugger/DebuggerWidget.h" +#include "Debugger/DebuggerView.h" -class SavedAddressesWidget : public DebuggerWidget +class SavedAddressesWidget : public DebuggerView { Q_OBJECT public: - SavedAddressesWidget(const DebuggerWidgetParameters& parameters); + SavedAddressesWidget(const DebuggerViewParameters& parameters); void openContextMenu(QPoint pos); void contextPasteCSV(); diff --git a/pcsx2-qt/Debugger/RegisterWidget.cpp b/pcsx2-qt/Debugger/RegisterWidget.cpp index d55b0cba0d..b3994971b2 100644 --- a/pcsx2-qt/Debugger/RegisterWidget.cpp +++ b/pcsx2-qt/Debugger/RegisterWidget.cpp @@ -21,8 +21,8 @@ using namespace QtUtils; -RegisterWidget::RegisterWidget(const DebuggerWidgetParameters& parameters) - : DebuggerWidget(parameters, MONOSPACE_FONT) +RegisterWidget::RegisterWidget(const DebuggerViewParameters& parameters) + : DebuggerView(parameters, MONOSPACE_FONT) { this->setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu); @@ -51,7 +51,7 @@ RegisterWidget::~RegisterWidget() void RegisterWidget::toJson(JsonValueWrapper& json) { - DebuggerWidget::toJson(json); + DebuggerView::toJson(json); json.value().AddMember("showVU0FFloat", m_showVU0FFloat, json.allocator()); json.value().AddMember("showFPRFloat", m_showFPRFloat, json.allocator()); @@ -59,7 +59,7 @@ void RegisterWidget::toJson(JsonValueWrapper& json) bool RegisterWidget::fromJson(const JsonValueWrapper& json) { - if (!DebuggerWidget::fromJson(json)) + if (!DebuggerView::fromJson(json)) return false; auto show_vu0f_float = json.value().FindMember("showVU0FFloat"); @@ -401,7 +401,7 @@ void RegisterWidget::contextChangeValue() if (contextFetchNewValue(newVal, cpu().getRegister(categoryIndex, m_selectedRow).lo)) { cpu().setRegister(categoryIndex, m_selectedRow, u128::From64(newVal)); - DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate()); + DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); } } @@ -413,7 +413,7 @@ void RegisterWidget::contextChangeTop() { oldVal.hi = newVal; cpu().setRegister(ui.registerTabs->currentIndex(), m_selectedRow, oldVal); - DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate()); + DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); } } @@ -425,7 +425,7 @@ void RegisterWidget::contextChangeBottom() { oldVal.lo = newVal; cpu().setRegister(ui.registerTabs->currentIndex(), m_selectedRow, oldVal); - DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate()); + DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); } } @@ -437,7 +437,7 @@ void RegisterWidget::contextChangeSegment() { oldVal._u32[3 - m_selected128Field] = (u32)newVal; cpu().setRegister(ui.registerTabs->currentIndex(), m_selectedRow, oldVal); - DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate()); + DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate()); } } diff --git a/pcsx2-qt/Debugger/RegisterWidget.h b/pcsx2-qt/Debugger/RegisterWidget.h index 746392912b..6affde7356 100644 --- a/pcsx2-qt/Debugger/RegisterWidget.h +++ b/pcsx2-qt/Debugger/RegisterWidget.h @@ -5,7 +5,7 @@ #include "ui_RegisterWidget.h" -#include "DebuggerWidget.h" +#include "DebuggerView.h" #include "DebugTools/DebugInterface.h" #include "DebugTools/DisassemblyManager.h" @@ -14,12 +14,12 @@ #include #include -class RegisterWidget final : public DebuggerWidget +class RegisterWidget final : public DebuggerView { Q_OBJECT public: - RegisterWidget(const DebuggerWidgetParameters& parameters); + RegisterWidget(const DebuggerViewParameters& parameters); ~RegisterWidget(); void toJson(JsonValueWrapper& json) override; diff --git a/pcsx2-qt/Debugger/StackWidget.cpp b/pcsx2-qt/Debugger/StackWidget.cpp index 6528f1a080..4bc02d16db 100644 --- a/pcsx2-qt/Debugger/StackWidget.cpp +++ b/pcsx2-qt/Debugger/StackWidget.cpp @@ -8,8 +8,8 @@ #include #include -StackWidget::StackWidget(const DebuggerWidgetParameters& parameters) - : DebuggerWidget(parameters, NO_DEBUGGER_FLAGS) +StackWidget::StackWidget(const DebuggerViewParameters& parameters) + : DebuggerView(parameters, NO_DEBUGGER_FLAGS) , m_model(new StackModel(cpu())) { m_ui.setupUi(this); diff --git a/pcsx2-qt/Debugger/StackWidget.h b/pcsx2-qt/Debugger/StackWidget.h index 112bcfd37c..3848e2243d 100644 --- a/pcsx2-qt/Debugger/StackWidget.h +++ b/pcsx2-qt/Debugger/StackWidget.h @@ -7,14 +7,14 @@ #include "StackModel.h" -#include "DebuggerWidget.h" +#include "DebuggerView.h" -class StackWidget final : public DebuggerWidget +class StackWidget final : public DebuggerView { Q_OBJECT public: - StackWidget(const DebuggerWidgetParameters& parameters); + StackWidget(const DebuggerViewParameters& parameters); void openContextMenu(QPoint pos); void onDoubleClick(const QModelIndex& index); diff --git a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeWidgets.cpp b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeWidgets.cpp index 698baae61f..560c5eb374 100644 --- a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeWidgets.cpp +++ b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeWidgets.cpp @@ -18,8 +18,8 @@ static bool testName(const QString& name, const QString& filter); SymbolTreeWidget::SymbolTreeWidget( u32 flags, s32 symbol_address_alignment, - const DebuggerWidgetParameters& parameters) - : DebuggerWidget(parameters, MONOSPACE_FONT) + const DebuggerViewParameters& parameters) + : DebuggerView(parameters, MONOSPACE_FONT) , m_flags(flags) , m_symbol_address_alignment(symbol_address_alignment) , m_group_by_module(cpu().getCpuType() == BREAKPOINT_IOP) @@ -67,7 +67,7 @@ void SymbolTreeWidget::resizeEvent(QResizeEvent* event) void SymbolTreeWidget::toJson(JsonValueWrapper& json) { - DebuggerWidget::toJson(json); + DebuggerView::toJson(json); json.value().AddMember("showSizeColumn", m_show_size_column, json.allocator()); if (m_flags & ALLOW_GROUPING) @@ -85,7 +85,7 @@ void SymbolTreeWidget::toJson(JsonValueWrapper& json) bool SymbolTreeWidget::fromJson(const JsonValueWrapper& json) { - if (!DebuggerWidget::fromJson(json)) + if (!DebuggerView::fromJson(json)) return false; bool needs_reset = false; @@ -712,7 +712,7 @@ SymbolTreeNode* SymbolTreeWidget::currentNode() // ***************************************************************************** -FunctionTreeWidget::FunctionTreeWidget(const DebuggerWidgetParameters& parameters) +FunctionTreeWidget::FunctionTreeWidget(const DebuggerViewParameters& parameters) : SymbolTreeWidget( ALLOW_GROUPING | ALLOW_MANGLED_NAME_ACTIONS | CLICK_TO_GO_TO_IN_DISASSEMBLER, 4, @@ -800,7 +800,7 @@ void FunctionTreeWidget::onNewButtonPressed() // ***************************************************************************** -GlobalVariableTreeWidget::GlobalVariableTreeWidget(const DebuggerWidgetParameters& parameters) +GlobalVariableTreeWidget::GlobalVariableTreeWidget(const DebuggerViewParameters& parameters) : SymbolTreeWidget( ALLOW_GROUPING | ALLOW_SORTING_BY_IF_TYPE_IS_KNOWN | ALLOW_TYPE_ACTIONS | ALLOW_MANGLED_NAME_ACTIONS, 1, @@ -943,7 +943,7 @@ void GlobalVariableTreeWidget::onNewButtonPressed() // ***************************************************************************** -LocalVariableTreeWidget::LocalVariableTreeWidget(const DebuggerWidgetParameters& parameters) +LocalVariableTreeWidget::LocalVariableTreeWidget(const DebuggerViewParameters& parameters) : SymbolTreeWidget( ALLOW_TYPE_ACTIONS, 1, @@ -1072,7 +1072,7 @@ void LocalVariableTreeWidget::onNewButtonPressed() // ***************************************************************************** -ParameterVariableTreeWidget::ParameterVariableTreeWidget(const DebuggerWidgetParameters& parameters) +ParameterVariableTreeWidget::ParameterVariableTreeWidget(const DebuggerViewParameters& parameters) : SymbolTreeWidget( ALLOW_TYPE_ACTIONS, 1, diff --git a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeWidgets.h b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeWidgets.h index de25ab0166..9e9d340e52 100644 --- a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeWidgets.h +++ b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeWidgets.h @@ -5,12 +5,12 @@ #include "ui_SymbolTreeWidget.h" -#include "Debugger/DebuggerWidget.h" +#include "Debugger/DebuggerView.h" #include "Debugger/SymbolTree/SymbolTreeModel.h" // A symbol tree widget with its associated refresh button, filter box and // right-click menu. Supports grouping, sorting and various other settings. -class SymbolTreeWidget : public DebuggerWidget +class SymbolTreeWidget : public DebuggerView { Q_OBJECT @@ -36,7 +36,7 @@ protected: SymbolTreeWidget( u32 flags, s32 symbol_address_alignment, - const DebuggerWidgetParameters& parameters); + const DebuggerViewParameters& parameters); void resizeEvent(QResizeEvent* event) override; @@ -118,7 +118,7 @@ class FunctionTreeWidget : public SymbolTreeWidget { Q_OBJECT public: - explicit FunctionTreeWidget(const DebuggerWidgetParameters& parameters); + explicit FunctionTreeWidget(const DebuggerViewParameters& parameters); virtual ~FunctionTreeWidget(); protected: @@ -137,7 +137,7 @@ class GlobalVariableTreeWidget : public SymbolTreeWidget { Q_OBJECT public: - explicit GlobalVariableTreeWidget(const DebuggerWidgetParameters& parameters); + explicit GlobalVariableTreeWidget(const DebuggerViewParameters& parameters); virtual ~GlobalVariableTreeWidget(); protected: @@ -156,7 +156,7 @@ class LocalVariableTreeWidget : public SymbolTreeWidget { Q_OBJECT public: - explicit LocalVariableTreeWidget(const DebuggerWidgetParameters& parameters); + explicit LocalVariableTreeWidget(const DebuggerViewParameters& parameters); virtual ~LocalVariableTreeWidget(); protected: @@ -180,7 +180,7 @@ class ParameterVariableTreeWidget : public SymbolTreeWidget { Q_OBJECT public: - explicit ParameterVariableTreeWidget(const DebuggerWidgetParameters& parameters); + explicit ParameterVariableTreeWidget(const DebuggerViewParameters& parameters); virtual ~ParameterVariableTreeWidget(); protected: diff --git a/pcsx2-qt/Debugger/ThreadWidget.cpp b/pcsx2-qt/Debugger/ThreadWidget.cpp index 69075d7706..6f652701d5 100644 --- a/pcsx2-qt/Debugger/ThreadWidget.cpp +++ b/pcsx2-qt/Debugger/ThreadWidget.cpp @@ -8,8 +8,8 @@ #include #include -ThreadWidget::ThreadWidget(const DebuggerWidgetParameters& parameters) - : DebuggerWidget(parameters, NO_DEBUGGER_FLAGS) +ThreadWidget::ThreadWidget(const DebuggerViewParameters& parameters) + : DebuggerView(parameters, NO_DEBUGGER_FLAGS) , m_model(new ThreadModel(cpu())) , m_proxy_model(new QSortFilterProxyModel()) { diff --git a/pcsx2-qt/Debugger/ThreadWidget.h b/pcsx2-qt/Debugger/ThreadWidget.h index ef501bbe99..620b5f5e05 100644 --- a/pcsx2-qt/Debugger/ThreadWidget.h +++ b/pcsx2-qt/Debugger/ThreadWidget.h @@ -5,17 +5,17 @@ #include "ui_ThreadWidget.h" -#include "DebuggerWidget.h" +#include "DebuggerView.h" #include "ThreadModel.h" #include -class ThreadWidget final : public DebuggerWidget +class ThreadWidget final : public DebuggerView { Q_OBJECT public: - ThreadWidget(const DebuggerWidgetParameters& parameters); + ThreadWidget(const DebuggerViewParameters& parameters); void openContextMenu(QPoint pos); void onDoubleClick(const QModelIndex& index); diff --git a/pcsx2-qt/pcsx2-qt.vcxproj b/pcsx2-qt/pcsx2-qt.vcxproj index 1a2d7ea7b1..14e6bd153d 100644 --- a/pcsx2-qt/pcsx2-qt.vcxproj +++ b/pcsx2-qt/pcsx2-qt.vcxproj @@ -112,7 +112,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -303,7 +303,7 @@ - + diff --git a/pcsx2-qt/pcsx2-qt.vcxproj.filters b/pcsx2-qt/pcsx2-qt.vcxproj.filters index e989d10633..2a8d00009c 100644 --- a/pcsx2-qt/pcsx2-qt.vcxproj.filters +++ b/pcsx2-qt/pcsx2-qt.vcxproj.filters @@ -284,7 +284,7 @@ Debugger - + Debugger @@ -311,7 +311,7 @@ moc - + moc @@ -628,7 +628,7 @@ Debugger - + Debugger @@ -959,4 +959,4 @@ Translations - \ No newline at end of file +