Added the svn revision number to the splash screen (when buildinfo is
authorMatt Ebb <matt@mke3.net>
Fri, 8 Jan 2010 05:51:51 +0000 (05:51 +0000)
committerMatt Ebb <matt@mke3.net>
Fri, 8 Jan 2010 05:51:51 +0000 (05:51 +0000)
enabled). Also fixed cmake so buildinfo works.

Note to all:
** Please mention the revision number when making a bug report **

source/blender/editors/CMakeLists.txt
source/blender/editors/screen/CMakeLists.txt
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/intern/wm_operators.c

index c695ea0250877622d799b38d5fc3658521447415..8ed840f0be4832b1e12c5a30b8563c3e400c7abf 100644 (file)
@@ -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}")
 
index ad7770e12fa2390166d0f5ec7dfe2f446791b7d1..75811735d250cdcc855c70a21a520e0f6c3731e1 100644 (file)
@@ -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}")
 
index e93b9906dacb9efbe0bf7aba893418f110db29f0..9f57fd5efec4f51f238831bc7b11a5c70ffc2941 100644 (file)
@@ -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}")
index 4bef0faeea8c5b0cbdb2f7a5f7b75cc650ba41a5..3bf06e0dc5ac91401e01812b290a1b20369048ac 100644 (file)
@@ -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);