diff --git a/src/apps/abouthaiku/AboutHaiku.cpp b/src/apps/abouthaiku/AboutHaiku.cpp index 763775ebc1..46b723e38b 100644 --- a/src/apps/abouthaiku/AboutHaiku.cpp +++ b/src/apps/abouthaiku/AboutHaiku.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Haiku, Inc. + * Copyright (c) 2005-2006, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: DarkWyrm @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -122,7 +123,6 @@ AboutView::AboutView(const BRect &rect) font_height height; float labelHeight, textHeight; - char string[255]; system_info systemInfo; get_system_info(&systemInfo); @@ -158,6 +158,7 @@ AboutView::AboutView(const BRect &rect) r.OffsetBy(0, labelHeight); r.bottom = r.top + textHeight; + char string[256]; strcpy(string, "Unknown"); // the version is stored in the BEOS:APP_VERSION attribute of libbe.so @@ -175,6 +176,16 @@ AboutView::AboutView(const BRect &rect) strcpy(string, versionInfo.short_info); } + // Add revision from resources + BResources* resources = be_app->AppResources(); + const char* versionString = (const char *)resources->LoadResource( + B_STRING_TYPE, "SVN:REVISION", NULL); + if (versionString != NULL) { + strlcat(string, " (r", sizeof(string)); + strlcat(string, versionString, sizeof(string)); + strlcat(string, ")", sizeof(string)); + } + stringView = new BStringView(r, "ostext", string); fInfoView->AddChild(stringView); stringView->ResizeToPreferred(); @@ -285,7 +296,6 @@ AboutView::AboutView(const BRect &rect) fCreditsView, B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS, false, true, B_PLAIN_BORDER); AddChild(creditsScroller); - rgb_color darkgrey = { 100, 100, 100, 255 }; rgb_color haiku_green = { 42, 131, 36, 255 }; rgb_color haiku_orange = { 255, 69, 0, 255 }; @@ -376,6 +386,7 @@ AboutView::AboutView(const BRect &rect) "Jonas Sundström\n" "Daniel Switkin\n" "Atsushi Takamatsu\n" + "Oliver Tappe\n" "Jason Vandermark\n" "Sandor Vroemisse\n" "Nathan Whitehorn\n" diff --git a/src/apps/abouthaiku/Jamfile b/src/apps/abouthaiku/Jamfile index b7c2d7583b..8b9eaf444d 100644 --- a/src/apps/abouthaiku/Jamfile +++ b/src/apps/abouthaiku/Jamfile @@ -12,6 +12,23 @@ Application AboutHaiku : : AboutHaiku.rdef ; +rule AddRevisionToResources { + Depends $(1) ; + AddRevisionToResources1 $(1) : rc ; +} + +actions AddRevisionToResources1 { + VERSION=`svn info | grep Revision | cut -d\ -f2` + echo "resource(201, \"SVN:REVISION\") #'CSTR' \""$VERSION"\";" | $(2) -m -o $(1) - +} + +# This must come after the Application rule, so that the +# AboutHaiku.rsrc file is already created +AddRevisionToResources [ FGristFiles AboutHaiku.rsrc ] ; +ALWAYS [ FGristFiles AboutHaiku.rsrc ] ; + # we want to rebuild the resources everytime AboutHaiku + # is built to keep them up-to-date + Includes [ FGristFiles AboutHaiku.rdef ] : [ FGristFiles haikulogo.png ] ; SEARCH on [ FGristFiles haikulogo.png ] = [ FDirName $(HAIKU_TOP) src apps abouthaiku ] ;