From 0093ad0682e493e5f8115566f71c8cb8a2d7c0d9 Mon Sep 17 00:00:00 2001 From: dam Date: Mon, 4 Apr 2022 10:36:26 +0000 Subject: Implement back button logic. --- logic/database.gd | 13 ------------- logic/popup.gd | 4 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) (limited to 'logic') diff --git a/logic/database.gd b/logic/database.gd index ed39d43..ea27ef2 100644 --- a/logic/database.gd +++ b/logic/database.gd @@ -38,19 +38,6 @@ func _ready(): clear_selection() -func _notification(what: int): - # @DAM This code should be moved into the main.gd which should check which node was currently - # active and above, and send the signal there. - if visible == false || has_focus() == false: - return - - if what == MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST: - if selected_idx >= 0: - clear_selection() - else: - get_tree().quit() - - func get_entry_view(database_entry: Dictionary) -> String: return "%6s | %6s | %s" % [database_entry.process_id, database_entry.surgery_id, DatabaseEntry.get_entry_date(database_entry)] diff --git a/logic/popup.gd b/logic/popup.gd index 31897c7..d7c98f9 100644 --- a/logic/popup.gd +++ b/logic/popup.gd @@ -21,7 +21,7 @@ func _init(): func _ready(): - dismiss.connect("pressed", self, "_dismiss") + dismiss.connect("pressed", self, "dismiss") func _clear_signals(): @@ -33,7 +33,7 @@ func _clear_signals(): disconnect(it.signal, it.target, it.method) -func _dismiss(): +func dismiss(): emit_signal("dismissed") close_popup() -- cgit v1.2.3