Update Workspaces about dialog

This commit is contained in:
John Scipione
2012-11-13 01:53:31 -05:00
parent b23f8cd41f
commit df02847b49
2 changed files with 36 additions and 25 deletions
+2 -2
View File
@@ -3,11 +3,11 @@ SubDir HAIKU_TOP src apps workspaces ;
SetSubDirSupportedPlatformsBeOSCompatible ; SetSubDirSupportedPlatformsBeOSCompatible ;
AddSubDirSupportedPlatforms libbe_test ; AddSubDirSupportedPlatforms libbe_test ;
UsePrivateHeaders app interface ; UsePrivateHeaders app interface shared ;
Application Workspaces : Application Workspaces :
Workspaces.cpp Workspaces.cpp
: be $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++) : be libshared.a $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++)
: Workspaces.rdef : Workspaces.rdef
; ;
+34 -23
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2009, Haiku, Inc. All rights reserved. * Copyright 2002-2012, Haiku, Inc. All rights reserved.
* Copyright 2002, François Revol, [email protected]. * Copyright 2002, François Revol, [email protected].
* This file is distributed under the terms of the MIT License. * This file is distributed under the terms of the MIT License.
* *
@@ -11,7 +11,7 @@
*/ */
#include <Alert.h> #include <AboutWindow.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h> #include <Catalog.h>
#include <Deskbar.h> #include <Deskbar.h>
@@ -119,6 +119,7 @@ class WorkspacesView : public BView {
BView* fParentWhichDrawsOnChildren; BView* fParentWhichDrawsOnChildren;
BRect fCurrentFrame; BRect fCurrentFrame;
BAboutWindow* fAboutWindow;
}; };
class WorkspacesWindow : public BWindow { class WorkspacesWindow : public BWindow {
@@ -341,7 +342,8 @@ 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);
@@ -358,7 +360,8 @@ 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);
@@ -371,6 +374,8 @@ WorkspacesView::WorkspacesView(BMessage* archive)
WorkspacesView::~WorkspacesView() WorkspacesView::~WorkspacesView()
{ {
if (fAboutWindow != NULL)
fAboutWindow->Quit();
} }
@@ -400,28 +405,34 @@ WorkspacesView::Archive(BMessage* archive, bool deep) const
void void
WorkspacesView::_AboutRequested() WorkspacesView::_AboutRequested()
{ {
BString text = B_TRANSLATE("Workspaces\n" if (fAboutWindow == NULL) {
"written by %1, and %2.\n\n" const char* authors[] = {
"Copyright %3, Haiku.\n\n" "Axel Dörfler",
"Send windows behind using the Option key. " "Oliver \"Madison\" Kohl",
"Move windows to front using the Control key.\n"); "Matt Madia",
text.ReplaceFirst("%1", "François Revol, Axel Dörfler"); "François Revol",
text.ReplaceFirst("%2", "Matt Madia"); NULL
text.ReplaceFirst("%3", "2002-2008"); };
BAlert *alert = new BAlert("about", text.String(), B_TRANSLATE("OK"));
BTextView *view = alert->TextView();
BFont font;
view->SetStylable(true); const char* extraCopyrights[] = {
"2002 François Revol",
NULL
};
view->GetFont(&font); const char* extraInfo = "Send windows behind using the Option key. "
font.SetSize(18); "Move windows to front using the Control key.\n";
font.SetFace(B_BOLD_FACE);
view->SetFontAndColor(0, 10, &font);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); fAboutWindow = new BAboutWindow(
alert->Go(); B_TRANSLATE_SYSTEM_NAME("Workspaces"), kSignature);
fAboutWindow->AddCopyright(2002, "Haiku, Inc.",
extraCopyrights);
fAboutWindow->AddAuthors(authors);
fAboutWindow->AddExtraInfo(extraInfo);
fAboutWindow->Show();
} else if (fAboutWindow->IsHidden())
fAboutWindow->Show();
else
fAboutWindow->Activate();
} }