diff options
Diffstat (limited to 'src/administration_writer.cpp')
| -rw-r--r-- | src/administration_writer.cpp | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/administration_writer.cpp b/src/administration_writer.cpp index 119f4b4..26e26c8 100644 --- a/src/administration_writer.cpp +++ b/src/administration_writer.cpp @@ -1,3 +1,19 @@ +/* +* Copyright (c) 2025 Aldrik Ramaekers <aldrik.ramaekers@gmail.com> +* +* Permission to use, copy, modify, and/or distribute this software for any +* purpose with or without fee is hereby granted, provided that the above +* copyright notice and this permission notice appear in all copies. +* +* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + #define _CRT_SECURE_NO_WARNINGS #include <zip.h> @@ -6,6 +22,8 @@ #include <threads.h> #include "log.hpp" +#include "ui.hpp" +#include "locales.hpp" #include "strops.hpp" #include "administration_reader.hpp" #include "administration_writer.hpp" @@ -16,7 +34,12 @@ mtx_t _save_file_mutex; static void on_administration_data_changed() { - administration_writer_save_all_administration_info_blocking(); + if (administration_writer_save_all_administration_info_blocking()) { + ui_set_status(localize("status.saved")); + } + else { + ui_set_status(localize("status.saveFailed")); + } } static void on_administration_data_deleted(char id[MAX_LEN_ID]) @@ -682,10 +705,11 @@ static int administration_writer_write_all_t(void *arg) { bool administration_writer_save_all_async() { - thrd_t thr; - if (thrd_create(&thr, administration_writer_write_all_t, 0) != thrd_success) { - return false; - } + administration_writer_write_all_t(0); + //thrd_t thr; + //if (thrd_create(&thr, administration_writer_write_all_t, 0) != thrd_success) { + // return false; + //} return true; }
\ No newline at end of file |
