diff options
author | rtk0c <[email protected]> | 2021-06-05 14:58:09 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-06-05 14:58:09 -0700 |
commit | d3fa128d5408673b0ea8d3ba3435c38b258a5e7a (patch) | |
tree | 20ff77021bae4dc69f0bba4d1b65330e0301600a /core/src/UI/UI_Workflows.cpp | |
parent | beb1f3969e13af72bd9098d484b693e397cf7235 (diff) |
Merge UIState into GlobalStates
Diffstat (limited to 'core/src/UI/UI_Workflows.cpp')
-rw-r--r-- | core/src/UI/UI_Workflows.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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 <imgui.h> @@ -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<WorkflowUI> 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())) { |