diff options
| author | dam <dam@gudinoff> | 2022-01-06 11:19:43 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2022-01-06 11:19:43 +0000 |
| commit | 6a2887783f19e0a94db00dea014e1065b87e626c (patch) | |
| tree | 0b71e7c0c1d5bdfcda6a5ca7af0bb10c9d37bb8c /menu/menu.gd | |
| parent | 06b2f34ba64726028f494060376044531d763668 (diff) | |
| download | surgery-log-6a2887783f19e0a94db00dea014e1065b87e626c.tar.zst surgery-log-6a2887783f19e0a94db00dea014e1065b87e626c.zip | |
Prepare filters' logic.
Diffstat (limited to 'menu/menu.gd')
| -rw-r--r-- | menu/menu.gd | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/menu/menu.gd b/menu/menu.gd index 3384436..b5e1ef2 100644 --- a/menu/menu.gd +++ b/menu/menu.gd @@ -16,6 +16,7 @@ onready var popup := get_popup() as PopupMenu onready var confirm_action := get_node("/root/main/confirm_action") as ConfirmationDialog 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(): @@ -37,31 +38,28 @@ func dialog_cancelled(confirmation_signal_name: String): func _menu_import_filters_action(): - return file_picker.window_title = "IMPORT FILTERS" file_picker.mode = FileDialog.MODE_OPEN_FILE file_picker.current_dir = OS.get_system_dir(OS.SYSTEM_DIR_DOWNLOADS) -# file_picker.connect("file_selected", filters, "TODO", [], CONNECT_ONESHOT) -# file_picker.show_modal(true) -# file_picker.invalidate() + file_picker.connect("file_selected", stage, "load_filters", [], CONNECT_ONESHOT) + file_picker.show_modal(true) + file_picker.invalidate() func _menu_export_filters_action(): - return file_picker.window_title = "EXPORT FILTERS" file_picker.mode = FileDialog.MODE_SAVE_FILE file_picker.current_dir = OS.get_system_dir(OS.SYSTEM_DIR_DOWNLOADS) -# file_picker.connect("file_selected", filters, "TODO", [], CONNECT_ONESHOT) -# file_picker.show_modal(true) -# file_picker.invalidate() + file_picker.connect("file_selected", stage, "store_filters", [], CONNECT_ONESHOT) + file_picker.show_modal(true) + file_picker.invalidate() func _menu_clear_filters_action(): - return confirm_action.window_title = "CLEAR FILTERS" confirm_action.dialog_text = "Do you want to delete all filters?" -# confirm_action.connect("confirmed", filters, "TDO", [true], CONNECT_ONESHOT) -# confirm_action.show_modal(true) + confirm_action.connect("confirmed", stage, "clear_filters", [true], CONNECT_ONESHOT) + confirm_action.show_modal(true) func _menu_export_data_action(): @@ -83,11 +81,10 @@ func _menu_clear_data_action(): func _menu_about_action(): confirm_action.window_title = "FAKE DB" confirm_action.dialog_text = "About text here!" -# confirm_action.connect("confirmed", database, "fake_database", [true], CONNECT_ONESHOT) confirm_action.show_modal(true) - +# @DAM Hide this debug method before release. func _menu_fake_db_action(): confirm_action.window_title = "FAKE DB" confirm_action.dialog_text = "Do you want to delete all entries from the database and replace by fake entries?" |
