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:
authorCampbell Barton <ideasman42@gmail.com>2011-10-23 08:13:56 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-23 08:13:56 +0400
commit8e2bc6cdbcb47c5f2e4714241fde0ac970f6f58e (patch)
tree6c588cd22b7c40e31d3715eecc96a699d7343334 /source/blender/editors/interface/interface.c
parent29417887d7e78f31cbefc5d86c156237484e837a (diff)
Context menu 'Edit Source' operator no longer needs to be enabled as a build option, improved this so the python file:line lookups are only done when the operator runs (previously this was done for every button, every draw when the build option was enabled).
Perhaps this should be hidden when not running with --debug, easy to change.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r--source/blender/editors/interface/interface.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index b7b572e7217..f9991079507 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2562,23 +2562,10 @@ 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;
- }
+ /* if the 'UI_OT_editsource' is running, extract the source info from the button */
+ if (UI_editsource_enable_check()) {
+ UI_editsource_active_but_test(but);
}
-#endif /* WITH_PYTHON_UI_INFO */
return but;
}