From 0be5ff50aaf3041f05ea230e603742832b891123 Mon Sep 17 00:00:00 2001 From: "leandrogarber@gmail.com" Date: Wed, 4 Jun 2014 18:15:37 -0300 Subject: [PATCH 1/2] small feature: set project name automatically when choosing path for new projects --- tools/editor/project_manager.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index c45e7441b8b..f6bc2e1b606 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -98,22 +98,20 @@ class NewProjectDialog : public ConfirmationDialog { void _path_text_changed(const String& p_path) { - _test_path(); - if (import_mode) { + if ( _test_path() ) { - String sp=p_path; + String sp=p_path; - sp=sp.replace("\\","/"); - int lidx=sp.find_last("/"); - if (lidx!=-1) { - sp=sp.substr(lidx+1,sp.length()); - } - if (sp=="") - sp="Imported Project"; + sp=sp.replace("\\","/"); + int lidx=sp.find_last("/"); + if (lidx!=-1) { + sp=sp.substr(lidx+1,sp.length()); + } + if (sp=="" && import_mode ) + sp="Imported Project"; - project_name->set_text(sp); + project_name->set_text(sp); } - } void _file_selected(const String& p_path) { @@ -712,7 +710,7 @@ ProjectManager::ProjectManager() { scroll->set_enable_h_scroll(false); VBoxContainer *tree_vb = memnew( VBoxContainer); - tree_hb->add_child(tree_vb); + tree_hb->add_child(tree_vb); scroll_childs = memnew( VBoxContainer ); scroll_childs->set_h_size_flags(SIZE_EXPAND_FILL); scroll->add_child(scroll_childs); From 729cadad13bdd9e49543cda7331e817c72460155 Mon Sep 17 00:00:00 2001 From: "leandrogarber@gmail.com" Date: Wed, 4 Jun 2014 18:30:39 -0300 Subject: [PATCH 2/2] small feature: set project name automatically when choosing path for new projects (recommit due problem with codeblocks tabs) --- tools/editor/project_manager.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index f6bc2e1b606..cd32a008176 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -100,17 +100,18 @@ class NewProjectDialog : public ConfirmationDialog { if ( _test_path() ) { - String sp=p_path; + String sp=p_path; - sp=sp.replace("\\","/"); - int lidx=sp.find_last("/"); - if (lidx!=-1) { - sp=sp.substr(lidx+1,sp.length()); - } - if (sp=="" && import_mode ) - sp="Imported Project"; + sp=sp.replace("\\","/"); + int lidx=sp.find_last("/"); - project_name->set_text(sp); + if (lidx!=-1) { + sp=sp.substr(lidx+1,sp.length()); + } + if (sp=="" && import_mode ) + sp="Imported Project"; + + project_name->set_text(sp); } }