summaryrefslogtreecommitdiff
path: root/src/ui/ui_projects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/ui_projects.cpp')
-rw-r--r--src/ui/ui_projects.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/ui/ui_projects.cpp b/src/ui/ui_projects.cpp
index e7fa86f..560bc72 100644
--- a/src/ui/ui_projects.cpp
+++ b/src/ui/ui_projects.cpp
@@ -39,7 +39,7 @@ static void draw_project_form()
bool viewing_only = (current_view_state == view_state::VIEW);
static const char* selected_country = NULL;
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
active_project = administration_project_create_empty();
selected_country = 0;
@@ -51,10 +51,10 @@ static void draw_project_form()
a_err last_err = administration_project_is_valid(active_project);
ImGui::SetNextItemWidth(widthAvailable*0.2f);
- ImGui::InputText(localize("project.form.identifier"), active_project.id, IM_ARRAYSIZE(active_project.id));
+ ImGui::InputText(locale::get("project.form.identifier"), active_project.id, IM_ARRAYSIZE(active_project.id));
if (!viewing_only) ImGui::EndDisabled();
- ImGui::FormInputTextWithErrorHint(localize("project.form.description"), active_project.description, IM_ARRAYSIZE(active_project.description), last_err & A_ERR_MISSING_DESCRIPTION);
+ ImGui::FormInputTextWithErrorHint(locale::get("project.form.description"), active_project.description, IM_ARRAYSIZE(active_project.description), last_err & A_ERR_MISSING_DESCRIPTION);
if (viewing_only) ImGui::EndDisabled();
@@ -64,7 +64,7 @@ static void draw_project_form()
if (!can_save) ImGui::BeginDisabled();
// Save button
ImGui::Spacing();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
if (current_view_state == view_state::CREATE) {
administration_project_add(active_project);
}
@@ -91,7 +91,7 @@ static void draw_project_list()
s32 max_page = (administration_project_count() + items_per_page - 1) / items_per_page;
if (max_page == 0) max_page = 1;
- if (ImGui::Button(localize("form.create")))
+ if (ImGui::Button(locale::get("form.create")))
{
current_view_state = view_state::CREATE;
active_project = administration_project_create_empty();
@@ -103,7 +103,7 @@ static void draw_project_list()
ImGui::SameLine();
bool enable_prev = current_page > 0;
if (!enable_prev) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.prev")) && current_page > 0) current_page--;
+ if (ImGui::Button(locale::get("ui.prev")) && current_page > 0) current_page--;
if (!enable_prev) ImGui::EndDisabled();
ImGui::SameLine();
@@ -112,16 +112,16 @@ static void draw_project_list()
ImGui::SameLine();
bool enable_next = current_page < max_page-1;
if (!enable_next) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.next")) && current_page < max_page-1) current_page++;
+ if (ImGui::Button(locale::get("ui.next")) && current_page < max_page-1) current_page++;
if (!enable_next) ImGui::EndDisabled();
ImGui::Spacing();
if (ImGui::BeginTable("TableProjects", 4, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg)) {
- ImGui::TableSetupColumn(localize("project.table.identifier"), ImGuiTableColumnFlags_WidthFixed, 80);
- ImGui::TableSetupColumn(localize("project.table.status"), ImGuiTableColumnFlags_WidthFixed, 140);
- ImGui::TableSetupColumn(localize("project.table.description"), ImGuiTableColumnFlags_WidthStretch);
+ ImGui::TableSetupColumn(locale::get("project.table.identifier"), ImGuiTableColumnFlags_WidthFixed, 80);
+ ImGui::TableSetupColumn(locale::get("project.table.status"), ImGuiTableColumnFlags_WidthFixed, 140);
+ ImGui::TableSetupColumn(locale::get("project.table.description"), ImGuiTableColumnFlags_WidthStretch);
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 160);
ImGui::TableHeadersRow();
@@ -133,13 +133,13 @@ static void draw_project_list()
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text(c.id);
- ImGui::TableSetColumnIndex(1); ImGui::Text(localize(administration_project_get_status_string(c)));
+ ImGui::TableSetColumnIndex(1); ImGui::Text(locale::get(administration_project_get_status_string(c)));
ImGui::TableSetColumnIndex(2); ImGui::Text(c.description);
ImGui::TableSetColumnIndex(3);
char btn_name[20];
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.view"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.view"), i);
if (ImGui::Button(btn_name)) {
active_project = c;
current_view_state = view_state::VIEW;
@@ -148,14 +148,14 @@ static void draw_project_list()
if (c.state == project_state::PROJECT_RUNNING)
{
ImGui::SameLine();
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.change"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.change"), i);
if (ImGui::Button(btn_name)) {
active_project = c;
current_view_state = view_state::EDIT;
}
ImGui::SameLine();
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.cancel"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.cancel"), i);
if (ImGui::Button(btn_name)) {
selected_for_cancellation = c;
ImGui::OpenPopup("ConfirmCancelProject");
@@ -164,15 +164,15 @@ static void draw_project_list()
}
if (ImGui::BeginPopupModal("ConfirmCancelProject", nullptr, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoTitleBar)) {
- ImGui::Text(localize("form.confirmCancelProject"));
+ ImGui::Text(locale::get("form.confirmCancelProject"));
ImGui::Separator();
- if (ImGui::Button(localize("form.yes"), ImVec2(120, 0))) {
+ if (ImGui::Button(locale::get("form.yes"), ImVec2(120, 0))) {
administration_project_cancel(selected_for_cancellation);
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
- if (ImGui::Button(localize("form.no"), ImVec2(120, 0))) {
+ if (ImGui::Button(locale::get("form.no"), ImVec2(120, 0))) {
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();