You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-20 14:45:44 +00:00
Display proper message on invalid folder path
This commit is contained in:
@@ -1355,6 +1355,13 @@ EditorFileDialog::Access EditorFileDialog::get_access() const {
|
|||||||
void EditorFileDialog::_make_dir_confirm() {
|
void EditorFileDialog::_make_dir_confirm() {
|
||||||
const String stripped_dirname = makedirname->get_text().strip_edges();
|
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)) {
|
if (dir_access->dir_exists(stripped_dirname)) {
|
||||||
error_dialog->set_text(TTR("Could not create folder. File with that name already exists."));
|
error_dialog->set_text(TTR("Could not create folder. File with that name already exists."));
|
||||||
error_dialog->popup_centered(Size2(250, 50) * EDSCALE);
|
error_dialog->popup_centered(Size2(250, 50) * EDSCALE);
|
||||||
|
|||||||
Reference in New Issue
Block a user