From 41ddcc70f6ac27688c0a7dccc975c4b72de718e2 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Wed, 17 Sep 2025 17:55:54 +0200 Subject: add license --- src/administration_reader.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/administration_reader.cpp') diff --git a/src/administration_reader.cpp b/src/administration_reader.cpp index 529d8c0..8c6bf89 100644 --- a/src/administration_reader.cpp +++ b/src/administration_reader.cpp @@ -1,3 +1,19 @@ +/* +* Copyright (c) 2025 Aldrik Ramaekers +* +* 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. +*/ + #include #include #include @@ -23,6 +39,20 @@ bool administration_reader_open_new() return true; } +bool administration_reader_save_new() +{ + // @localize + char const * lFilterPatterns[1] = { "*.openbook" }; + char* save_path = tinyfd_saveFileDialog("Select destination", NULL, 1, lFilterPatterns, NULL); + + if (!save_path) return false; + + administration_set_file_path(save_path); + administration_writer_save_all_async(); + + return true; +} + bool administration_reader_open_existing(char* file_path) { if (file_path == NULL) { -- cgit v1.2.3-70-g09d2