Modify about window to take an app signature.

* Grabs the app icon and version from the resource file.
* Allow you to specify the copyright holder instead of hardcoding
  "Haiku, Inc."
* Support multiple extra copyright fields.
* Modify BAlert to take a custom icon.
* Set the custom icon of the BAlert to the app icon.
* Also set the app version.

* Convert BAboutWindow to derive from BWindow
* Place a 128x128 icon and fill out a scrolling BTextView
  with options such as authors, version history, copyright,
  license, etc. Still needs some work but is coming along.

* Add the word Version to the version line, i8n'ed of course,
  and tweak the info box and default sizes.
This commit is contained in:
John Scipione
2012-11-12 23:57:24 -05:00
parent 1a5df674c1
commit 0046f44436
8 changed files with 439 additions and 72 deletions
+31 -14
View File
@@ -1,28 +1,45 @@
/*
* Copyright 2007-2009 Haiku, Inc.
* Copyright 2007-2012 Haiku, Inc.
* Distributed under the terms of the MIT License.
*
* Authors:
* Ryan Leavengood, [email protected]
*/
#ifndef B_ABOUT_WINDOW_H
#define B_ABOUT_WINDOW_H
#include <String.h>
#include <GroupView.h>
#include <Window.h>
#include <View.h>
class BAboutWindow {
public:
BAboutWindow(const char *appName, int32 firstCopyrightYear,
const char **authors, const char *extraInfo = NULL);
virtual ~BAboutWindow();
class AboutView;
class BPoint;
void Show();
class BAboutWindow : public BWindow {
public:
BAboutWindow(const char* appName,
int32 firstCopyrightYear,
const char** authors = NULL,
const char* extraInfo = NULL);
BAboutWindow(const char* appName,
const char* signature);
virtual ~BAboutWindow();
private:
BString* fAppName;
BString* fText;
void AddDescription(const char* description);
void AddCopyright(int32 firstCopyrightYear,
const char* copyrightHolder,
const char** extraCopyrights = NULL);
void AddAuthors(const char** authors);
void AddSpecialThanks(const char** thanks);
void AddVersionHistory(const char** history);
void AddExtraInfo(const char* extraInfo);
BPoint AboutPosition(float width, float height);
protected:
void _Init(const char* appName, const char* signature);
private:
AboutView* fAboutView;
};
#endif // B_ABOUT_WINDOW_H