aboutsummaryrefslogtreecommitdiff
path: root/core/src/UI/States.cpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-05-06 21:56:40 -0700
committerrtk0c <[email protected]>2021-05-06 21:56:40 -0700
commit1fd1e4b5f2418e3ac2909658993bfedb615537ec (patch)
tree6de080d2273890f8a74d7fcd3572bb44f44ac545 /core/src/UI/States.cpp
parent538e804fc9beb83e711a210ffbb6badc15f285d5 (diff)
Change brace style to on new line, add initial deliveries view when an order entry is selected
Diffstat (limited to 'core/src/UI/States.cpp')
-rw-r--r--core/src/UI/States.cpp15
1 files changed, 10 insertions, 5 deletions
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<UIState> uiStateInstance;
-void UIState::Init() {
+void UIState::Init()
+{
uiStateInstance = std::make_unique<UIState>();
}
-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> project) {
+void UIState::SetCurrentProject(std::unique_ptr<Project> project)
+{
CloseCurrentProject();
if (project) {
GlobalStates::GetInstance().MoveProjectToTop(*project);
@@ -31,7 +35,8 @@ void UIState::SetCurrentProject(std::unique_ptr<Project> project) {
CurrentProject = std::move(project);
}
-void UIState::CloseCurrentProject() {
+void UIState::CloseCurrentProject()
+{
if (CurrentProject) {
CurrentProject->WriteToDisk();
CurrentProject = nullptr;