diff options
| author | Aldrik Ramaekers <aldrik.ramaekers@protonmail.com> | 2020-02-05 20:54:59 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik.ramaekers@protonmail.com> | 2020-02-05 20:54:59 +0100 |
| commit | 6dd97a5b4ae11eaae68d78dec80fc8d3d81b7ed5 (patch) | |
| tree | 6701411e88d571b8b60b6cd2961cd8aa2e38c02d /src/mo_edit.c | |
| parent | 8c2f35bd1f18b62fff609f3a7d77d4e85b706916 (diff) | |
work
Diffstat (limited to 'src/mo_edit.c')
| -rw-r--r-- | src/mo_edit.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/src/mo_edit.c b/src/mo_edit.c index 4843809..c43015d 100644 --- a/src/mo_edit.c +++ b/src/mo_edit.c @@ -7,13 +7,13 @@ #include "config.h" #include "project_base.h" -// TODO(Aldrik): option to disable menu item // TODO(Aldrik): move the delete button for term to edit panel on the topright // TODO(Aldrik): language mo file name preview when entering name // TODO(Aldrik): option to mark languages with colors // TODO(Aldrik): change save icon // TODO(Aldrik): delete file of language when deleting language -// TODO(Aldrik): confirmation on deletion of term and language (replace delete button with "Confirm" button to confirm deletion) +// TODO(Aldrik): control scrollbar with mouse +// TODO(Aldrik): ctrl+enter to insert newline into textbox s32 global_language_id = 1; char project_path[MAX_INPUT_LENGTH]; @@ -485,14 +485,30 @@ int main(int argc, char **argv) } if (ui_push_menu_item(localize("save_project"), "Ctrl + S")) { - if (string_equals(project_path, "")) - save_project(); + if (current_project) + { + if (string_equals(project_path, "")) + save_project(); + else + save_project_to_folder(project_path); + } else - save_project_to_folder(project_path); + { + // TODO(Aldrik): localize + platform_show_message(main_window, "No project to save", "Error saving project"); + } } if (ui_push_menu_item(localize("save_project_as"), "Ctrl + E")) { - save_project(); + if (current_project) + { + save_project(); + } + else + { + // TODO(Aldrik): localize + platform_show_message(main_window, "No project to save", "Error saving project"); + } } ui_push_menu_item_separator(); if (ui_push_menu_item(localize("quit"), "Ctrl + Q")) @@ -549,7 +565,7 @@ int main(int argc, char **argv) if (!strlen(tb_filter.buffer) || string_contains(t->name, tb_filter.buffer)) { bool removed = false; - if (ui_push_button_image(&btn_summary, "", delete_img)) + if (ui_push_button_image_with_confirmation(&btn_summary, "", delete_img)) { removed = true; } @@ -581,9 +597,6 @@ int main(int argc, char **argv) remove_term_from_project(i); --i; if (i >= 0) select_term(i); - - if (current_project->selected_term_index >= 0) - current_project->selected_term_index--; } } } @@ -745,7 +758,7 @@ int main(int argc, char **argv) button_state btn_remove = ui_create_button(); bool pressed = false; - if (ui_push_button_image(&btn_remove, "", delete_img)) + if (ui_push_button_image_with_confirmation(&btn_remove, "", delete_img)) { pressed = true; } |
