diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/CMakeLists.txt | 5 | ||||
-rw-r--r-- | source/blender/editors/screen/CMakeLists.txt | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/CMakeLists.txt | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 35 |
4 files changed, 40 insertions, 10 deletions
diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt index c695ea02508..8ed840f0be4 100644 --- a/source/blender/editors/CMakeLists.txt +++ b/source/blender/editors/CMakeLists.txt @@ -89,10 +89,9 @@ IF(WIN32) SET(INC ${INC} ${PTHREADS_INC}) ENDIF(WIN32) -# TODO buildinfo -IF(BF_BUILDINFO) +IF(WITH_BUILDINFO) ADD_DEFINITIONS(-DNAN_BUILDINFO) -ENDIF(BF_BUILDINFO) +ENDIF(WITH_BUILDINFO) BLENDERLIB_NOLIST(bf_editors "${SRC}" "${INC}") diff --git a/source/blender/editors/screen/CMakeLists.txt b/source/blender/editors/screen/CMakeLists.txt index ad7770e12fa..75811735d25 100644 --- a/source/blender/editors/screen/CMakeLists.txt +++ b/source/blender/editors/screen/CMakeLists.txt @@ -70,10 +70,9 @@ IF(WIN32) SET(INC ${INC} ${PTHREADS_INC}) ENDIF(WIN32) -# TODO buildinfo -IF(BF_BUILDINFO) +IF(WITH_BUILDINFO) ADD_DEFINITIONS(-DNAN_BUILDINFO) -ENDIF(BF_BUILDINFO) +ENDIF(WITH_BUILDINFO) BLENDERLIB_NOLIST(bf_editors "${SRC}" "${INC}") diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index e93b9906dac..9f57fd5efec 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -81,9 +81,8 @@ IF(WITH_COCOA) LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/wm_apple.c") ENDIF(WITH_COCOA) -# TODO buildinfo -IF(BF_BUILDINFO) +IF(WITH_BUILDINFO) ADD_DEFINITIONS(-DNAN_BUILDINFO) -ENDIF(BF_BUILDINFO) +ENDIF(WITH_BUILDINFO) BLENDERLIB_NOLIST(bf_windowmanager "${SRC}" "${INC}") diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 4bef0faeea8..3bf06e0dc5a 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -42,6 +42,8 @@ #include "MEM_guardedalloc.h" +#include "BLF_api.h" + #include "PIL_time.h" #include "BLI_blenlib.h" @@ -932,7 +934,35 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse uiLayout *layout, *split, *col; uiStyle *style= U.uistyles.first; struct RecentFile *recent; - int i; + int i, ver_width, rev_width; + char *version_str = NULL; + char *revision_str = NULL; + +#ifdef NAN_BUILDINFO + char version_buf[128]; + char revision_buf[128]; + extern char * build_rev; + char *cp; + + version_str = &version_buf[0]; + revision_str = &revision_buf[0]; + + sprintf(version_str, "%d.%02d.%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); + sprintf(revision_str, "r%s", build_rev); + + /* here on my system I get ugly double quotes around the revision number. + * if so, clip it off: */ + cp = strchr(revision_str, '"'); + if (cp) { + memmove(cp, cp+1, strlen(cp+1)); + cp = strchr(revision_str, '"'); + if (cp) + *cp = 0; + } + + ver_width = BLF_width(version_str); + rev_width = BLF_width(revision_str)-7; +#endif NAN_BUILDINFO block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1); @@ -940,6 +970,9 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse but= uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, NULL, 0.0, 0.0, 0, 0, ""); uiButSetFunc(but, wm_block_splash_close, block, NULL); + uiDefBut(block, LABEL, 0, version_str, 500-ver_width, 282-24, ver_width, 20, NULL, 0, 0, 0, 0, NULL); + uiDefBut(block, LABEL, 0, revision_str, 500-rev_width, 282-36, rev_width, 20, NULL, 0, 0, 0, 0, NULL); + uiBlockSetEmboss(block, UI_EMBOSSP); layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 10, 10, 480, 110, style); |