diff --git a/src/apps/abouthaiku/AboutHaiku.cpp b/src/apps/abouthaiku/AboutHaiku.cpp index b9ba60fc48..25c7891532 100644 --- a/src/apps/abouthaiku/AboutHaiku.cpp +++ b/src/apps/abouthaiku/AboutHaiku.cpp @@ -10,10 +10,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -150,20 +152,27 @@ AboutView::AboutView(const BRect &r) fInfoView->AddChild(stringView); stringView->ResizeToPreferred(); + // we update "labelHeight" to the actual height of the string view + labelHeight = stringView->Bounds().Height(); + r.OffsetBy(0, labelHeight); r.bottom = r.top + textHeight; + strcpy(string, "Unknown"); + // the version is stored in the BEOS:APP_VERSION attribute of libbe.so - BFile file("/boot/beos/system/lib/libbe.so", B_READ_ONLY); - if (file.InitCheck() == B_OK) { + BPath path; + if (find_directory(B_BEOS_LIB_DIRECTORY, &path) == B_OK) { + path.Append("libbe.so"); + BAppFileInfo appFileInfo; version_info versionInfo; - - if (appFileInfo.SetTo(&file) == B_OK - && appFileInfo.GetVersionInfo(&versionInfo, B_APP_VERSION_KIND) == B_OK) + BFile file; + if (file.SetTo(path.Path(), B_READ_ONLY) == B_OK + && appFileInfo.SetTo(&file) == B_OK + && appFileInfo.GetVersionInfo(&versionInfo, B_APP_VERSION_KIND) == B_OK + && versionInfo.short_info[0] != '\0') strcpy(string, versionInfo.short_info); - else - strcpy(string, "Unknown"); } stringView = new BStringView(r, "ostext", string); @@ -251,10 +260,11 @@ AboutView::AboutView(const BRect &r) r.OffsetBy(0, labelHeight); r.bottom = r.top + textHeight; - + fUptimeView = new BStringView(r, "uptimetext", ""); fInfoView->AddChild(fUptimeView); - + // string width changes, so we don't do ResizeToPreferred() + char uptimeString[255]; fUptimeView->SetText(UptimeToString(uptimeString, 255)); diff --git a/src/apps/abouthaiku/AboutHaiku.rdef b/src/apps/abouthaiku/AboutHaiku.rdef index f90183fe0f..b0235044e6 100644 --- a/src/apps/abouthaiku/AboutHaiku.rdef +++ b/src/apps/abouthaiku/AboutHaiku.rdef @@ -104,29 +104,17 @@ resource(101, "BEOS:M:STD_ICON") #'MICN' array { resource(1, "BEOS:APP_SIG") #'MIMS' "application/x-vnd.haiku-AboutHaiku"; -resource(1, "BEOS:APP_VERSION") #'APPV' array { - $"0100000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000000000000000000000000000000000000000000000000000" - $"0000000000000000" +resource app_version { + major = 1, + middle = 0, + minor = 0, + + variety = B_APPV_ALPHA, + + internal = 3, + + short_info = "AboutHaiku 1.0.0", + long_info = "AboutHaiku ©2005 Haiku, Inc." }; resource(1, "BEOS:APP_FLAGS") #'APPF' $"02000000";