Store and restore refresh configuration for memory inspection panes

This commit is contained in:
Nav
2022-07-21 21:16:34 +01:00
parent 5a0a88eced
commit 9d2625e8c4
2 changed files with 13 additions and 1 deletions

View File

@@ -87,6 +87,7 @@ namespace Bloom::Widgets
containerLayout->addWidget(this->hexViewerWidget); containerLayout->addWidget(this->hexViewerWidget);
this->setRefreshOnTargetStopEnabled(this->settings.refreshOnTargetStop); this->setRefreshOnTargetStopEnabled(this->settings.refreshOnTargetStop);
this->setRefreshOnActivationEnabled(this->settings.refreshOnActivation);
QObject::connect( QObject::connect(
this, this,

View File

@@ -148,6 +148,14 @@ namespace Bloom
) const { ) const {
auto inspectionPaneSettings = Widgets::TargetMemoryInspectionPaneSettings(); 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")) { if (jsonObject.contains("hexViewerSettings")) {
auto& hexViewerSettings = inspectionPaneSettings.hexViewerWidgetSettings; auto& hexViewerSettings = inspectionPaneSettings.hexViewerWidgetSettings;
const auto hexViewerSettingsObj = jsonObject.find("hexViewerSettings")->toObject(); const auto hexViewerSettingsObj = jsonObject.find("hexViewerSettings")->toObject();
@@ -326,7 +334,10 @@ namespace Bloom
QJsonObject InsightProjectSettings::memoryInspectionPaneSettingsToJson( QJsonObject InsightProjectSettings::memoryInspectionPaneSettingsToJson(
const Widgets::TargetMemoryInspectionPaneSettings& inspectionPaneSettings const Widgets::TargetMemoryInspectionPaneSettings& inspectionPaneSettings
) const { ) const {
auto settingsObj = QJsonObject(); auto settingsObj = QJsonObject({
{"refreshOnTargetStop", inspectionPaneSettings.refreshOnTargetStop},
{"refreshOnActivation", inspectionPaneSettings.refreshOnActivation},
});
const auto& hexViewerSettings = inspectionPaneSettings.hexViewerWidgetSettings; const auto& hexViewerSettings = inspectionPaneSettings.hexViewerWidgetSettings;
settingsObj.insert("hexViewerSettings", QJsonObject({ settingsObj.insert("hexViewerSettings", QJsonObject({