Repository: godotengine/godot
File: editor/animation/animation_track_editor.cpp (C++)

Code before:

	track_copy_dialog = memnew(ConfirmationDialog);
	add_child(track_copy_dialog);
	track_copy_dialog->set_title(TTR("Select Tracks to Copy"));
	track_copy_dialog->set_ok_button_text(TTR("Copy"));

	VBoxContainer *track_copy_vbox = memnew(VBoxContainer);
	track_copy_dialog->add_child(track_copy_vbox);

	Button *select_all_button = memnew(Button);
	select_all_button->set_text(TTR("Select All/None"));
	select_all_button->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_select_all_tracks_for_copy));
	track_copy_vbox->add_child(select_all_button);

	track_copy_select = memnew(Tree);
	track_copy_select->set_accessibility_name(TTRC("Copy Selection"));
	track_copy_select->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
	track_copy_select->set_h_size_flags(SIZE_EXPAND_FILL);
	track_copy_select->set_v_size_flags(SIZE_EXPAND_FILL);
	track_copy_select->set_hide_root(true);
	track_copy_vbox->add_child(track_copy_select);
	track_copy_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_COPY_TRACKS_CONFIRM));

	read_only_dialog = memnew(AcceptDialog);
	read_only_dialog->set_title(TTR("Key Insertion Error"));
	read_only_dialog->set_text(vformat(TTR("Imported Animation cannot be edited!")));
	add_child(read_only_dialog);
}

AnimationTrackEditor::~AnimationTrackEditor() {
	if (key_edit) {
		memdelete(key_edit);
	}
	if (multi_key_edit) {
		memdelete(multi_key_edit);
	}
}

// AnimationTrackKeyEditEditorPlugin.

void AnimationTrackKeyEditEditor::_time_edit_spun() {
	_time_edit_entered();
	_time_edit_exited();
}

void AnimationTrackKeyEditEditor::_time_edit_entered() {
	int key = animation->track_find_key(track, key_ofs, Animation::FIND_MODE_APPROX);
	if (key == -1) {
		return;
	}
	key_data_cache.time = animation->track_get_key_time(track, key);

Review comment (suggestion):
```suggestion
	read_only_dialog->set_title(TTRC("Key Insertion Error"));
	read_only_dialog->set_text(vformat(TTRC("Imported Animation cannot be edited!")));
```

Code after:
	optimize_dialog->set_ok_button_text(TTR("Optimize"));
	optimize_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_OPTIMIZE_ANIMATION_CONFIRM));

	//
	cleanup_dialog = memnew(ConfirmationDialog);
	add_child(cleanup_dialog);
	VBoxContainer *cleanup_vb = memnew(VBoxContainer);
	cleanup_dialog->add_child(cleanup_vb);

	cleanup_keys_with_trimming_head = memnew(CheckBox);
	cleanup_keys_with_trimming_head->set_text(TTR("Trim keys placed in negative time"));
	cleanup_keys_with_trimming_head->set_pressed(true);
	cleanup_vb->add_child(cleanup_keys_with_trimming_head);

	cleanup_keys_with_trimming_end = memnew(CheckBox);
	cleanup_keys_with_trimming_end->set_text(TTR("Trim keys placed exceed the animation length"));
	cleanup_keys_with_trimming_end->set_pressed(true);
	cleanup_vb->add_child(cleanup_keys_with_trimming_end);

	cleanup_keys = memnew(CheckBox);
	cleanup_keys->set_text(TTR("Remove invalid keys"));
	cleanup_keys->set_pressed(true);
	cleanup_vb->add_child(cleanup_keys);

	cleanup_tracks = memnew(CheckBox);
	cleanup_tracks->set_text(TTR("Remove unresolved and empty tracks"));
	cleanup_tracks->set_pressed(true);
	cleanup_vb->add_child(cleanup_tracks);

	cleanup_all = memnew(CheckBox);
	cleanup_all->set_text(TTR("Clean-up all animations"));
	cleanup_vb->add_child(cleanup_all);

	cleanup_dialog->set_title(TTR("Clean-Up Animation(s) (NO UNDO!)"));
	cleanup_dialog->set_ok_button_text(TTR("Clean-Up"));

	cleanup_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_CLEAN_UP_ANIMATION_CONFIRM));

	//
	scale_dialog = memnew(ConfirmationDialog);
	VBoxContainer *vbc = memnew(VBoxContainer);
	scale_dialog->add_child(vbc);

	scale = memnew(SpinBox);
	scale->set_min(-99999);
	scale->set_max(99999);
	scale->set_step(0.001);
	scale->set_select_all_on_focus(true);
	scale->set_accessibility_name(TTRC("Scale Ratio"));
	vbc->add_margin_child(TTR("Scale Ratio:"), scale);
	scale_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_SCALE_CONFIRM), CONNECT_DEFERRED);