summaryrefslogtreecommitdiff
path: root/src/administration_reader.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-09-17 17:55:54 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-09-17 17:55:54 +0200
commit41ddcc70f6ac27688c0a7dccc975c4b72de718e2 (patch)
treefaa8cb49befe057068769a4a08bc0b4ab2a4a882 /src/administration_reader.cpp
parent3a3fac243c013f3d211bb5141e18c82e62deacf9 (diff)
add license
Diffstat (limited to 'src/administration_reader.cpp')
-rw-r--r--src/administration_reader.cpp30
1 files changed, 30 insertions, 0 deletions
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 <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.
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
@@ -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) {