diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegion.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegion.hpp index 41885573..2b4a8a49 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegion.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegion.hpp @@ -16,7 +16,7 @@ namespace Bloom EXCLUDED, }; - enum class MemoryRegionAddressType: std::uint8_t + enum class MemoryRegionAddressInputType: std::uint8_t { ABSOLUTE, RELATIVE, @@ -41,7 +41,7 @@ namespace Bloom * See RegionItem::convertRelativeToAbsoluteAddressRange() * See RegionItem::convertAbsoluteToRelativeAddressRange() */ - MemoryRegionAddressType addressRangeType = MemoryRegionAddressType::ABSOLUTE; + MemoryRegionAddressInputType addressRangeInputType = MemoryRegionAddressInputType::ABSOLUTE; /** * This address range will always be in absolute form. Regardless of the value of this->addressRangeType. diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp index 1111b270..3d602edd 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp @@ -40,7 +40,7 @@ void ExcludedRegionItem::applyChanges() { this->startAddressInput->text().toUInt(nullptr, 16), this->endAddressInput->text().toUInt(nullptr, 16) ); - this->memoryRegion.addressRangeType = this->getSelectedAddressType(); - this->memoryRegion.addressRange = this->memoryRegion.addressRangeType == MemoryRegionAddressType::RELATIVE ? + this->memoryRegion.addressRangeInputType = this->getSelectedAddressInputType(); + this->memoryRegion.addressRange = this->memoryRegion.addressRangeInputType == MemoryRegionAddressInputType::RELATIVE ? this->convertRelativeToAbsoluteAddressRange(inputAddressRange) : inputAddressRange; } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp index e3727143..06421077 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp @@ -40,8 +40,8 @@ void FocusedRegionItem::applyChanges() { this->startAddressInput->text().toUInt(nullptr, 16), this->endAddressInput->text().toUInt(nullptr, 16) ); - this->memoryRegion.addressRangeType = this->getSelectedAddressType(); - this->memoryRegion.addressRange = this->memoryRegion.addressRangeType == MemoryRegionAddressType::RELATIVE ? + this->memoryRegion.addressRangeInputType = this->getSelectedAddressInputType(); + this->memoryRegion.addressRange = this->memoryRegion.addressRangeInputType == MemoryRegionAddressInputType::RELATIVE ? this->convertRelativeToAbsoluteAddressRange(inputAddressRange) : inputAddressRange; auto selectedDataTypeOptionName = this->dataTypeInput->currentData().toString(); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.cpp index 0e2e07d2..a16e9a97 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.cpp @@ -96,7 +96,7 @@ QStringList RegionItem::getValidationFailures() const { validationFailures.emplace_back("The start address exceeds the end address."); } - auto addressType = this->getSelectedAddressType(); + auto addressType = this->getSelectedAddressInputType(); const auto memoryAddressRange = this->memoryDescriptor.addressRange; const auto memoryAddressRangeStr = QString( @@ -104,7 +104,7 @@ QStringList RegionItem::getValidationFailures() const { + "0x" + QString::number(memoryAddressRange.endAddress, 16).toUpper() ); - const auto absoluteAddressRange = addressType == MemoryRegionAddressType::RELATIVE ? + const auto absoluteAddressRange = addressType == MemoryRegionAddressInputType::RELATIVE ? this->convertRelativeToAbsoluteAddressRange(TargetMemoryAddressRange(startAddress, endAddress)) : TargetMemoryAddressRange(startAddress, endAddress); @@ -143,7 +143,7 @@ void RegionItem::initFormInputs() { this->addressTypeInput->addItem(option.text, optionName); } - if (region.addressRangeType == MemoryRegionAddressType::RELATIVE) { + if (region.addressRangeInputType == MemoryRegionAddressInputType::RELATIVE) { auto relativeAddressRange = this->convertAbsoluteToRelativeAddressRange(region.addressRange); this->addressTypeInput->setCurrentText(RegionItem::addressRangeTypeOptionsByName.at("relative").text); @@ -163,13 +163,13 @@ void RegionItem::initFormInputs() { QObject::connect(this->nameInput, &QLineEdit::textEdited, this, &RegionItem::onNameInputChange); } -MemoryRegionAddressType RegionItem::getSelectedAddressType() const { +MemoryRegionAddressInputType RegionItem::getSelectedAddressInputType() const { auto selectedAddressTypeOptionName = this->addressTypeInput->currentData().toString(); if (RegionItem::addressRangeTypeOptionsByName.contains(selectedAddressTypeOptionName)) { return RegionItem::addressRangeTypeOptionsByName.at(selectedAddressTypeOptionName).addressType; } - return MemoryRegionAddressType::ABSOLUTE; + return MemoryRegionAddressInputType::ABSOLUTE; } TargetMemoryAddressRange RegionItem::convertAbsoluteToRelativeAddressRange( diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.hpp index fc280c2c..17370066 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.hpp @@ -18,9 +18,9 @@ namespace Bloom::Widgets struct AddressRangeTypeOption { QString text; - MemoryRegionAddressType addressType; + MemoryRegionAddressInputType addressType; - AddressRangeTypeOption(const QString& text, MemoryRegionAddressType addressType) + AddressRangeTypeOption(const QString& text, MemoryRegionAddressInputType addressType) : text(text), addressType(addressType) {}; }; @@ -63,7 +63,7 @@ namespace Bloom::Widgets TextInput* sizeInput = nullptr; virtual void initFormInputs(); - [[nodiscard]] MemoryRegionAddressType getSelectedAddressType() const; + [[nodiscard]] MemoryRegionAddressInputType getSelectedAddressInputType() const; Targets::TargetMemoryAddressRange convertAbsoluteToRelativeAddressRange( const Targets::TargetMemoryAddressRange& absoluteAddressRange @@ -83,8 +83,8 @@ namespace Bloom::Widgets static inline const std::map addressRangeTypeOptionsByName = std::map< QString, AddressRangeTypeOption >({ - {"absolute", AddressRangeTypeOption("Absolute", MemoryRegionAddressType::ABSOLUTE)}, - {"relative", AddressRangeTypeOption("Relative", MemoryRegionAddressType::RELATIVE)}, + {"absolute", AddressRangeTypeOption("Absolute", MemoryRegionAddressInputType::ABSOLUTE)}, + {"relative", AddressRangeTypeOption("Relative", MemoryRegionAddressInputType::RELATIVE)}, }); void onAddressRangeInputChange();