fd19c7366d
BAboutWindow returned false in QuitRequested in order to hide instead of closing. Not only this keeps a BLooper running for a rarely used window, but it also prevents quitting an application in the window was not destroyed first. * Remove aforementioned QuitRequested method, * Add a static GetWindow method that returns the existing about window, if there is one, or creates one if there is not. A boolean can be set to tell the caller what happened, * Adjust all callers to use that new method, instead of managing the window themselves.
58 lines
1.3 KiB
C++
58 lines
1.3 KiB
C++
/*
|
|
* Copyright 2007-2012 Haiku, Inc.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Ryan Leavengood <leavengood@gmail.com>
|
|
* John Scipione <jscipione@gmail.com>
|
|
*/
|
|
#ifndef B_ABOUT_WINDOW_H
|
|
#define B_ABOUT_WINDOW_H
|
|
|
|
|
|
#include <GroupView.h>
|
|
#include <Window.h>
|
|
#include <View.h>
|
|
|
|
|
|
class AboutView;
|
|
class BBitmap;
|
|
class BPoint;
|
|
|
|
class BAboutWindow : public BWindow {
|
|
public:
|
|
BAboutWindow(const char* appName,
|
|
const char* signature);
|
|
virtual ~BAboutWindow();
|
|
|
|
virtual void Show();
|
|
|
|
BPoint AboutPosition(float width, float height);
|
|
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);
|
|
|
|
BBitmap* Icon();
|
|
void SetIcon(BBitmap* icon);
|
|
|
|
const char* Name();
|
|
void SetName(const char* name);
|
|
|
|
const char* Version();
|
|
void SetVersion(const char* version);
|
|
|
|
static BAboutWindow* GetWindow(const char* appName,
|
|
const char* signature, bool* needsInit = NULL);
|
|
private:
|
|
AboutView* fAboutView;
|
|
|
|
static BAboutWindow* sAboutWindow;
|
|
};
|
|
|
|
#endif // B_ABOUT_WINDOW_H
|