From 9d2625e8c49bcc10411eafa9a4dcb667b3387674 Mon Sep 17 00:00:00 2001 From: Nav Date: Thu, 21 Jul 2022 21:16:34 +0100 Subject: [PATCH] Store and restore refresh configuration for memory inspection panes --- .../TargetMemoryInspectionPane.cpp | 1 + src/ProjectSettings.cpp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index 4fdf06db..11c7219e 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -87,6 +87,7 @@ namespace Bloom::Widgets containerLayout->addWidget(this->hexViewerWidget); this->setRefreshOnTargetStopEnabled(this->settings.refreshOnTargetStop); + this->setRefreshOnActivationEnabled(this->settings.refreshOnActivation); QObject::connect( this, diff --git a/src/ProjectSettings.cpp b/src/ProjectSettings.cpp index e3e4d395..70f09d55 100644 --- a/src/ProjectSettings.cpp +++ b/src/ProjectSettings.cpp @@ -148,6 +148,14 @@ namespace Bloom ) const { auto inspectionPaneSettings = Widgets::TargetMemoryInspectionPaneSettings(); + if (jsonObject.contains("refreshOnTargetStop")) { + inspectionPaneSettings.refreshOnTargetStop = jsonObject.value("refreshOnTargetStop").toBool(); + } + + if (jsonObject.contains("refreshOnActivation")) { + inspectionPaneSettings.refreshOnActivation = jsonObject.value("refreshOnActivation").toBool(); + } + if (jsonObject.contains("hexViewerSettings")) { auto& hexViewerSettings = inspectionPaneSettings.hexViewerWidgetSettings; const auto hexViewerSettingsObj = jsonObject.find("hexViewerSettings")->toObject(); @@ -326,7 +334,10 @@ namespace Bloom QJsonObject InsightProjectSettings::memoryInspectionPaneSettingsToJson( const Widgets::TargetMemoryInspectionPaneSettings& inspectionPaneSettings ) const { - auto settingsObj = QJsonObject(); + auto settingsObj = QJsonObject({ + {"refreshOnTargetStop", inspectionPaneSettings.refreshOnTargetStop}, + {"refreshOnActivation", inspectionPaneSettings.refreshOnActivation}, + }); const auto& hexViewerSettings = inspectionPaneSettings.hexViewerWidgetSettings; settingsObj.insert("hexViewerSettings", QJsonObject({