aboutsummaryrefslogtreecommitdiff
path: root/menu
diff options
context:
space:
mode:
authordam <dam@gudinoff>2022-04-10 08:32:49 +0000
committerdam <dam@gudinoff>2022-04-10 08:32:49 +0000
commit2d7da6bbc23fb917dfe931eaeb5566da0a102ac3 (patch)
treeae4d7541267dd1a7a5633ff79ac7de1e9055437b /menu
parent75791aecbff0d8adc1011f45a69877cabff616e0 (diff)
downloadsurgery-log-2d7da6bbc23fb917dfe931eaeb5566da0a102ac3.tar.zst
surgery-log-2d7da6bbc23fb917dfe931eaeb5566da0a102ac3.zip
Code cleanup.
Diffstat (limited to 'menu')
-rw-r--r--menu/font_b612.txt93
-rw-r--r--menu/godot.txt20
-rw-r--r--menu/menu.gd121
3 files changed, 0 insertions, 234 deletions
diff --git a/menu/font_b612.txt b/menu/font_b612.txt
deleted file mode 100644
index 2826948..0000000
--- a/menu/font_b612.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-Copyright 2012 The B612 Project Authors (https://github.com/polarsys/b612)
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-This license is copied below, and is also available with a FAQ at:
-http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/menu/godot.txt b/menu/godot.txt
deleted file mode 100644
index bee83fb..0000000
--- a/menu/godot.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur.
-Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md).
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/menu/menu.gd b/menu/menu.gd
deleted file mode 100644
index d6e1501..0000000
--- a/menu/menu.gd
+++ /dev/null
@@ -1,121 +0,0 @@
-extends MenuButton
-
-const menu_items: Array = [
- { label = "Import Option Sets", action = "import_option_sets_action" },
- { label = "Export Option Sets", action = "export_option_sets_action" },
- { label = "Clear Option Sets", action = "clear_option_sets_action" },
- { label = "Import Database", action = "import_database_action" },
- { label = "Export Database", action = "export_database_action" },
- { label = "Clear Database", action = "clear_database_action" },
- { label = "About", action = "about_action" },
-]
-const license_font_b612: String = "res://licenses/font_b612.txt"
-const license_godot: String = "res://licenses/godot.txt"
-
-onready var menu := get_popup() as PopupMenu
-onready var popup := get_node("/root/main/popup") as ModalPopup
-onready var dialog := get_node("/root/main/dialog") as Dialog
-onready var file_picker := get_node("/root/main/file_picker") as FileDialog
-onready var database := get_node("/root/main/database") as Database
-onready var stage := get_node("/root/main/stage") as Stage
-
-
-func _ready():
- for idx in range(menu_items.size()):
- menu.add_item(menu_items[idx].label, idx)
- menu.connect("id_pressed", self, "id_pressed")
-
-
-func id_pressed(id: int):
- self.call_deferred(menu_items[id].action)
-
-
-func import_option_sets_action():
- dialog.setup("All option sets from the dropdown menus will be replaced.", "Continue", "No")
- dialog.connect("accepted", self, "import_option_sets_action_accepted")
- popup.open_popup("Replace option sets?", dialog)
-
-
-func import_option_sets_action_accepted():
- file_picker.mode = FileDialog.MODE_OPEN_FILE
- file_picker.current_dir = OS.get_system_dir(OS.SYSTEM_DIR_DOWNLOADS)
- file_picker.filters = ["*.json", "*.csv"]
- file_picker.current_file = ""
- file_picker.connect("file_selected", self, "import_option_sets")
- file_picker.show_modal(true)
- file_picker.invalidate()
-
-
-func import_option_sets(file_path: String):
- stage.load_option_sets(file_path)
- stage.save_option_sets()
-
-
-func export_option_sets_action():
- file_picker.mode = FileDialog.MODE_SAVE_FILE
- file_picker.current_dir = OS.get_system_dir(OS.SYSTEM_DIR_DOWNLOADS)
- file_picker.filters = ["*.json"]
- file_picker.current_file = ""
- file_picker.connect("file_selected", stage, "save_option_sets")
- file_picker.show_modal(true)
- file_picker.invalidate()
-
-
-func clear_option_sets_action():
- dialog.setup("All option sets from the dropdown menus will be deleted.", "Delete all", "No")
- dialog.connect("accepted", self, "clear_option_sets")
- popup.open_popup("Clear option sets?", dialog)
-
-
-func clear_option_sets():
- stage.clear_option_sets()
- stage.save_option_sets()
-
-
-func import_database_action():
- dialog.setup("All entries from the database will be replaced.", "Continue", "No")
- dialog.connect("accepted", self, "import_database_action_accepted")
- popup.open_popup("Replace database?", dialog)
-
-
-func import_database_action_accepted():
- file_picker.mode = FileDialog.MODE_OPEN_FILE
- file_picker.current_dir = OS.get_system_dir(OS.SYSTEM_DIR_DOWNLOADS)
- file_picker.filters = ["*.json", "*.csv"]
- file_picker.current_file = ""
- file_picker.connect("file_selected", self, "import_database")
- file_picker.show_modal(true)
- file_picker.invalidate()
-
-
-func import_database(file_path: String):
- database.load_database(file_path)
- database.save_database()
-
-
-func export_database_action():
- file_picker.mode = FileDialog.MODE_SAVE_FILE
- file_picker.current_dir = OS.get_system_dir(OS.SYSTEM_DIR_DOWNLOADS)
- file_picker.filters = ["*.csv"]
- file_picker.current_file = ""
- file_picker.connect("file_selected", database, "save_database")
- file_picker.show_modal(true)
- file_picker.invalidate()
-
-
-func clear_database_action():
- dialog.setup("All entries from the database will be deleted.", "Delete all", "No")
- dialog.connect("accepted", self, "clear_database")
- popup.open_popup("Clear database?", dialog)
-
-
-func clear_database():
- database.clear_database()
- database.save_database()
-
-
-func about_action():
- dialog.setup("Surgery Log\nversion 0.1", "", "")
- popup.open_popup("About", dialog)
-
-