diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-30 18:23:39 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-30 18:23:39 -0300 |
commit | ffbc2e56c90b632382b9deb280ee62d2f907d722 (patch) | |
tree | d9c62e275f22ae697fe1a72e1e756fbfcbcc2f43 /tools | |
parent | 89bb72b2d3ae209eae64252fcbac7d6f0ff6e376 (diff) |
Fix some bugs in diraccess, closes #5288
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/editor_dir_dialog.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp index 8900cef7b9..f6ce7bf3f8 100644 --- a/tools/editor/editor_dir_dialog.cpp +++ b/tools/editor/editor_dir_dialog.cpp @@ -191,10 +191,14 @@ void EditorDirDialog::ok_pressed() { void EditorDirDialog::_make_dir() { TreeItem *ti=tree->get_selected(); - if (!ti) + if (!ti) { + mkdirerr->set_text("Please select a base directory first"); + mkdirerr->popup_centered_minsize(); return; + } makedialog->popup_centered_minsize(Size2(250,80)); + makedirname->grab_focus(); } void EditorDirDialog::_make_dir_confirm() { @@ -204,9 +208,11 @@ void EditorDirDialog::_make_dir_confirm() { return; String dir = ti->get_metadata(0); + DirAccess *d = DirAccess::open(dir); ERR_FAIL_COND(!d); Error err = d->make_dir(makedirname->get_text()); + if (err!=OK) { mkdirerr->popup_centered_minsize(Size2(250,80)); } else { |