diff options
author | reduz <reduzio@gmail.com> | 2014-06-11 01:12:41 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2014-06-11 01:12:41 -0300 |
commit | 09023224b6eca5993d1b813f1997bddee370a631 (patch) | |
tree | 50494993acf341e083e4850d3f95b56346409929 /tools/editor | |
parent | b0b6f143ffbf7fad0e2f2b2e50adb8474bfabfe3 (diff) | |
parent | 729cadad13bdd9e49543cda7331e817c72460155 (diff) |
Merge pull request #490 from macramole/master
Set project name automatically when choosing path for new projects in project manager
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/project_manager.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index b6250c035e..bd8f1641e2 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -98,22 +98,21 @@ class NewProjectDialog : public ConfirmationDialog { void _path_text_changed(const String& p_path) { - _test_path(); - if (import_mode) { + if ( _test_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=="") + if (sp=="" && import_mode ) sp="Imported Project"; project_name->set_text(sp); } - } void _file_selected(const String& p_path) { @@ -845,7 +844,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); |