|
@@ -1394,6 +1394,9 @@ void FileSystemDock::_rename_operation_confirm() {
|
|
} else if (new_name.find("/") != -1 || new_name.find("\\") != -1 || new_name.find(":") != -1) {
|
|
} else if (new_name.find("/") != -1 || new_name.find("\\") != -1 || new_name.find(":") != -1) {
|
|
EditorNode::get_singleton()->show_warning(TTR("Name contains invalid characters."));
|
|
EditorNode::get_singleton()->show_warning(TTR("Name contains invalid characters."));
|
|
return;
|
|
return;
|
|
|
|
+ } else if (new_name[0] == '.') {
|
|
|
|
+ EditorNode::get_singleton()->show_warning(TTR("This filename begins with a dot rendering the file invisible to the editor.\nIf you want to rename it anyway, use your operating system's file manager."));
|
|
|
|
+ return;
|
|
} else if (to_rename.is_file && to_rename.path.get_extension() != new_name.get_extension()) {
|
|
} else if (to_rename.is_file && to_rename.path.get_extension() != new_name.get_extension()) {
|
|
if (!EditorFileSystem::get_singleton()->get_valid_extensions().find(new_name.get_extension())) {
|
|
if (!EditorFileSystem::get_singleton()->get_valid_extensions().find(new_name.get_extension())) {
|
|
EditorNode::get_singleton()->show_warning(TTR("This file extension is not recognized by the editor.\nIf you want to rename it anyway, use your operating system's file manager.\nAfter renaming to an unknown extension, the file won't be shown in the editor anymore."));
|
|
EditorNode::get_singleton()->show_warning(TTR("This file extension is not recognized by the editor.\nIf you want to rename it anyway, use your operating system's file manager.\nAfter renaming to an unknown extension, the file won't be shown in the editor anymore."));
|
|
@@ -1456,6 +1459,9 @@ void FileSystemDock::_duplicate_operation_confirm() {
|
|
} else if (new_name.find("/") != -1 || new_name.find("\\") != -1 || new_name.find(":") != -1) {
|
|
} else if (new_name.find("/") != -1 || new_name.find("\\") != -1 || new_name.find(":") != -1) {
|
|
EditorNode::get_singleton()->show_warning(TTR("Name contains invalid characters."));
|
|
EditorNode::get_singleton()->show_warning(TTR("Name contains invalid characters."));
|
|
return;
|
|
return;
|
|
|
|
+ } else if (new_name[0] == '.') {
|
|
|
|
+ EditorNode::get_singleton()->show_warning(TTR("Name begins with a dot."));
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
String base_dir = to_duplicate.path.get_base_dir();
|
|
String base_dir = to_duplicate.path.get_base_dir();
|