Update PowerStatus about window

This commit is contained in:
John Scipione
2012-11-13 01:37:30 -05:00
parent 5070e7e222
commit d4d5bf6c50
2 changed files with 23 additions and 18 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ Application PowerStatus :
PowerStatusWindow.cpp PowerStatusWindow.cpp
PowerStatusView.cpp PowerStatusView.cpp
PowerStatus.cpp PowerStatus.cpp
: be $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS) : be libshared.a $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
: PowerStatus.rdef : PowerStatus.rdef
; ;
DoCatalogs PowerStatus : DoCatalogs PowerStatus :
+22 -17
View File
@@ -96,6 +96,8 @@ PowerStatusView::_Init()
{ {
SetViewColor(B_TRANSPARENT_COLOR); SetViewColor(B_TRANSPARENT_COLOR);
fAboutWindow = NULL;
fShowLabel = true; fShowLabel = true;
fShowTime = false; fShowTime = false;
fShowStatusIcon = true; fShowStatusIcon = true;
@@ -503,14 +505,16 @@ PowerStatusReplicant::PowerStatusReplicant(BMessage* archive)
PowerStatusReplicant::~PowerStatusReplicant() PowerStatusReplicant::~PowerStatusReplicant()
{ {
if (fMessengerExist) { if (fMessengerExist)
delete fExtWindowMessenger; delete fExtWindowMessenger;
}
fDriverInterface->StopWatching(this); fDriverInterface->StopWatching(this);
fDriverInterface->Disconnect(); fDriverInterface->Disconnect();
fDriverInterface->ReleaseReference(); fDriverInterface->ReleaseReference();
if (fAboutWindow != NULL)
fAboutWindow->Quit();
_SaveSettings(); _SaveSettings();
} }
@@ -621,22 +625,23 @@ PowerStatusReplicant::MouseDown(BPoint point)
void void
PowerStatusReplicant::_AboutRequested() PowerStatusReplicant::_AboutRequested()
{ {
BAlert* alert = new BAlert(B_TRANSLATE("About"), if (fAboutWindow == NULL) {
B_TRANSLATE("PowerStatus\n" const char* authors[] = {
"written by Axel Dörfler, Clemens Zeidler\n" "Axel Dörfler",
"Copyright 2006, Haiku, Inc.\n"), B_TRANSLATE("OK")); "Alexander von Gluck",
BTextView *view = alert->TextView(); "Clemens Zeidler",
BFont font; NULL
};
view->SetStylable(true); fAboutWindow = new BAboutWindow(
B_TRANSLATE_SYSTEM_NAME("PowerStatus"), kSignature);
view->GetFont(&font); fAboutWindow->AddCopyright(2006, "Haiku, Inc.");
font.SetSize(18); fAboutWindow->AddAuthors(authors);
font.SetFace(B_BOLD_FACE); fAboutWindow->Show();
view->SetFontAndColor(0, strlen(B_TRANSLATE("PowerStatus")), &font); } else if (fAboutWindow->IsHidden())
fAboutWindow->Show();
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); else
alert->Go(); fAboutWindow->Activate();
} }