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

View File

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

View File

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