Now has real app version information.
"labelHeight" was not the actual label height, just the font height; as a result, it could overwrite the label (and did so with "Time Running:"). Now uses find_directory() to locate the system lib directory. Does not use version_info::short_info if it's empty. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13567 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
9daa13637a
commit
38d8620261
@ -10,10 +10,12 @@
|
||||
#include <Application.h>
|
||||
#include <Bitmap.h>
|
||||
#include <File.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <Font.h>
|
||||
#include <MessageRunner.h>
|
||||
#include <Messenger.h>
|
||||
#include <OS.h>
|
||||
#include <Path.h>
|
||||
#include <Screen.h>
|
||||
#include <ScrollView.h>
|
||||
#include <String.h>
|
||||
@ -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));
|
||||
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user