aboutsummaryrefslogtreecommitdiff
path: root/core/src/UI/UI_Templates.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/UI/UI_Templates.cpp')
-rw-r--r--core/src/UI/UI_Templates.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/src/UI/UI_Templates.cpp b/core/src/UI/UI_Templates.cpp
index cf53461..4f6e69e 100644
--- a/core/src/UI/UI_Templates.cpp
+++ b/core/src/UI/UI_Templates.cpp
@@ -1,10 +1,10 @@
#include "UI.hpp"
+#include "Model/GlobalStates.hpp"
#include "Model/Project.hpp"
#include "Model/Template/TableTemplate.hpp"
#include "Model/Template/Template.hpp"
#include "UI/Localization.hpp"
-#include "UI/States.hpp"
#include <imgui.h>
#include <imgui_extra_math.h>
@@ -141,8 +141,8 @@ struct DrawTemplateList_State
void DrawTemplateList(DrawTemplateList_State& state)
{
- auto& uis = UIState::GetInstance();
- auto& templates = uis.CurrentProject->GetTemplates();
+ auto& gs = GlobalStates::GetInstance();
+ auto& templates = gs.GetCurrentProject()->GetTemplates();
for (auto& info : templates) {
if (ImGui::Selectable(info.Name.c_str(), state.SelectedTemplate == &info)) {
@@ -160,7 +160,7 @@ void DrawTemplateList(DrawTemplateList_State& state)
void UI::TemplatesTab()
{
auto ls = LocaleStrings::Instance.get();
- auto& uis = UIState::GetInstance();
+ auto& gs = GlobalStates::GetInstance();
bool openedDummy = true;
static std::unique_ptr<TemplateUI> openTemplate;
@@ -210,7 +210,7 @@ void UI::TemplatesTab()
newNameError = NameSelectionError::Empty;
}
- auto& templates = uis.CurrentProject->GetTemplates();
+ auto& templates = gs.GetCurrentProject()->GetTemplates();
if (templates.find(newName) != templates.end()) {
newNameError = NameSelectionError::Duplicated;
}
@@ -257,7 +257,7 @@ void UI::TemplatesTab()
}
if (ImGui::Button(ls->DialogConfirm.Get(), IsInputValid())) {
- auto& project = *uis.CurrentProject;
+ auto& project = *gs.GetCurrentProject();
project.InsertTemplate(
newName,
@@ -290,7 +290,7 @@ void UI::TemplatesTab()
}
if (ImGui::Button(ls->DialogConfirm.Get(), IsInputValid())) {
- auto& project = *uis.CurrentProject;
+ auto& project = *gs.GetCurrentProject();
project.RenameTemplate(
state.SelectedTemplate->Name,
@@ -316,7 +316,7 @@ void UI::TemplatesTab()
assert(state.SelectedTemplate != nullptr);
if (ImGui::Button(ls->DialogConfirm.Get())) {
- uis.CurrentProject->RemoveTemplate(state.SelectedTemplate->Name);
+ gs.GetCurrentProject()->RemoveTemplate(state.SelectedTemplate->Name);
}
ImGui::SameLine();
if (ImGui::Button(ls->DialogCancel.Get())) {