From fef3aac3ae0859aa66eed7ac3289150f9a6a44bc Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 25 Dec 2021 22:16:28 +0000 Subject: [PATCH] Moved ownership of hex viewer settings to TargetMemoryInspectionPane and corrected default settings --- .../HexViewerWidget/HexViewerWidget.cpp | 8 +++++--- .../HexViewerWidget/HexViewerWidget.hpp | 3 ++- .../HexViewerWidget/HexViewerWidgetSettings.hpp | 6 +++--- .../TargetMemoryInspectionPane.cpp | 1 + 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp index ea07498b..ac0a855e 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp @@ -12,6 +12,7 @@ using Bloom::Targets::TargetMemoryDescriptor; HexViewerWidget::HexViewerWidget( const TargetMemoryDescriptor& targetMemoryDescriptor, + HexViewerWidgetSettings& settings, std::vector& focusedMemoryRegions, std::vector& excludedMemoryRegions, InsightWorker& insightWorker, @@ -19,6 +20,7 @@ HexViewerWidget::HexViewerWidget( ): QWidget(parent), targetMemoryDescriptor(targetMemoryDescriptor), + settings(settings), focusedMemoryRegions(focusedMemoryRegions), excludedMemoryRegions(excludedMemoryRegions), insightWorker(insightWorker) @@ -74,9 +76,9 @@ HexViewerWidget::HexViewerWidget( ); this->byteItemGraphicsScene = this->byteItemGraphicsView->getScene(); - this->setStackMemoryHighlightingEnabled(true); - this->setHoveredRowAndColumnHighlightingEnabled(true); - this->setFocusedMemoryHighlightingEnabled(true); + this->setStackMemoryHighlightingEnabled(this->settings.highlightStackMemory); + this->setHoveredRowAndColumnHighlightingEnabled(this->settings.highlightHoveredRowAndCol); + this->setFocusedMemoryHighlightingEnabled(this->settings.highlightFocusedMemory); QObject::connect( this->highlightStackMemoryButton, diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp index 5eef5be3..463e4613 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp @@ -31,6 +31,7 @@ namespace Bloom::Widgets HexViewerWidget( const Targets::TargetMemoryDescriptor& targetMemoryDescriptor, + HexViewerWidgetSettings& settings, std::vector& focusedMemoryRegions, std::vector& excludedMemoryRegions, InsightWorker& insightWorker, @@ -52,7 +53,7 @@ namespace Bloom::Widgets InsightWorker& insightWorker; - HexViewerWidgetSettings settings = HexViewerWidgetSettings(); + HexViewerWidgetSettings& settings; QWidget* container = nullptr; QWidget* toolBar = nullptr; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidgetSettings.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidgetSettings.hpp index 593d9e06..bf9ec5f9 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidgetSettings.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidgetSettings.hpp @@ -4,9 +4,9 @@ namespace Bloom::Widgets { struct HexViewerWidgetSettings { - bool highlightStackMemory = false; - bool highlightFocusedMemory = false; - bool highlightHoveredRowAndCol = false; + bool highlightStackMemory = true; + bool highlightFocusedMemory = true; + bool highlightHoveredRowAndCol = true; bool displayAsciiValues = false; }; } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index 1f125fa6..e8e53420 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -61,6 +61,7 @@ TargetMemoryInspectionPane::TargetMemoryInspectionPane( this->manageMemoryRegionsButton = this->container->findChild("manage-memory-regions-btn"); this->hexViewerWidget = new HexViewerWidget( this->targetMemoryDescriptor, + this->settings.hexViewerWidgetSettings, this->settings.focusedMemoryRegions, this->settings.excludedMemoryRegions, this->insightWorker,