cleaned up
This commit is contained in:
@ -18,7 +18,7 @@ func _ready() -> void:
|
||||
config.connect("theme_changed", self, "_on_theme_changed")
|
||||
|
||||
# warning-ignore:return_value_discarded
|
||||
config.connect("file_changed", self, "_on_current_file_changed")
|
||||
config.connect("time_sheet_loaded", self, "_on_current_file_changed")
|
||||
|
||||
# warning-ignore:return_value_discarded
|
||||
file_path_button.connect("pressed", self, "_on_file_path_button_pressed")
|
||||
@ -52,9 +52,9 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func _on_current_file_changed() -> void:
|
||||
file_path_file_dialog.current_path = config.current_file
|
||||
file_path_file_dialog.current_dir = config.current_file.get_base_dir()
|
||||
file_path_line_edit.text = config.current_file
|
||||
file_path_file_dialog.current_path = config.current_timesheet_file_path
|
||||
file_path_file_dialog.current_dir = config.current_timesheet_file_path.get_base_dir()
|
||||
file_path_line_edit.text = config.current_timesheet_file_path
|
||||
|
||||
|
||||
func _on_theme_changed() -> void:
|
||||
|
@ -28,21 +28,6 @@ func populate_entries() -> void:
|
||||
var item_entries_tree := config.timesheet.make_items_tree()
|
||||
_populate_from_entry(tree_items_root, item_entries_tree)
|
||||
_timer.start()
|
||||
#for item in entries:
|
||||
# warning-ignore:return_value_discarded
|
||||
# set_entry(entry)
|
||||
|
||||
|
||||
# warning-ignore:unused_argument
|
||||
func set_time_elapsed(total_elapsed: int) -> void:
|
||||
#current_item.set_text(COL.TIME, TimeEntry.time_to_period(total_elapsed))
|
||||
#current_item.set_metadata(COL.TIME, total_elapsed)
|
||||
pass
|
||||
|
||||
|
||||
func set_current_item(_task_name: String) -> void:
|
||||
#current_item = append_name_to_tree(task_name, 0)
|
||||
pass
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
|
@ -25,15 +25,6 @@ func _ready() -> void:
|
||||
# warning-ignore:return_value_discarded
|
||||
config.connect("time_sheet_loaded", self, "_on_time_sheet_loaded")
|
||||
update_timer_state()
|
||||
# warning-ignore:return_value_discarded
|
||||
#config.connect("entry_started", self, "set_button_as_started")
|
||||
# warning-ignore:return_value_discarded
|
||||
#config.connect("entry_stopped", self, "set_button_as_stopped")
|
||||
# TODO: connect this:
|
||||
#time_entries_items_tree.item_selected.connect(
|
||||
# func item_selected() -> void:
|
||||
# task_name_line_edit.text = time_entries_items_tree.get_current_text()
|
||||
#)
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
@ -45,8 +36,10 @@ func _on_start_button_toggled(_is_on: bool) -> void:
|
||||
if config.sound_fx_on:
|
||||
audio_stream_player.play()
|
||||
if current_time_entry != null:
|
||||
# warning-ignore:return_value_discarded
|
||||
config.timesheet.stop_entry(task_name_line_edit.text)
|
||||
else:
|
||||
# warning-ignore:return_value_discarded
|
||||
config.timesheet.add_entry(task_name_line_edit.text)
|
||||
|
||||
|
||||
@ -56,7 +49,6 @@ func _on_task_name_line_edit_text_changed(new_text: String) -> void:
|
||||
|
||||
|
||||
func _on_time_sheet_loaded():
|
||||
print("loaded")
|
||||
update_timer_state()
|
||||
|
||||
func update_timer_state() -> void:
|
||||
@ -76,8 +68,6 @@ func set_button_as_stopped() -> void:
|
||||
|
||||
|
||||
func set_button_as_started() -> void:
|
||||
## TODO: make this independent
|
||||
# time_entries_items_tree.set_current_item(config.timesheet.current_entry.name)
|
||||
start_button.set_pressed_no_signal(true)
|
||||
start_button.hint_tooltip = tr(Consts.STOP)
|
||||
start_button.theme_type_variation = Consts.THEME_OVERRIDE_STOP
|
||||
|
Reference in New Issue
Block a user