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/interface/interface.c')
-rw-r--r--source/blender/editors/interface/interface.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index b6c72c2e96f..16edd0a1a9e 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1747,7 +1747,9 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str)
}
else if(but->type == TEX) {
/* string */
- BLI_strncpy(but->poin, str, but->hardmax);
+ if(ui_is_but_utf8(but)) BLI_strncpy_utf8(but->poin, str, but->hardmax);
+ else BLI_strncpy(but->poin, str, but->hardmax);
+
return 1;
}
else if(but->type == SEARCH_MENU) {
@@ -2559,6 +2561,24 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
if(block->curlayout)
ui_layout_add_but(block->curlayout, but);
+#ifdef WITH_PYTHON_UI_INFO
+ {
+ extern void PyC_FileAndNum_Safe(const char **filename, int *lineno);
+
+ const char *fn;
+ int lineno= -1;
+ PyC_FileAndNum_Safe(&fn, &lineno);
+ if (lineno != -1) {
+ BLI_strncpy(but->py_dbg_fn, fn, sizeof(but->py_dbg_fn));
+ but->py_dbg_ln= lineno;
+ }
+ else {
+ but->py_dbg_fn[0]= '\0';
+ but->py_dbg_ln= -1;
+ }
+ }
+#endif /* WITH_PYTHON_UI_INFO */
+
return but;
}