summaryrefslogtreecommitdiff
path: root/tools/editor/editor_dir_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/editor_dir_dialog.cpp')
-rw-r--r--tools/editor/editor_dir_dialog.cpp8
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 {