From 1fd1e4b5f2418e3ac2909658993bfedb615537ec Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 6 May 2021 21:56:40 -0700 Subject: Change brace style to on new line, add initial deliveries view when an order entry is selected --- core/src/UI/States.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'core/src/UI/States.cpp') diff --git a/core/src/UI/States.cpp b/core/src/UI/States.cpp index 546e1ab..b7b4c9f 100644 --- a/core/src/UI/States.cpp +++ b/core/src/UI/States.cpp @@ -8,22 +8,26 @@ static std::unique_ptr uiStateInstance; -void UIState::Init() { +void UIState::Init() +{ uiStateInstance = std::make_unique(); } -void UIState::Shutdown() { +void UIState::Shutdown() +{ if (uiStateInstance) { uiStateInstance->CloseCurrentProject(); uiStateInstance = nullptr; } } -UIState& UIState::GetInstance() { +UIState& UIState::GetInstance() +{ return *uiStateInstance; } -void UIState::SetCurrentProject(std::unique_ptr project) { +void UIState::SetCurrentProject(std::unique_ptr project) +{ CloseCurrentProject(); if (project) { GlobalStates::GetInstance().MoveProjectToTop(*project); @@ -31,7 +35,8 @@ void UIState::SetCurrentProject(std::unique_ptr project) { CurrentProject = std::move(project); } -void UIState::CloseCurrentProject() { +void UIState::CloseCurrentProject() +{ if (CurrentProject) { CurrentProject->WriteToDisk(); CurrentProject = nullptr; -- cgit v1.2.3-70-g09d2