Update Workspaces about dialog
This commit is contained in:
@@ -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
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -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"));
|
const char* extraCopyrights[] = {
|
||||||
BTextView *view = alert->TextView();
|
"2002 François Revol",
|
||||||
BFont font;
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
view->SetStylable(true);
|
const char* extraInfo = "Send windows behind using the Option key. "
|
||||||
|
"Move windows to front using the Control key.\n";
|
||||||
|
|
||||||
view->GetFont(&font);
|
fAboutWindow = new BAboutWindow(
|
||||||
font.SetSize(18);
|
B_TRANSLATE_SYSTEM_NAME("Workspaces"), kSignature);
|
||||||
font.SetFace(B_BOLD_FACE);
|
fAboutWindow->AddCopyright(2002, "Haiku, Inc.",
|
||||||
view->SetFontAndColor(0, 10, &font);
|
extraCopyrights);
|
||||||
|
fAboutWindow->AddAuthors(authors);
|
||||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
fAboutWindow->AddExtraInfo(extraInfo);
|
||||||
alert->Go();
|
fAboutWindow->Show();
|
||||||
|
} else if (fAboutWindow->IsHidden())
|
||||||
|
fAboutWindow->Show();
|
||||||
|
else
|
||||||
|
fAboutWindow->Activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user