From d3fa128d5408673b0ea8d3ba3435c38b258a5e7a Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sat, 5 Jun 2021 14:58:09 -0700 Subject: Merge UIState into GlobalStates --- core/src/UI/UI_Workflows.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'core/src/UI/UI_Workflows.cpp') diff --git a/core/src/UI/UI_Workflows.cpp b/core/src/UI/UI_Workflows.cpp index ac023c9..51cc4f8 100644 --- a/core/src/UI/UI_Workflows.cpp +++ b/core/src/UI/UI_Workflows.cpp @@ -1,5 +1,6 @@ #include "UI.hpp" +#include "Model/GlobalStates.hpp" #include "Model/Project.hpp" #include "Model/Workflow/Nodes/DocumentNodes.hpp" #include "Model/Workflow/Nodes/NumericNodes.hpp" @@ -7,7 +8,6 @@ #include "Model/Workflow/Nodes/UserInputNodes.hpp" #include "Model/Workflow/Workflow.hpp" #include "UI/Localization.hpp" -#include "UI/States.hpp" #include "Utils/Macros.hpp" #include @@ -366,8 +366,8 @@ struct DrawTemplateList_State void DrawTemplateList(DrawTemplateList_State& state) { - auto& uis = UIState::GetInstance(); - auto& workflows = uis.CurrentProject->GetWorkflows(); + auto& gs = GlobalStates::GetInstance(); + auto& workflows = gs.GetCurrentProject()->GetWorkflows(); // TODO sort the list for (auto& info : workflows) { @@ -386,7 +386,7 @@ void DrawTemplateList(DrawTemplateList_State& state) void UI::WorkflowsTab() { auto ls = LocaleStrings::Instance.get(); - auto& uis = UIState::GetInstance(); + auto& gs = GlobalStates::GetInstance(); bool openedDummy = true; static std::unique_ptr openWorkflow; @@ -439,14 +439,14 @@ void UI::WorkflowsTab() newNameError = NameSelectionError::Empty; } - auto& workflows = uis.CurrentProject->GetWorkflows(); + auto& workflows = gs.GetCurrentProject()->GetWorkflows(); if (workflows.find(newName) != workflows.end()) { newNameError = NameSelectionError::Duplicated; } } if (ImGui::Button(ls->DialogConfirm.Get(), newName.empty())) { - auto& project = uis.CurrentProject; + auto project = gs.GetCurrentProject(); project->RenameWorkflow(state.SelectedWorkflow->Name, newName); state.SelectedWorkflow = &project->GetWorkflows().at(newName); } @@ -473,7 +473,7 @@ void UI::WorkflowsTab() } if (ImGui::BeginPopupModal("Delete confirmation")) { if (ImGui::Button(ls->DialogConfirm.Get())) { - uis.CurrentProject->RemoveWorkflow(state.SelectedWorkflow->Name); + gs.GetCurrentProject()->RemoveWorkflow(state.SelectedWorkflow->Name); } ImGui::SameLine(); if (ImGui::Button(ls->DialogCancel.Get())) { -- cgit v1.2.3-70-g09d2