Made project settings key names consistent

This commit is contained in:
Nav
2022-08-14 19:41:36 +01:00
parent f7460681f2
commit 52c165a72d
3 changed files with 31 additions and 31 deletions

View File

@@ -111,18 +111,18 @@ namespace Bloom
this->refreshIoInspectionButton = this->header->findChild<SvgToolButton*>("refresh-io-inspection-btn"); this->refreshIoInspectionButton = this->header->findChild<SvgToolButton*>("refresh-io-inspection-btn");
// Create panel states // Create panel states
if (!this->insightProjectSettings.previousLeftPanelState.has_value()) { if (!this->insightProjectSettings.leftPanelState.has_value()) {
this->insightProjectSettings.previousLeftPanelState = PanelState(); this->insightProjectSettings.leftPanelState = PanelState();
} }
if (!this->insightProjectSettings.previousBottomPanelState.has_value()) { if (!this->insightProjectSettings.bottomPanelState.has_value()) {
this->insightProjectSettings.previousBottomPanelState = PanelState(); this->insightProjectSettings.bottomPanelState = PanelState();
} }
this->leftMenuBar = this->container->findChild<QWidget*>("left-side-menu-bar"); this->leftMenuBar = this->container->findChild<QWidget*>("left-side-menu-bar");
this->leftPanel = new PanelWidget( this->leftPanel = new PanelWidget(
PanelWidgetType::LEFT, PanelWidgetType::LEFT,
this->insightProjectSettings.previousLeftPanelState.value(), this->insightProjectSettings.leftPanelState.value(),
this->container this->container
); );
this->leftPanel->setObjectName("left-panel"); this->leftPanel->setObjectName("left-panel");
@@ -140,7 +140,7 @@ namespace Bloom
this->bottomMenuBar = this->container->findChild<QWidget*>("bottom-menu-bar"); this->bottomMenuBar = this->container->findChild<QWidget*>("bottom-menu-bar");
this->bottomPanel = new PanelWidget( this->bottomPanel = new PanelWidget(
PanelWidgetType::BOTTOM, PanelWidgetType::BOTTOM,
this->insightProjectSettings.previousBottomPanelState.value(), this->insightProjectSettings.bottomPanelState.value(),
this->container this->container
); );
this->bottomPanel->setObjectName("bottom-panel"); this->bottomPanel->setObjectName("bottom-panel");
@@ -384,8 +384,8 @@ namespace Bloom
this->createPanes(); this->createPanes();
const auto& lastLeftPanelState = this->insightProjectSettings.previousLeftPanelState; const auto& lastLeftPanelState = this->insightProjectSettings.leftPanelState;
const auto& lastBottomPanelState = this->insightProjectSettings.previousBottomPanelState; const auto& lastBottomPanelState = this->insightProjectSettings.bottomPanelState;
if (lastLeftPanelState.has_value() && this->leftPanel != nullptr) { if (lastLeftPanelState.has_value() && this->leftPanel != nullptr) {
this->leftPanel->setSize(lastLeftPanelState->size); this->leftPanel->setSize(lastLeftPanelState->size);

View File

@@ -30,33 +30,33 @@ namespace Bloom
} }
} }
if (jsonObject.contains("previousLeftPanelState")) { if (jsonObject.contains("leftPanelState")) {
this->previousLeftPanelState = this->panelStateFromJson( this->leftPanelState = this->panelStateFromJson(
jsonObject.find("previousLeftPanelState")->toObject() jsonObject.find("leftPanelState")->toObject()
); );
} }
if (jsonObject.contains("previousBottomPanelState")) { if (jsonObject.contains("bottomPanelState")) {
this->previousBottomPanelState = this->panelStateFromJson( this->bottomPanelState = this->panelStateFromJson(
jsonObject.find("previousBottomPanelState")->toObject() jsonObject.find("bottomPanelState")->toObject()
); );
} }
if (jsonObject.contains("previousRegistersPaneState")) { if (jsonObject.contains("registersPaneState")) {
this->registersPaneState = this->paneStateFromJson( this->registersPaneState = this->paneStateFromJson(
jsonObject.find("previousRegistersPaneState")->toObject() jsonObject.find("registersPaneState")->toObject()
); );
} }
if (jsonObject.contains("previousRamInspectionPaneState")) { if (jsonObject.contains("ramInspectionPaneState")) {
this->ramInspectionPaneState = this->paneStateFromJson( this->ramInspectionPaneState = this->paneStateFromJson(
jsonObject.find("previousRamInspectionPaneState")->toObject() jsonObject.find("ramInspectionPaneState")->toObject()
); );
} }
if (jsonObject.contains("previousEepromInspectionPaneState")) { if (jsonObject.contains("eepromInspectionPaneState")) {
this->eepromInspectionPaneState = this->paneStateFromJson( this->eepromInspectionPaneState = this->paneStateFromJson(
jsonObject.find("previousEepromInspectionPaneState")->toObject() jsonObject.find("eepromInspectionPaneState")->toObject()
); );
} }
@@ -105,37 +105,37 @@ namespace Bloom
insightObj.insert("memoryInspectionPaneSettings", memoryInspectionPaneSettingsObj); insightObj.insert("memoryInspectionPaneSettings", memoryInspectionPaneSettingsObj);
if (this->previousLeftPanelState.has_value()) { if (this->leftPanelState.has_value()) {
insightObj.insert( insightObj.insert(
"previousLeftPanelState", "leftPanelState",
this->panelStateToJson(this->previousLeftPanelState.value()) this->panelStateToJson(this->leftPanelState.value())
); );
} }
if (this->previousBottomPanelState.has_value()) { if (this->bottomPanelState.has_value()) {
insightObj.insert( insightObj.insert(
"previousBottomPanelState", "bottomPanelState",
this->panelStateToJson(this->previousBottomPanelState.value()) this->panelStateToJson(this->bottomPanelState.value())
); );
} }
if (this->registersPaneState.has_value()) { if (this->registersPaneState.has_value()) {
insightObj.insert( insightObj.insert(
"previousRegistersPaneState", "registersPaneState",
this->paneStateToJson(this->registersPaneState.value()) this->paneStateToJson(this->registersPaneState.value())
); );
} }
if (this->ramInspectionPaneState.has_value()) { if (this->ramInspectionPaneState.has_value()) {
insightObj.insert( insightObj.insert(
"previousRamInspectionPaneState", "ramInspectionPaneState",
this->paneStateToJson(this->ramInspectionPaneState.value()) this->paneStateToJson(this->ramInspectionPaneState.value())
); );
} }
if (this->eepromInspectionPaneState.has_value()) { if (this->eepromInspectionPaneState.has_value()) {
insightObj.insert( insightObj.insert(
"previousEepromInspectionPaneState", "eepromInspectionPaneState",
this->paneStateToJson(this->eepromInspectionPaneState.value()) this->paneStateToJson(this->eepromInspectionPaneState.value())
); );
} }

View File

@@ -20,8 +20,8 @@ namespace Bloom
{ {
public: public:
std::optional<QSize> mainWindowSize; std::optional<QSize> mainWindowSize;
std::optional<Widgets::PanelState> previousLeftPanelState; std::optional<Widgets::PanelState> leftPanelState;
std::optional<Widgets::PanelState> previousBottomPanelState; std::optional<Widgets::PanelState> bottomPanelState;
std::optional<Widgets::PaneState> registersPaneState; std::optional<Widgets::PaneState> registersPaneState;
std::optional<Widgets::PaneState> ramInspectionPaneState; std::optional<Widgets::PaneState> ramInspectionPaneState;
std::optional<Widgets::PaneState> eepromInspectionPaneState; std::optional<Widgets::PaneState> eepromInspectionPaneState;