From ffbc2e56c90b632382b9deb280ee62d2f907d722 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 30 Jun 2016 18:23:39 -0300 Subject: Fix some bugs in diraccess, closes #5288 --- tools/editor/editor_dir_dialog.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/editor/editor_dir_dialog.cpp') 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 { -- cgit v1.2.3