summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2024-08-07 13:49:06 +0200
committerGitHub <noreply@github.com>2024-08-07 13:49:06 +0200
commit33fe10c065d194b2a440a883ecdc6a71fd3fbd5f (patch)
treedc2345b7e395b89dc5041db4f26a16060e352ac8
parent1e8bfdcd4f0c4e6750cb057295f19aba39801798 (diff)
parent9a8ba93963024c514fe4b3ba9850457e7ba28ae2 (diff)
downloadredot-engine-33fe10c065d194b2a440a883ecdc6a71fd3fbd5f.tar.gz
Merge pull request #95245 from KoBeWi/regression_flood
Initialize project name when importing project
-rw-r--r--editor/project_manager/project_dialog.cpp8
-rw-r--r--editor/project_manager/project_dialog.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/editor/project_manager/project_dialog.cpp b/editor/project_manager/project_dialog.cpp
index 1ea038ede3..b4aa00ee0a 100644
--- a/editor/project_manager/project_dialog.cpp
+++ b/editor/project_manager/project_dialog.cpp
@@ -429,6 +429,10 @@ void ProjectDialog::_install_path_selected(const String &p_path) {
get_ok_button()->grab_focus();
}
+void ProjectDialog::_reset_name() {
+ project_name->set_text(TTR("New Game Project"));
+}
+
void ProjectDialog::_renderer_selected() {
ERR_FAIL_NULL(renderer_button_group->get_pressed_button());
@@ -694,6 +698,7 @@ void ProjectDialog::set_project_path(const String &p_path) {
}
void ProjectDialog::ask_for_path_and_show() {
+ _reset_name();
_browse_project_path();
}
@@ -718,8 +723,7 @@ void ProjectDialog::show_dialog(bool p_reset_name) {
callable_mp(project_name, &LineEdit::select_all).call_deferred();
} else {
if (p_reset_name) {
- String proj = TTR("New Game Project");
- project_name->set_text(proj);
+ _reset_name();
}
project_path->set_editable(true);
diff --git a/editor/project_manager/project_dialog.h b/editor/project_manager/project_dialog.h
index 0efe1991ab..b985492f84 100644
--- a/editor/project_manager/project_dialog.h
+++ b/editor/project_manager/project_dialog.h
@@ -122,6 +122,7 @@ private:
void _project_path_selected(const String &p_path);
void _install_path_selected(const String &p_path);
+ void _reset_name();
void _renderer_selected();
void _nonempty_confirmation_ok_pressed();