Fix BAboutWindow lifecycle

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.
This commit is contained in:
Adrien Destugues
2013-04-30 21:50:24 +02:00
parent 3a12979db2
commit fd19c7366d
16 changed files with 135 additions and 155 deletions
+4 -3
View File
@@ -18,7 +18,6 @@
class AboutView; class AboutView;
class BBitmap; class BBitmap;
class BPoint; class BPoint;
class BHandler;
class BAboutWindow : public BWindow { class BAboutWindow : public BWindow {
public: public:
@@ -26,7 +25,6 @@ class BAboutWindow : public BWindow {
const char* signature); const char* signature);
virtual ~BAboutWindow(); virtual ~BAboutWindow();
virtual bool QuitRequested();
virtual void Show(); virtual void Show();
BPoint AboutPosition(float width, float height); BPoint AboutPosition(float width, float height);
@@ -48,9 +46,12 @@ class BAboutWindow : public BWindow {
const char* Version(); const char* Version();
void SetVersion(const char* version); void SetVersion(const char* version);
static BAboutWindow* GetWindow(const char* appName,
const char* signature, bool* needsInit = NULL);
private: private:
AboutView* fAboutView; AboutView* fAboutView;
BHandler* fCaller;
static BAboutWindow* sAboutWindow;
}; };
#endif // B_ABOUT_WINDOW_H #endif // B_ABOUT_WINDOW_H
+13 -15
View File
@@ -600,10 +600,6 @@ ActivityView::~ActivityView()
{ {
delete fOffscreen; delete fOffscreen;
delete fSystemInfoHandler; delete fSystemInfoHandler;
// replicant deleted, destroy the about window
if (fAboutWindow != NULL && fAboutWindow->Lock())
fAboutWindow->Quit();
} }
@@ -647,8 +643,6 @@ ActivityView::_Init(const BMessage* settings)
const char* name; const char* name;
for (int32 i = 0; settings->FindString("source", i, &name) == B_OK; i++) for (int32 i = 0; settings->FindString("source", i, &name) == B_OK; i++)
AddDataSource(DataSource::FindSource(name), settings); AddDataSource(DataSource::FindSource(name), settings);
fAboutWindow = NULL;
} }
@@ -1112,22 +1106,26 @@ ActivityView::MessageReceived(BMessage* message)
switch (message->what) { switch (message->what) {
case B_ABOUT_REQUESTED: case B_ABOUT_REQUESTED:
if (fAboutWindow == NULL) { {
bool needsInit;
BAboutWindow* window = BAboutWindow::GetWindow(kAppName, kSignature,
&needsInit);
if (needsInit) {
const char* authors[] = { const char* authors[] = {
"Axel Dörfler", "Axel Dörfler",
NULL NULL
}; };
fAboutWindow = new BAboutWindow(kAppName, kSignature); window->AddCopyright(2008, "Haiku, Inc.");
fAboutWindow->AddCopyright(2008, "Haiku, Inc."); window->AddAuthors(authors);
fAboutWindow->AddAuthors(authors); }
fAboutWindow->Show();
} else if (fAboutWindow->IsHidden()) if (window->IsHidden())
fAboutWindow->Show(); window->Show();
else window->Activate();
fAboutWindow->Activate();
break; break;
}
case kMsgUpdateResolution: case kMsgUpdateResolution:
{ {
-3
View File
@@ -17,7 +17,6 @@
#include "DataSource.h" #include "DataSource.h"
class BAboutWindow;
class BBitmap; class BBitmap;
class BMessageRunner; class BMessageRunner;
class Scale; class Scale;
@@ -146,8 +145,6 @@ private:
int32 fOriginalResolution; int32 fOriginalResolution;
SystemInfoHandler* fSystemInfoHandler; SystemInfoHandler* fSystemInfoHandler;
std::map<scale_type, ::Scale*> fScales; std::map<scale_type, ::Scale*> fScales;
BAboutWindow* fAboutWindow;
}; };
#endif // ACTIVITY_VIEW_H #endif // ACTIVITY_VIEW_H
+14 -16
View File
@@ -183,10 +183,6 @@ CalcView::~CalcView()
delete fKeypad; delete fKeypad;
delete fOptions; delete fOptions;
free(fKeypadDescription); free(fKeypadDescription);
// replicant deleted, destroy the about window
if (fAboutWindow != NULL && fAboutWindow->Lock())
fAboutWindow->Quit();
} }
@@ -270,7 +266,12 @@ CalcView::MessageReceived(BMessage* message)
// (replicant) about box requested // (replicant) about box requested
case B_ABOUT_REQUESTED: case B_ABOUT_REQUESTED:
if (fAboutWindow == NULL) { {
bool needsInit;
BAboutWindow* window = BAboutWindow::GetWindow(kAppName,
kSignature, &needsInit);
if (needsInit) {
// create the about window // create the about window
const char* extraCopyrights[] = { const char* extraCopyrights[] = {
"1997, 1998 R3 Software Ltd.", "1997, 1998 R3 Software Ltd.",
@@ -285,17 +286,16 @@ CalcView::MessageReceived(BMessage* message)
NULL NULL
}; };
fAboutWindow = new BAboutWindow(kAppName, kSignature); window->AddCopyright(2006, "Haiku, Inc.", extraCopyrights);
fAboutWindow->AddCopyright(2006, "Haiku, Inc.", window->AddAuthors(authors);
extraCopyrights); }
fAboutWindow->AddAuthors(authors);
fAboutWindow->Show(); if (window->IsHidden())
} else if (fAboutWindow->IsHidden()) window->Show();
fAboutWindow->Show(); window->Activate();
else
fAboutWindow->Activate();
break; break;
}
case MSG_UNFLASH_KEY: case MSG_UNFLASH_KEY:
{ {
@@ -1006,8 +1006,6 @@ CalcView::_Init(BMessage* settings)
// fetch the calc icon for compact view // fetch the calc icon for compact view
_FetchAppIcon(fCalcIcon); _FetchAppIcon(fCalcIcon);
fAboutWindow = NULL;
} }
-4
View File
@@ -31,7 +31,6 @@ static const float kMaximumWidthBasic = 400.0f;
static const float kMinimumHeightBasic = 130.0f; static const float kMinimumHeightBasic = 130.0f;
static const float kMaximumHeightBasic = 400.0f; static const float kMaximumHeightBasic = 400.0f;
class BAboutWindow;
class BString; class BString;
class BMenuItem; class BMenuItem;
class BMessage; class BMessage;
@@ -161,9 +160,6 @@ class CalcView : public BView {
// calculator options. // calculator options.
CalcOptions* fOptions; CalcOptions* fOptions;
// about window for replicant
BAboutWindow* fAboutWindow;
}; };
#endif // _CALC_VIEW_H #endif // _CALC_VIEW_H
+12 -14
View File
@@ -139,16 +139,12 @@ NetworkStatusView::NetworkStatusView(BMessage* archive)
NetworkStatusView::~NetworkStatusView() NetworkStatusView::~NetworkStatusView()
{ {
if (fAboutWindow != NULL && fAboutWindow->Lock())
fAboutWindow->Quit();
} }
void void
NetworkStatusView::_Init() NetworkStatusView::_Init()
{ {
fAboutWindow = NULL;
for (int i = 0; i < kStatusCount; i++) { for (int i = 0; i < kStatusCount; i++) {
fTrayIcons[i] = NULL; fTrayIcons[i] = NULL;
fNotifyIcons[i] = NULL; fNotifyIcons[i] = NULL;
@@ -508,22 +504,24 @@ NetworkStatusView::MouseDown(BPoint point)
void void
NetworkStatusView::_AboutRequested() NetworkStatusView::_AboutRequested()
{ {
if (fAboutWindow == NULL) { bool needsInit;
BAboutWindow* window = BAboutWindow::GetWindow(
B_TRANSLATE_SYSTEM_NAME("NetworkStatus"), kSignature, &needsInit);
if (needsInit) {
const char* authors[] = { const char* authors[] = {
"Axel Dörfler", "Axel Dörfler",
"Hugo Santos", "Hugo Santos",
NULL NULL
}; };
fAboutWindow = new BAboutWindow( window->AddCopyright(2007, "Haiku, Inc.");
B_TRANSLATE_SYSTEM_NAME("NetworkStatus"), kSignature); window->AddAuthors(authors);
fAboutWindow->AddCopyright(2007, "Haiku, Inc."); }
fAboutWindow->AddAuthors(authors);
fAboutWindow->Show(); if (window->IsHidden())
} else if (fAboutWindow->IsHidden()) window->Show();
fAboutWindow->Show(); window->Activate();
else
fAboutWindow->Activate();
} }
@@ -17,7 +17,6 @@
#include <map> #include <map>
class BAboutWindow;
class BMessageRunner; class BMessageRunner;
class BNetworkInterface; class BNetworkInterface;
@@ -66,7 +65,6 @@ class NetworkStatusView : public BView {
std::map<BString, int32> std::map<BString, int32>
fInterfaceStatuses; fInterfaceStatuses;
BAboutWindow* fAboutWindow;
bool fInDeskbar; bool fInDeskbar;
BBitmap* fTrayIcons[kStatusCount]; BBitmap* fTrayIcons[kStatusCount];
BBitmap* fNotifyIcons[kStatusCount]; BBitmap* fNotifyIcons[kStatusCount];
+12 -17
View File
@@ -77,8 +77,6 @@ PowerStatusView::PowerStatusView(BMessage* archive)
PowerStatusView::~PowerStatusView() PowerStatusView::~PowerStatusView()
{ {
if (fAboutWindow != NULL && fAboutWindow->Lock())
fAboutWindow->Quit();
} }
@@ -98,8 +96,6 @@ PowerStatusView::_Init()
{ {
SetViewColor(B_TRANSPARENT_COLOR); SetViewColor(B_TRANSPARENT_COLOR);
fAboutWindow = NULL;
fShowLabel = true; fShowLabel = true;
fShowTime = false; fShowTime = false;
fShowStatusIcon = true; fShowStatusIcon = true;
@@ -514,9 +510,6 @@ PowerStatusReplicant::~PowerStatusReplicant()
fDriverInterface->Disconnect(); fDriverInterface->Disconnect();
fDriverInterface->ReleaseReference(); fDriverInterface->ReleaseReference();
if (fAboutWindow != NULL)
fAboutWindow->Quit();
_SaveSettings(); _SaveSettings();
} }
@@ -627,7 +620,11 @@ PowerStatusReplicant::MouseDown(BPoint point)
void void
PowerStatusReplicant::_AboutRequested() PowerStatusReplicant::_AboutRequested()
{ {
if (fAboutWindow == NULL) { bool needsInit;
BAboutWindow* window = BAboutWindow::GetWindow(
B_TRANSLATE_SYSTEM_NAME("PowerStatus"), kSignature, &needsInit);
if (needsInit) {
const char* authors[] = { const char* authors[] = {
"Axel Dörfler", "Axel Dörfler",
"Alexander von Gluck", "Alexander von Gluck",
@@ -635,15 +632,13 @@ PowerStatusReplicant::_AboutRequested()
NULL NULL
}; };
fAboutWindow = new BAboutWindow( window->AddCopyright(2006, "Haiku, Inc.");
B_TRANSLATE_SYSTEM_NAME("PowerStatus"), kSignature); window->AddAuthors(authors);
fAboutWindow->AddCopyright(2006, "Haiku, Inc."); }
fAboutWindow->AddAuthors(authors);
fAboutWindow->Show(); if (window->IsHidden())
} else if (fAboutWindow->IsHidden()) window->Show();
fAboutWindow->Show(); window->Activate();
else
fAboutWindow->Activate();
} }
-2
View File
@@ -15,7 +15,6 @@
#include "DriverInterface.h" #include "DriverInterface.h"
class BAboutWindow;
class BFile; class BFile;
@@ -54,7 +53,6 @@ private:
protected: protected:
PowerStatusDriverInterface* fDriverInterface; PowerStatusDriverInterface* fDriverInterface;
BAboutWindow* fAboutWindow;
bool fShowLabel; bool fShowLabel;
bool fShowTime; bool fShowTime;
@@ -204,10 +204,6 @@ ProcessController::~ProcessController()
delete fMessageRunner; delete fMessageRunner;
gPCView = NULL; gPCView = NULL;
// replicant deleted, destroy the about window
if (fAboutWindow != NULL && fAboutWindow->Lock())
fAboutWindow->Quit();
} }
@@ -221,7 +217,6 @@ ProcessController::Init()
memset(fCPUTimes, 0, sizeof(fCPUTimes)); memset(fCPUTimes, 0, sizeof(fCPUTimes));
memset(fPrevActive, 0, sizeof(fPrevActive)); memset(fPrevActive, 0, sizeof(fPrevActive));
fPrevTime = 0; fPrevTime = 0;
fAboutWindow = NULL;
} }
@@ -438,7 +433,11 @@ ProcessController::MessageReceived(BMessage *message)
void void
ProcessController::AboutRequested() ProcessController::AboutRequested()
{ {
if (fAboutWindow == NULL) { bool needsInit;
BAboutWindow* window = BAboutWindow::GetWindow(
B_TRANSLATE_SYSTEM_NAME("ProcessController"), kSignature, &needsInit);
if (needsInit) {
const char* extraCopyrights[] = { const char* extraCopyrights[] = {
"2004 beunited.org", "2004 beunited.org",
"1997-2001 Georges-Edouard Berenger", "1997-2001 Georges-Edouard Berenger",
@@ -450,15 +449,13 @@ ProcessController::AboutRequested()
NULL NULL
}; };
fAboutWindow = new BAboutWindow( window->AddCopyright(2007, "Haiku, Inc.", extraCopyrights);
B_TRANSLATE_SYSTEM_NAME("ProcessController"), kSignature); window->AddAuthors(authors);
fAboutWindow->AddCopyright(2007, "Haiku, Inc.", extraCopyrights); }
fAboutWindow->AddAuthors(authors);
fAboutWindow->Show(); if (window->IsHidden())
} else if (fAboutWindow->IsHidden()) window->Show();
fAboutWindow->Show(); window->Activate();
else
fAboutWindow->Activate();
} }
@@ -26,7 +26,6 @@
#include <View.h> #include <View.h>
class BAboutWindow;
class BMessageRunner; class BMessageRunner;
class ThreadBarMenu; class ThreadBarMenu;
@@ -60,7 +59,6 @@ class ProcessController : public BView {
private: private:
void Init(); void Init();
BAboutWindow* fAboutWindow;
bool fTemp; bool fTemp;
float fMemoryUsage; float fMemoryUsage;
float fLastBarHeight[B_MAX_CPU_COUNT]; float fLastBarHeight[B_MAX_CPU_COUNT];
+13 -15
View File
@@ -77,7 +77,6 @@ BrowserApp::BrowserApp()
fCookieJar(NULL), fCookieJar(NULL),
fDownloadWindow(NULL), fDownloadWindow(NULL),
fSettingsWindow(NULL), fSettingsWindow(NULL),
fAboutWindow(NULL)
{ {
} }
@@ -88,16 +87,17 @@ BrowserApp::~BrowserApp()
delete fSettings; delete fSettings;
delete fCookies; delete fCookies;
delete fCookieJar; delete fCookieJar;
if (fAboutWindow != NULL && fAboutWindow->Lock())
fAboutWindow->Quit();
} }
void void
BrowserApp::AboutRequested() BrowserApp::AboutRequested()
{ {
if (fAboutWindow == NULL) { bool needsInit;
BAboutWindow window = BAboutWindow::GetWindow(kApplicationName,
kApplicationSignature, &needsInit);
if (needsInit) {
// create the about window // create the about window
const char* authors[] = { const char* authors[] = {
@@ -117,16 +117,14 @@ BrowserApp::AboutRequested()
aboutText << "\nWebKit " << WebKitInfo::WebKitVersion(); aboutText << "\nWebKit " << WebKitInfo::WebKitVersion();
aboutText << " (" << WebKitInfo::WebKitRevision() << ")"; aboutText << " (" << WebKitInfo::WebKitRevision() << ")";
fAboutWindow = new BAboutWindow(kApplicationName, window->AddCopyright(2007, "Haiku, Inc.");
kApplicationSignature); window->AddAuthors(authors);
fAboutWindow->AddCopyright(2007, "Haiku, Inc."); window->AddExtraInfo(aboutText.String());
fAboutWindow->AddAuthors(authors); }
fAboutWindow->AddExtraInfo(aboutText.String());
fAboutWindow->Show(); if (window->IsHidden())
} else if (fAboutWindow->IsHidden()) window->Show();
fAboutWindow->Show(); window->Activate();
else
fAboutWindow->Activate();
} }
-3
View File
@@ -34,7 +34,6 @@
#include <Rect.h> #include <Rect.h>
class BAboutWindow;
class BNetworkCookieJar; class BNetworkCookieJar;
class DownloadWindow; class DownloadWindow;
class BrowserWindow; class BrowserWindow;
@@ -79,8 +78,6 @@ private:
DownloadWindow* fDownloadWindow; DownloadWindow* fDownloadWindow;
SettingsWindow* fSettingsWindow; SettingsWindow* fSettingsWindow;
BAboutWindow* fAboutWindow;
}; };
+15 -18
View File
@@ -119,7 +119,6 @@ class WorkspacesView : public BView {
BView* fParentWhichDrawsOnChildren; BView* fParentWhichDrawsOnChildren;
BRect fCurrentFrame; BRect fCurrentFrame;
BAboutWindow* fAboutWindow;
}; };
class WorkspacesWindow : public BWindow { class WorkspacesWindow : public BWindow {
@@ -342,8 +341,7 @@ WorkspacesView::WorkspacesView(BRect frame, bool showDragger=true)
BView(frame, kDeskbarItemName, B_FOLLOW_ALL, BView(frame, kDeskbarItemName, B_FOLLOW_ALL,
kWorkspacesViewFlag | B_FRAME_EVENTS), kWorkspacesViewFlag | B_FRAME_EVENTS),
fParentWhichDrawsOnChildren(NULL), fParentWhichDrawsOnChildren(NULL),
fCurrentFrame(frame), fCurrentFrame(frame)
fAboutWindow(NULL)
{ {
if(showDragger) { if(showDragger) {
frame.OffsetTo(B_ORIGIN); frame.OffsetTo(B_ORIGIN);
@@ -360,8 +358,7 @@ WorkspacesView::WorkspacesView(BMessage* archive)
: :
BView(archive), BView(archive),
fParentWhichDrawsOnChildren(NULL), fParentWhichDrawsOnChildren(NULL),
fCurrentFrame(Frame()), fCurrentFrame(Frame())
fAboutWindow(NULL)
{ {
// Just in case we are instantiated from an older archive... // Just in case we are instantiated from an older archive...
SetFlags(Flags() | B_FRAME_EVENTS); SetFlags(Flags() | B_FRAME_EVENTS);
@@ -374,8 +371,6 @@ WorkspacesView::WorkspacesView(BMessage* archive)
WorkspacesView::~WorkspacesView() WorkspacesView::~WorkspacesView()
{ {
if (fAboutWindow != NULL && fAboutWindow->Lock())
fAboutWindow->Quit();
} }
@@ -405,7 +400,11 @@ WorkspacesView::Archive(BMessage* archive, bool deep) const
void void
WorkspacesView::_AboutRequested() WorkspacesView::_AboutRequested()
{ {
if (fAboutWindow == NULL) { bool needsInit;
BAboutWindow* window = BAboutWindow::GetWindow(
B_TRANSLATE_SYSTEM_NAME("Workspaces"), kSignature, &needsInit);
if (needsInit) {
const char* authors[] = { const char* authors[] = {
"Axel Dörfler", "Axel Dörfler",
"Oliver \"Madison\" Kohl", "Oliver \"Madison\" Kohl",
@@ -422,17 +421,15 @@ WorkspacesView::_AboutRequested()
const char* extraInfo = "Send windows behind using the Option key. " const char* extraInfo = "Send windows behind using the Option key. "
"Move windows to front using the Control key.\n"; "Move windows to front using the Control key.\n";
fAboutWindow = new BAboutWindow( window->AddCopyright(2002, "Haiku, Inc.",
B_TRANSLATE_SYSTEM_NAME("Workspaces"), kSignature);
fAboutWindow->AddCopyright(2002, "Haiku, Inc.",
extraCopyrights); extraCopyrights);
fAboutWindow->AddAuthors(authors); window->AddAuthors(authors);
fAboutWindow->AddExtraInfo(extraInfo); window->AddExtraInfo(extraInfo);
fAboutWindow->Show(); }
} else if (fAboutWindow->IsHidden())
fAboutWindow->Show(); if (window->IsHidden())
else window->Show();
fAboutWindow->Activate(); window->Activate();
} }
+24 -11
View File
@@ -356,13 +356,15 @@ BAboutWindow::BAboutWindow(const char* appName, const char* signature)
B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE
| B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE) | B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE)
{ {
sAboutWindow = this;
SetLayout(new BGroupLayout(B_VERTICAL)); SetLayout(new BGroupLayout(B_VERTICAL));
const char* about = B_TRANSLATE_MARK("About"); const char* about = B_TRANSLATE_MARK("About %app%");
about = gSystemCatalog.GetString(about, "AboutWindow"); about = gSystemCatalog.GetString(about, "AboutWindow");
BString title(about); BString title(about);
title << " " << appName; title.ReplaceFirst("%app%", appName);
SetTitle(title.String()); SetTitle(title.String());
fAboutView = new AboutView(appName, signature); fAboutView = new AboutView(appName, signature);
@@ -374,6 +376,8 @@ BAboutWindow::BAboutWindow(const char* appName, const char* signature)
BAboutWindow::~BAboutWindow() BAboutWindow::~BAboutWindow()
{ {
sAboutWindow = NULL;
fAboutView->RemoveSelf(); fAboutView->RemoveSelf();
delete fAboutView; delete fAboutView;
fAboutView = NULL; fAboutView = NULL;
@@ -383,15 +387,6 @@ BAboutWindow::~BAboutWindow()
// #pragma mark - BAboutWindow virtual methods // #pragma mark - BAboutWindow virtual methods
bool
BAboutWindow::QuitRequested()
{
Hide();
return false;
}
void void
BAboutWindow::Show() BAboutWindow::Show()
{ {
@@ -617,3 +612,21 @@ BAboutWindow::SetIcon(BBitmap* icon)
{ {
fAboutView->SetIcon(icon); fAboutView->SetIcon(icon);
} }
/* static */ BAboutWindow*
BAboutWindow::GetWindow(const char* appName, const char* signature,
bool* needsInit)
{
if(needsInit != NULL)
*needsInit = (sAboutWindow == NULL);
if(sAboutWindow == NULL) {
new BAboutWindow(appName, signature);
}
return sAboutWindow;
}
/* static */ BAboutWindow*
BAboutWindow::sAboutWindow = NULL;
+16 -15
View File
@@ -36,7 +36,6 @@ private:
status_t _RestartApp(const char* signature) const; status_t _RestartApp(const char* signature) const;
LocaleWindow* fLocaleWindow; LocaleWindow* fLocaleWindow;
BAboutWindow* fAboutWindow;
}; };
@@ -46,8 +45,7 @@ private:
LocalePreflet::LocalePreflet() LocalePreflet::LocalePreflet()
: :
BApplication(kSignature), BApplication(kSignature),
fLocaleWindow(new LocaleWindow()), fLocaleWindow(new LocaleWindow())
fAboutWindow(NULL)
{ {
fLocaleWindow->Show(); fLocaleWindow->Show();
} }
@@ -55,9 +53,6 @@ LocalePreflet::LocalePreflet()
LocalePreflet::~LocalePreflet() LocalePreflet::~LocalePreflet()
{ {
// replicant deleted, destroy the about window
if (fAboutWindow != NULL)
fAboutWindow->Quit();
} }
@@ -78,7 +73,12 @@ LocalePreflet::MessageReceived(BMessage* message)
break; break;
case B_ABOUT_REQUESTED: case B_ABOUT_REQUESTED:
if (fAboutWindow == NULL) { {
bool needsInit;
BAboutWindow* window = BAboutWindow::GetWindow(kAppName,
kSignature, &needsInit);
if (needsInit) {
const char* authors[] = { const char* authors[] = {
"Axel Dörfler", "Axel Dörfler",
"Adrien Destugues", "Adrien Destugues",
@@ -86,16 +86,17 @@ LocalePreflet::MessageReceived(BMessage* message)
NULL NULL
}; };
fAboutWindow = new BAboutWindow(kAppName, kSignature); window = new BAboutWindow(kAppName, kSignature);
fAboutWindow->AddCopyright(2005, "Haiku, Inc."); window->AddCopyright(2005, "Haiku, Inc.");
fAboutWindow->AddAuthors(authors); window->AddAuthors(authors);
fAboutWindow->Show(); }
} else if (fAboutWindow->IsHidden())
fAboutWindow->Show(); if (window->IsHidden())
else window->Show();
fAboutWindow->Activate(); window->Activate();
break; break;
}
default: default:
BApplication::MessageReceived(message); BApplication::MessageReceived(message);