UI: Capitalize default filenames from "untitled" to "Untitled"
Capitalize the default filename used for .blend files and other savable and exportable file formats (like images, 3D formats, etc.) from "untitled" to "Untitled". Pull Request: https://projects.blender.org/blender/blender/pulls/132424
This commit is contained in:
committed by
Harley Acheson
parent
5f24c61225
commit
0ee4ae89e4
@@ -64,7 +64,7 @@ class ExportHelper:
|
||||
if not self.filepath:
|
||||
blend_filepath = context.blend_data.filepath
|
||||
if not blend_filepath:
|
||||
blend_filepath = data_("untitled")
|
||||
blend_filepath = data_("Untitled")
|
||||
else:
|
||||
blend_filepath = os.path.splitext(blend_filepath)[0]
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "BLI_path_utils.hh"
|
||||
#include "BLI_string.h"
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
|
||||
namespace blender::bke {
|
||||
|
||||
static Vector<std::unique_ptr<FileHandlerType>> &file_handlers_vector()
|
||||
@@ -130,7 +132,7 @@ std::string FileHandlerType::get_default_filename(const StringRefNull name)
|
||||
std::all_of(name.begin(), name.end(), [](char c) { return c == ' '; });
|
||||
|
||||
char filename[FILE_MAXFILE];
|
||||
STRNCPY(filename, all_blank ? "untitled" : name.c_str());
|
||||
STRNCPY(filename, all_blank ? DATA_("Untitled") : name.c_str());
|
||||
BLI_path_extension_ensure(filename,
|
||||
sizeof(filename),
|
||||
file_extensions.is_empty() ? "" : file_extensions.first().c_str());
|
||||
|
||||
@@ -173,7 +173,7 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts,
|
||||
STRNCPY(opts->filepath, G.filepath_last_image);
|
||||
}
|
||||
else {
|
||||
BLI_path_join(opts->filepath, sizeof(opts->filepath), "//", DATA_("untitled"));
|
||||
BLI_path_join(opts->filepath, sizeof(opts->filepath), "//", DATA_("Untitled"));
|
||||
BLI_path_abs(opts->filepath, BKE_main_blendfile_path(bmain));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1471,7 +1471,7 @@ void ED_fileselect_ensure_default_filepath(bContext *C, wmOperator *op, const ch
|
||||
const char *blendfile_path = BKE_main_blendfile_path(bmain);
|
||||
|
||||
if (blendfile_path[0] == '\0') {
|
||||
STRNCPY(filepath, DATA_("untitled"));
|
||||
STRNCPY(filepath, DATA_("Untitled"));
|
||||
}
|
||||
else {
|
||||
STRNCPY(filepath, blendfile_path);
|
||||
|
||||
@@ -3558,7 +3558,7 @@ static void wm_filepath_default(const Main *bmain, char *filepath)
|
||||
{
|
||||
if (bmain->filepath[0] == '\0') {
|
||||
char filename_untitled[FILE_MAXFILE];
|
||||
SNPRINTF(filename_untitled, "%s.blend", DATA_("untitled"));
|
||||
SNPRINTF(filename_untitled, "%s.blend", DATA_("Untitled"));
|
||||
BLI_path_filename_ensure(filepath, FILE_MAX, filename_untitled);
|
||||
}
|
||||
}
|
||||
@@ -4402,7 +4402,7 @@ static uiBlock *block_create_save_file_overwrite_dialog(bContext *C, ARegion *re
|
||||
BLI_path_split_file_part(blendfile_path, filename, sizeof(filename));
|
||||
}
|
||||
else {
|
||||
SNPRINTF(filename, "%s.blend", DATA_("untitled"));
|
||||
SNPRINTF(filename, "%s.blend", DATA_("Untitled"));
|
||||
/* Since this dialog should only be shown when re-saving an existing file, current filepath
|
||||
* should never be empty. */
|
||||
BLI_assert_unreachable();
|
||||
@@ -4621,7 +4621,7 @@ static uiBlock *block_create__close_file_dialog(bContext *C, ARegion *region, vo
|
||||
BLI_path_split_file_part(blendfile_path, filename, sizeof(filename));
|
||||
}
|
||||
else {
|
||||
SNPRINTF(filename, "%s.blend", DATA_("untitled"));
|
||||
SNPRINTF(filename, "%s.blend", DATA_("Untitled"));
|
||||
}
|
||||
uiItemL(layout, filename, ICON_NONE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user