Browse Source

Merge pull request #82328 from KoBeWi/submit_to_the_dialog_overlords

Fix ScriptCreateDialog not accepting on submit
Rémi Verschelde 1 year ago
parent
commit
f593b6c936
2 changed files with 2 additions and 8 deletions
  1. 2 7
      editor/script_create_dialog.cpp
  2. 0 1
      editor/script_create_dialog.h

+ 2 - 7
editor/script_create_dialog.cpp

@@ -526,12 +526,6 @@ void ScriptCreateDialog::_path_changed(const String &p_path) {
 	validation_panel->update();
 	validation_panel->update();
 }
 }
 
 
-void ScriptCreateDialog::_path_submitted(const String &p_path) {
-	if (!get_ok_button()->is_disabled()) {
-		ok_pressed();
-	}
-}
-
 void ScriptCreateDialog::_update_template_menu() {
 void ScriptCreateDialog::_update_template_menu() {
 	bool is_language_using_templates = language->is_using_templates();
 	bool is_language_using_templates = language->is_using_templates();
 	template_menu->set_disabled(false);
 	template_menu->set_disabled(false);
@@ -960,6 +954,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
 	file_path->connect("text_changed", callable_mp(this, &ScriptCreateDialog::_path_changed));
 	file_path->connect("text_changed", callable_mp(this, &ScriptCreateDialog::_path_changed));
 	file_path->set_h_size_flags(Control::SIZE_EXPAND_FILL);
 	file_path->set_h_size_flags(Control::SIZE_EXPAND_FILL);
 	hb->add_child(file_path);
 	hb->add_child(file_path);
+	register_text_enter(file_path);
 	path_button = memnew(Button);
 	path_button = memnew(Button);
 	path_button->connect("pressed", callable_mp(this, &ScriptCreateDialog::_browse_path).bind(false, true));
 	path_button->connect("pressed", callable_mp(this, &ScriptCreateDialog::_browse_path).bind(false, true));
 	hb->add_child(path_button);
 	hb->add_child(path_button);
@@ -973,7 +968,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
 
 
 	built_in_name = memnew(LineEdit);
 	built_in_name = memnew(LineEdit);
 	built_in_name->set_h_size_flags(Control::SIZE_EXPAND_FILL);
 	built_in_name->set_h_size_flags(Control::SIZE_EXPAND_FILL);
-	built_in_name->connect("text_submitted", callable_mp(this, &ScriptCreateDialog::_path_submitted));
+	register_text_enter(built_in_name);
 	label = memnew(Label(TTR("Name:")));
 	label = memnew(Label(TTR("Name:")));
 	gc->add_child(label);
 	gc->add_child(label);
 	gc->add_child(built_in_name);
 	gc->add_child(built_in_name);

+ 0 - 1
editor/script_create_dialog.h

@@ -97,7 +97,6 @@ class ScriptCreateDialog : public ConfirmationDialog {
 	void _path_hbox_sorted();
 	void _path_hbox_sorted();
 	bool _can_be_built_in();
 	bool _can_be_built_in();
 	void _path_changed(const String &p_path = String());
 	void _path_changed(const String &p_path = String());
-	void _path_submitted(const String &p_path = String());
 	void _language_changed(int l = 0);
 	void _language_changed(int l = 0);
 	void _built_in_pressed();
 	void _built_in_pressed();
 	void _use_template_pressed();
 	void _use_template_pressed();