diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-10-21 16:39:10 -0500 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-10-21 16:39:10 -0500 |
commit | 975f42227f3870db153ead3f90da95e4c32a6593 (patch) | |
tree | 0f72cfe6e32a584ff9d46e6b1bccf815fe578d36 /editor/gui | |
parent | 4630cbc487f5a94ca12f348362c14c7ab444264f (diff) | |
parent | 25687c5b997582dac2622b74f6a4cc70a812cf83 (diff) | |
download | redot-engine-975f42227f3870db153ead3f90da95e4c32a6593.tar.gz |
Merge pull request #97706 from lalitshankarchowdhury/fix-create-folder
Display proper message on invalid folder path
Diffstat (limited to 'editor/gui')
-rw-r--r-- | editor/gui/editor_file_dialog.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp index 91b7810f77..7600748685 100644 --- a/editor/gui/editor_file_dialog.cpp +++ b/editor/gui/editor_file_dialog.cpp @@ -1355,6 +1355,13 @@ EditorFileDialog::Access EditorFileDialog::get_access() const { void EditorFileDialog::_make_dir_confirm() { const String stripped_dirname = makedirname->get_text().strip_edges(); + if (stripped_dirname.is_empty()) { + error_dialog->set_text(TTR("The path specified is invalid.")); + error_dialog->popup_centered(Size2(250, 50) * EDSCALE); + makedirname->set_text(""); // Reset label. + return; + } + if (dir_access->dir_exists(stripped_dirname)) { error_dialog->set_text(TTR("Could not create folder. File with that name already exists.")); error_dialog->popup_centered(Size2(250, 50) * EDSCALE); |