Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/file_draw.c14
-rw-r--r--source/blender/editors/space_file/file_ops.c98
-rw-r--r--source/blender/editors/space_file/file_panels.c12
-rw-r--r--source/blender/editors/space_file/filesel.c6
4 files changed, 67 insertions, 63 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 0080317aece..a09f59fb27c 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -181,7 +181,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
but = uiDefButTextO(block, TEX, "FILE_OT_directory", 0, "",
min_x, line1_y, line1_w-chan_offs, btn_h,
params->dir, 0.0, (float)FILE_MAX-1, 0, 0,
- "File path.");
+ _("File path."));
uiButSetCompleteFunc(but, autocomplete_directory, NULL);
uiButSetFlag(but, UI_BUT_NO_UTF8);
@@ -189,7 +189,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
but = uiDefBut(block, TEX, B_FS_FILENAME, "",
min_x, line2_y, line2_w-chan_offs, btn_h,
params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0,
- overwrite_alert ?"File name, overwrite existing." : "File name.");
+ overwrite_alert ?_("File name, overwrite existing.") : _("File name."));
uiButSetCompleteFunc(but, autocomplete_file, NULL);
uiButSetFlag(but, UI_BUT_NO_UTF8);
@@ -209,13 +209,13 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMOUT,
min_x + line2_w + separator - chan_offs, line2_y,
btn_fn_w, btn_h,
- "Decrement the filename number");
+ _("Decrement the filename number"));
RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", -1);
but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN,
min_x + line2_w + separator + btn_fn_w - chan_offs, line2_y,
btn_fn_w, btn_h,
- "Increment the filename number");
+ _("Increment the filename number"));
RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", 1);
uiBlockEndAlign(block);
}
@@ -226,9 +226,9 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, params->title,
max_x - loadbutton, line1_y, loadbutton, btn_h,
params->title);
- uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, "Cancel",
+ uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, _("Cancel"),
max_x - loadbutton, line2_y, loadbutton, btn_h,
- "Cancel");
+ _("Cancel"));
}
uiEndBlock(C, block);
@@ -295,7 +295,7 @@ static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon,
static void file_draw_string(int sx, int sy, const char* string, float width, int height, short align)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiFontStyle fs = style->widgetlabel;
rcti rect;
char fname[FILE_MAXFILE];
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 1b0893e50e0..f8a5e4ca1ac 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -44,6 +44,8 @@
#include "BLI_winstuff.h"
#endif
+#include "BLF_api.h"
+
#include "ED_screen.h"
#include "ED_fileselect.h"
@@ -294,8 +296,8 @@ static int file_border_select_exec(bContext *C, wmOperator *op)
void FILE_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Activate/Select File";
- ot->description= "Activate/select the file(s) contained in the border";
+ ot->name= _("Activate/Select File");
+ ot->description= _("Activate/select the file(s) contained in the border");
ot->idname= "FILE_OT_select_border";
/* api callbacks */
@@ -345,8 +347,8 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
void FILE_OT_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Activate/Select File";
- ot->description= "Activate/select file";
+ ot->name= _("Activate/Select File");
+ ot->description= _("Activate/select file");
ot->idname= "FILE_OT_select";
/* api callbacks */
@@ -354,8 +356,8 @@ void FILE_OT_select(wmOperatorType *ot)
ot->poll= ED_operator_file_active;
/* rna */
- RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first.");
- RNA_def_boolean(ot->srna, "fill", 0, "Fill", "Select everything beginning with the last selection.");
+ RNA_def_boolean(ot->srna, "extend", 0, _("Extend"), _("Extend selection instead of deselecting everything first."));
+ RNA_def_boolean(ot->srna, "fill", 0, _("Fill"), _("Select everything beginning with the last selection."));
}
static int file_select_all_exec(bContext *C, wmOperator *UNUSED(op))
@@ -392,8 +394,8 @@ static int file_select_all_exec(bContext *C, wmOperator *UNUSED(op))
void FILE_OT_select_all_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select/Deselect All Files";
- ot->description= "Select/deselect all files";
+ ot->name= _("Select/Deselect All Files");
+ ot->description= _("Select/deselect all files");
ot->idname= "FILE_OT_select_all_toggle";
/* api callbacks */
@@ -429,8 +431,8 @@ static int bookmark_select_exec(bContext *C, wmOperator *op)
void FILE_OT_select_bookmark(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Directory";
- ot->description= "Select a bookmarked directory";
+ ot->name= _("Select Directory");
+ ot->description= _("Select a bookmarked directory");
ot->idname= "FILE_OT_select_bookmark";
/* api callbacks */
@@ -462,8 +464,8 @@ static int bookmark_add_exec(bContext *C, wmOperator *UNUSED(op))
void FILE_OT_bookmark_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Bookmark";
- ot->description= "Add a bookmark for the selected/active directory";
+ ot->name= _("Add Bookmark");
+ ot->description= _("Add a bookmark for the selected/active directory");
ot->idname= "FILE_OT_bookmark_add";
/* api callbacks */
@@ -495,15 +497,15 @@ static int bookmark_delete_exec(bContext *C, wmOperator *op)
void FILE_OT_delete_bookmark(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Bookmark";
- ot->description= "Delete selected bookmark";
+ ot->name= _("Delete Bookmark");
+ ot->description= _("Delete selected bookmark");
ot->idname= "FILE_OT_delete_bookmark";
/* api callbacks */
ot->exec= bookmark_delete_exec;
ot->poll= ED_operator_file_active;
- RNA_def_int(ot->srna, "index", -1, -1, 20000, "Index", "", -1, 20000);
+ RNA_def_int(ot->srna, "index", -1, -1, 20000, _("Index"), "", -1, 20000);
}
int file_hilight_set(SpaceFile *sfile, ARegion *ar, int mx, int my)
@@ -557,8 +559,8 @@ static int file_highlight_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *e
void FILE_OT_highlight(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Highlight File";
- ot->description= "Highlight selected file(s)";
+ ot->name= _("Highlight File");
+ ot->description= _("Highlight selected file(s)");
ot->idname= "FILE_OT_highlight";
/* api callbacks */
@@ -591,8 +593,8 @@ static int file_operator_poll(bContext *C)
void FILE_OT_cancel(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Cancel File Load";
- ot->description= "Cancel loading of selected file";
+ ot->name= _("Cancel File Load");
+ ot->description= _("Cancel loading of selected file");
ot->idname= "FILE_OT_cancel";
/* api callbacks */
@@ -759,15 +761,15 @@ int file_exec(bContext *C, wmOperator *exec_op)
void FILE_OT_execute(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Execute File Window";
- ot->description= "Execute selected file";
+ ot->name= _("Execute File Window");
+ ot->description= _("Execute selected file");
ot->idname= "FILE_OT_execute";
/* api callbacks */
ot->exec= file_exec;
ot->poll= file_operator_poll;
- RNA_def_boolean(ot->srna, "need_active", 0, "Need Active", "Only execute if there's an active selected file in the file list.");
+ RNA_def_boolean(ot->srna, "need_active", 0, _("Need Active"), _("Only execute if there's an active selected file in the file list."));
}
@@ -792,8 +794,8 @@ int file_parent_exec(bContext *C, wmOperator *UNUSED(unused))
void FILE_OT_parent(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Parent File";
- ot->description= "Move to parent directory";
+ ot->name= _("Parent File");
+ ot->description= _("Move to parent directory");
ot->idname= "FILE_OT_parent";
/* api callbacks */
@@ -817,8 +819,8 @@ static int file_refresh_exec(bContext *C, wmOperator *UNUSED(unused))
void FILE_OT_previous(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Previous Folder";
- ot->description= "Move to previous folder";
+ ot->name= _("Previous Folder");
+ ot->description= _("Move to previous folder");
ot->idname= "FILE_OT_previous";
/* api callbacks */
@@ -848,8 +850,8 @@ int file_previous_exec(bContext *C, wmOperator *UNUSED(unused))
void FILE_OT_next(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Next Folder";
- ot->description= "Move to next folder";
+ ot->name= _("Next Folder");
+ ot->description= _("Move to next folder");
ot->idname= "FILE_OT_next";
/* api callbacks */
@@ -975,9 +977,9 @@ void FILE_OT_smoothscroll(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Smooth Scroll";
+ ot->name= _("Smooth Scroll");
ot->idname= "FILE_OT_smoothscroll";
- ot->description="Smooth scroll to make editable file visible.";
+ ot->description=_("Smooth scroll to make editable file visible.");
/* api callbacks */
ot->invoke= file_smoothscroll_invoke;
@@ -1062,8 +1064,8 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
void FILE_OT_directory_new(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Create New Directory";
- ot->description= "Create a new directory";
+ ot->name= _("Create New Directory");
+ ot->description= _("Create a new directory");
ot->idname= "FILE_OT_directory_new";
/* api callbacks */
@@ -1071,7 +1073,7 @@ void FILE_OT_directory_new(struct wmOperatorType *ot)
ot->exec= file_directory_new_exec;
ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
- RNA_def_string_dir_path(ot->srna, "directory", "", FILE_MAX, "Directory", "Name of new directory");
+ RNA_def_string_dir_path(ot->srna, "directory", "", FILE_MAX, _("Directory"), _("Name of new directory"));
}
@@ -1177,8 +1179,8 @@ static int file_directory_poll(bContext *C)
void FILE_OT_directory(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Enter Directory Name";
- ot->description= "Enter a directory name";
+ ot->name= _("Enter Directory Name");
+ ot->description= _("Enter a directory name");
ot->idname= "FILE_OT_directory";
/* api callbacks */
@@ -1190,8 +1192,8 @@ void FILE_OT_directory(struct wmOperatorType *ot)
void FILE_OT_refresh(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Refresh Filelist";
- ot->description= "Refresh the file list";
+ ot->name= _("Refresh Filelist");
+ ot->description= _("Refresh the file list");
ot->idname= "FILE_OT_refresh";
/* api callbacks */
@@ -1216,8 +1218,8 @@ static int file_hidedot_exec(bContext *C, wmOperator *UNUSED(unused))
void FILE_OT_hidedot(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Hide Dot Files";
- ot->description= "Toggle hide hidden dot files";
+ ot->name= _("Toggle Hide Dot Files");
+ ot->description= _("Toggle hide hidden dot files");
ot->idname= "FILE_OT_hidedot";
/* api callbacks */
@@ -1266,8 +1268,8 @@ static int file_bookmark_toggle_exec(bContext *C, wmOperator *UNUSED(unused))
void FILE_OT_bookmark_toggle(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Bookmarks";
- ot->description= "Toggle bookmarks display";
+ ot->name= _("Toggle Bookmarks");
+ ot->description= _("Toggle bookmarks display");
ot->idname= "FILE_OT_bookmark_toggle";
/* api callbacks */
@@ -1296,8 +1298,8 @@ static int file_filenum_exec(bContext *C, wmOperator *op)
void FILE_OT_filenum(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Increment Number in Filename";
- ot->description= "Increment number in filename";
+ ot->name= _("Increment Number in Filename");
+ ot->description= _("Increment number in filename");
ot->idname= "FILE_OT_filenum";
/* api callbacks */
@@ -1305,7 +1307,7 @@ void FILE_OT_filenum(struct wmOperatorType *ot)
ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
/* props */
- RNA_def_int(ot->srna, "increment", 1, -100, 100, "Increment", "", -100,100);
+ RNA_def_int(ot->srna, "increment", 1, -100, 100, _("Increment"), "", -100,100);
}
static int file_rename_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1350,8 +1352,8 @@ static int file_rename_poll(bContext *C)
void FILE_OT_rename(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Rename File or Directory";
- ot->description= "Rename file or file directory";
+ ot->name= _("Rename File or Directory");
+ ot->description= _("Rename file or file directory");
ot->idname= "FILE_OT_rename";
/* api callbacks */
@@ -1402,8 +1404,8 @@ int file_delete_exec(bContext *C, wmOperator *UNUSED(op))
void FILE_OT_delete(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete File";
- ot->description= "Delete selected file";
+ ot->name= _("Delete File");
+ ot->description= _("Delete selected file");
ot->idname= "FILE_OT_delete";
/* api callbacks */
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 959b1ddf1b5..f3c38836058 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -37,6 +37,8 @@
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
+#include "BLF_api.h"
+
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
@@ -144,7 +146,7 @@ static void file_panel_bookmarks(const bContext *C, Panel *pa)
if(sfile) {
row= uiLayoutRow(pa->layout, 0);
- uiItemO(row, "Add", ICON_ZOOMIN, "file.bookmark_add");
+ uiItemO(row, _("Add"), ICON_ZOOMIN, "file.bookmark_add");
uiItemL(row, NULL, ICON_NONE);
file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, &sfile->bookmarknr, ICON_BOOKMARKS, 1, 0);
@@ -205,25 +207,25 @@ void file_panels_register(ARegionType *art)
pt= MEM_callocN(sizeof(PanelType), "spacetype file system directories");
strcpy(pt->idname, "FILE_PT_system");
- strcpy(pt->label, "System");
+ strcpy(pt->label, _("System"));
pt->draw= file_panel_system;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype file bookmarks");
strcpy(pt->idname, "FILE_PT_bookmarks");
- strcpy(pt->label, "Bookmarks");
+ strcpy(pt->label, _("Bookmarks"));
pt->draw= file_panel_bookmarks;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype file recent directories");
strcpy(pt->idname, "FILE_PT_recent");
- strcpy(pt->label, "Recent");
+ strcpy(pt->label, _("Recent"));
pt->draw= file_panel_recent;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype file operator properties");
strcpy(pt->idname, "FILE_PT_operator");
- strcpy(pt->label, "Operator");
+ strcpy(pt->label, _("Operator"));
pt->poll= file_panel_operator_poll;
pt->draw_header= file_panel_operator_header;
pt->draw= file_panel_operator;
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 6773dfb6b2d..e3cf795140e 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -403,7 +403,7 @@ float file_shorten_string(char* string, float w, int front)
float file_string_width(const char* str)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiStyleFontSet(&style->widget);
return BLF_width(style->widget.uifont_id, str);
}
@@ -413,12 +413,12 @@ float file_font_pointsize(void)
#if 0
float s;
char tmp[2] = "X";
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiStyleFontSet(&style->widget);
s = BLF_height(style->widget.uifont_id, tmp);
return style->widget.points;
#else
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiStyleFontSet(&style->widget);
return style->widget.points * UI_DPI_FAC;
#endif