* Some cleanup, no functional change.
* Looks like this is neither using the layout engine nor has it been localized yet! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37313 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -62,64 +62,74 @@ const int32 kMsgNeverFadeCornerChanged = 'nfcc';
|
|||||||
|
|
||||||
|
|
||||||
class TimeSlider : public BSlider {
|
class TimeSlider : public BSlider {
|
||||||
public:
|
public:
|
||||||
TimeSlider(BRect frame, const char* name, uint32 changedMessage,
|
TimeSlider(BRect frame, const char* name,
|
||||||
uint32 updateMessage);
|
uint32 changedMessage,
|
||||||
virtual ~TimeSlider();
|
uint32 updateMessage);
|
||||||
|
virtual ~TimeSlider();
|
||||||
|
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
virtual void SetValue(int32 value);
|
virtual void SetValue(int32 value);
|
||||||
|
|
||||||
void SetTime(bigtime_t useconds);
|
void SetTime(bigtime_t useconds);
|
||||||
bigtime_t Time();
|
bigtime_t Time() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _TimeToString(bigtime_t useconds, BString& string);
|
void _TimeToString(bigtime_t useconds,
|
||||||
|
BString& string);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class FadeView : public BView {
|
class FadeView : public BView {
|
||||||
public:
|
public:
|
||||||
FadeView(BRect frame, const char* name, ScreenSaverSettings& settings);
|
FadeView(BRect frame, const char* name,
|
||||||
|
ScreenSaverSettings& settings);
|
||||||
|
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ModulesView : public BView {
|
class ModulesView : public BView {
|
||||||
public:
|
public:
|
||||||
ModulesView(BRect frame, const char* name, ScreenSaverSettings& settings);
|
ModulesView(BRect frame, const char* name,
|
||||||
virtual ~ModulesView();
|
ScreenSaverSettings& settings);
|
||||||
|
virtual ~ModulesView();
|
||||||
|
|
||||||
virtual void DetachedFromWindow();
|
virtual void DetachedFromWindow();
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
virtual void AllAttached();
|
virtual void AllAttached();
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
|
|
||||||
void PopulateScreenSaverList();
|
void PopulateScreenSaverList();
|
||||||
void SaveState();
|
void SaveState();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static int _CompareScreenSaverItems(const void* left, const void* right);
|
static int _CompareScreenSaverItems(const void* left,
|
||||||
BScreenSaver* _ScreenSaver();
|
const void* right);
|
||||||
void _CloseSaver();
|
|
||||||
void _OpenSaver();
|
|
||||||
|
|
||||||
BFilePanel* fFilePanel;
|
BScreenSaver* _ScreenSaver();
|
||||||
BListView* fListView;
|
void _CloseSaver();
|
||||||
BButton* fTestButton;
|
void _OpenSaver();
|
||||||
BButton* fAddButton;
|
|
||||||
|
|
||||||
ScreenSaverSettings& fSettings;
|
private:
|
||||||
ScreenSaverRunner* fSaverRunner;
|
BFilePanel* fFilePanel;
|
||||||
BString fCurrentName;
|
BListView* fListView;
|
||||||
|
BButton* fTestButton;
|
||||||
|
BButton* fAddButton;
|
||||||
|
|
||||||
BBox* fSettingsBox;
|
ScreenSaverSettings& fSettings;
|
||||||
BView* fSettingsView;
|
ScreenSaverRunner* fSaverRunner;
|
||||||
|
BString fCurrentName;
|
||||||
|
|
||||||
PreviewView* fPreviewView;
|
BBox* fSettingsBox;
|
||||||
|
BView* fSettingsView;
|
||||||
|
|
||||||
team_id fScreenSaverTestTeamId;
|
PreviewView* fPreviewView;
|
||||||
|
|
||||||
|
team_id fScreenSaverTestTeam;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static const int32 kTimeInUnits[] = {
|
static const int32 kTimeInUnits[] = {
|
||||||
30, 60, 90,
|
30, 60, 90,
|
||||||
120, 150, 180,
|
120, 150, 180,
|
||||||
@@ -131,12 +141,14 @@ static const int32 kTimeInUnits[] = {
|
|||||||
7200, 9000, 10800,
|
7200, 9000, 10800,
|
||||||
14400, 18000
|
14400, 18000
|
||||||
};
|
};
|
||||||
static const int32 kTimeUnitCount = sizeof(kTimeInUnits) / sizeof(kTimeInUnits[0]);
|
static const int32 kTimeUnitCount
|
||||||
|
= sizeof(kTimeInUnits) / sizeof(kTimeInUnits[0]);
|
||||||
|
|
||||||
|
|
||||||
TimeSlider::TimeSlider(BRect frame, const char* name, uint32 changedMessage,
|
TimeSlider::TimeSlider(BRect frame, const char* name, uint32 changedMessage,
|
||||||
uint32 updateMessage)
|
uint32 updateMessage)
|
||||||
: BSlider(frame, name, "30 seconds", new BMessage(changedMessage),
|
:
|
||||||
|
BSlider(frame, name, "30 seconds", new BMessage(changedMessage),
|
||||||
0, kTimeUnitCount - 1, B_TRIANGLE_THUMB, B_FOLLOW_LEFT_RIGHT)
|
0, kTimeUnitCount - 1, B_TRIANGLE_THUMB, B_FOLLOW_LEFT_RIGHT)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
@@ -185,7 +197,7 @@ TimeSlider::SetTime(bigtime_t useconds)
|
|||||||
|
|
||||||
|
|
||||||
bigtime_t
|
bigtime_t
|
||||||
TimeSlider::Time()
|
TimeSlider::Time() const
|
||||||
{
|
{
|
||||||
return 1000000LL * kTimeInUnits[Value()];
|
return 1000000LL * kTimeInUnits[Value()];
|
||||||
}
|
}
|
||||||
@@ -228,7 +240,8 @@ TimeSlider::_TimeToString(bigtime_t useconds, BString& string)
|
|||||||
|
|
||||||
|
|
||||||
FadeView::FadeView(BRect rect, const char* name, ScreenSaverSettings& settings)
|
FadeView::FadeView(BRect rect, const char* name, ScreenSaverSettings& settings)
|
||||||
: BView(rect, name, B_FOLLOW_ALL, B_WILL_DRAW)
|
:
|
||||||
|
BView(rect, name, B_FOLLOW_ALL, B_WILL_DRAW)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
}
|
}
|
||||||
@@ -248,16 +261,19 @@ FadeView::AttachedToWindow()
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
ModulesView::ModulesView(BRect rect, const char* name, ScreenSaverSettings& settings)
|
ModulesView::ModulesView(BRect rect, const char* name,
|
||||||
: BView(rect, name, B_FOLLOW_ALL, B_WILL_DRAW),
|
ScreenSaverSettings& settings)
|
||||||
|
:
|
||||||
|
BView(rect, name, B_FOLLOW_ALL, B_WILL_DRAW),
|
||||||
fSettings(settings),
|
fSettings(settings),
|
||||||
fSaverRunner(NULL),
|
fSaverRunner(NULL),
|
||||||
fSettingsView(NULL)
|
fSettingsView(NULL),
|
||||||
|
fScreenSaverTestTeam(-1)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
fTestButton = new BButton(rect, "TestButton", "Test", new BMessage(kMsgTestSaver),
|
fTestButton = new BButton(rect, "TestButton", "Test",
|
||||||
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
new BMessage(kMsgTestSaver), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
||||||
float width, height;
|
float width, height;
|
||||||
fTestButton->GetPreferredSize(&width, &height);
|
fTestButton->GetPreferredSize(&width, &height);
|
||||||
fTestButton->ResizeTo(width + 16, height);
|
fTestButton->ResizeTo(width + 16, height);
|
||||||
@@ -291,7 +307,8 @@ ModulesView::ModulesView(BRect rect, const char* name, ScreenSaverSettings& sett
|
|||||||
|
|
||||||
rect = Bounds().InsetByCopy(8, 8);
|
rect = Bounds().InsetByCopy(8, 8);
|
||||||
rect.left = fAddButton->Frame().right + 8;
|
rect.left = fAddButton->Frame().right + 8;
|
||||||
AddChild(fSettingsBox = new BBox(rect, "SettingsBox", B_FOLLOW_ALL, B_WILL_DRAW));
|
AddChild(fSettingsBox = new BBox(rect, "SettingsBox", B_FOLLOW_ALL,
|
||||||
|
B_WILL_DRAW));
|
||||||
fSettingsBox->SetLabel("Module settings");
|
fSettingsBox->SetLabel("Module settings");
|
||||||
|
|
||||||
PopulateScreenSaverList();
|
PopulateScreenSaverList();
|
||||||
@@ -348,7 +365,8 @@ ModulesView::MessageReceived(BMessage* message)
|
|||||||
if (selection < 0)
|
if (selection < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ScreenSaverItem* item = (ScreenSaverItem *)fListView->ItemAt(selection);
|
ScreenSaverItem* item
|
||||||
|
= (ScreenSaverItem*)fListView->ItemAt(selection);
|
||||||
if (item == NULL)
|
if (item == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -371,41 +389,42 @@ ModulesView::MessageReceived(BMessage* message)
|
|||||||
|
|
||||||
_CloseSaver();
|
_CloseSaver();
|
||||||
|
|
||||||
be_roster->StartWatching(BMessenger(this, this->Looper()),
|
be_roster->StartWatching(BMessenger(this, Looper()),
|
||||||
B_REQUEST_QUIT);
|
B_REQUEST_QUIT);
|
||||||
if (be_roster->Launch(SCREEN_BLANKER_SIG, &fSettings.Message(),
|
if (be_roster->Launch(SCREEN_BLANKER_SIG, &fSettings.Message(),
|
||||||
&fScreenSaverTestTeamId) == B_OK)
|
&fScreenSaverTestTeam) == B_OK)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Try really hard to launch it. It's very likely that this fails,
|
// Try really hard to launch it. It's very likely that this fails
|
||||||
// when we run from the CD and there is only an incomplete mime
|
// when we run from the CD, and there is only an incomplete mime
|
||||||
// database for example...
|
// database for example...
|
||||||
BPath path;
|
BPath path;
|
||||||
if (find_directory(B_SYSTEM_BIN_DIRECTORY, &path) != B_OK
|
if (find_directory(B_SYSTEM_BIN_DIRECTORY, &path) != B_OK
|
||||||
|| path.Append("screen_blanker") != B_OK) {
|
|| path.Append("screen_blanker") != B_OK)
|
||||||
path.SetTo("/boot/system/bin/screen_blanker");
|
path.SetTo("/boot/system/bin/screen_blanker");
|
||||||
}
|
|
||||||
BEntry entry(path.Path());
|
BEntry entry(path.Path());
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
if (entry.GetRef(&ref) == B_OK)
|
if (entry.GetRef(&ref) == B_OK) {
|
||||||
be_roster->Launch(&ref, &fSettings.Message(),
|
be_roster->Launch(&ref, &fSettings.Message(),
|
||||||
&fScreenSaverTestTeamId);
|
&fScreenSaverTestTeam);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kMsgAddSaver:
|
case kMsgAddSaver:
|
||||||
fFilePanel->Show();
|
fFilePanel->Show();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case B_SOME_APP_QUIT: {
|
case B_SOME_APP_QUIT:
|
||||||
team_id team;
|
{
|
||||||
if (message->FindInt32("be:team", &team) == B_OK) {
|
team_id team;
|
||||||
if (team == fScreenSaverTestTeamId) {
|
if (message->FindInt32("be:team", &team) == B_OK
|
||||||
be_roster->StopWatching(this);
|
&& team == fScreenSaverTestTeam) {
|
||||||
_OpenSaver();
|
be_roster->StopWatching(this);
|
||||||
}
|
_OpenSaver();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BView::MessageReceived(message);
|
BView::MessageReceived(message);
|
||||||
@@ -430,7 +449,8 @@ void
|
|||||||
ModulesView::PopulateScreenSaverList()
|
ModulesView::PopulateScreenSaverList()
|
||||||
{
|
{
|
||||||
fListView->DeselectAll();
|
fListView->DeselectAll();
|
||||||
while (ScreenSaverItem* item = (ScreenSaverItem *)fListView->RemoveItem((int32)0)) {
|
while (ScreenSaverItem* item
|
||||||
|
= (ScreenSaverItem*)fListView->RemoveItem((int32)0)) {
|
||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,7 +459,8 @@ ModulesView::PopulateScreenSaverList()
|
|||||||
|
|
||||||
// Iterate over add-on directories, and add their files to the list view
|
// Iterate over add-on directories, and add their files to the list view
|
||||||
|
|
||||||
directory_which which[] = {B_BEOS_ADDONS_DIRECTORY, B_USER_ADDONS_DIRECTORY};
|
directory_which which[] = {
|
||||||
|
B_BEOS_ADDONS_DIRECTORY, B_USER_ADDONS_DIRECTORY};
|
||||||
ScreenSaverItem* selectItem = NULL;
|
ScreenSaverItem* selectItem = NULL;
|
||||||
|
|
||||||
for (uint32 i = 0; i < sizeof(which) / sizeof(which[0]); i++) {
|
for (uint32 i = 0; i < sizeof(which) / sizeof(which[0]); i++) {
|
||||||
@@ -474,7 +495,7 @@ ModulesView::PopulateScreenSaverList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! sorting function for ScreenSaverItems
|
//! Sorting function for ScreenSaverItems
|
||||||
int
|
int
|
||||||
ModulesView::_CompareScreenSaverItems(const void* left, const void* right)
|
ModulesView::_CompareScreenSaverItems(const void* left, const void* right)
|
||||||
{
|
{
|
||||||
@@ -566,19 +587,23 @@ ModulesView::_OpenSaver()
|
|||||||
while ((view = fSettingsView->ChildAt(i++)) != NULL) {
|
while ((view = fSettingsView->ChildAt(i++)) != NULL) {
|
||||||
// very simple heuristic...
|
// very simple heuristic...
|
||||||
float viewRight = view->Frame().right;
|
float viewRight = view->Frame().right;
|
||||||
if ((view->ResizingMode() & _rule_(0, 0xf, 0, 0xf)) == B_FOLLOW_LEFT_RIGHT) {
|
if ((view->ResizingMode() & _rule_(0, 0xf, 0, 0xf))
|
||||||
|
== B_FOLLOW_LEFT_RIGHT) {
|
||||||
float width, height;
|
float width, height;
|
||||||
view->GetPreferredSize(&width, &height);
|
view->GetPreferredSize(&width, &height);
|
||||||
viewRight = view->Frame().left + width / 2;
|
viewRight = view->Frame().left + width / 2;
|
||||||
} else if ((view->ResizingMode() & _rule_(0, 0xf, 0, 0xf)) == B_FOLLOW_RIGHT)
|
} else if ((view->ResizingMode() & _rule_(0, 0xf, 0, 0xf))
|
||||||
|
== B_FOLLOW_RIGHT)
|
||||||
viewRight = 8 + view->Frame().Width();
|
viewRight = 8 + view->Frame().Width();
|
||||||
|
|
||||||
float viewBottom = view->Frame().bottom;
|
float viewBottom = view->Frame().bottom;
|
||||||
if ((view->ResizingMode() & _rule_(0xf, 0, 0xf, 0)) == B_FOLLOW_TOP_BOTTOM) {
|
if ((view->ResizingMode() & _rule_(0xf, 0, 0xf, 0))
|
||||||
|
== B_FOLLOW_TOP_BOTTOM) {
|
||||||
float width, height;
|
float width, height;
|
||||||
view->GetPreferredSize(&width, &height);
|
view->GetPreferredSize(&width, &height);
|
||||||
viewBottom = view->Frame().top + height;
|
viewBottom = view->Frame().top + height;
|
||||||
} else if ((view->ResizingMode() & _rule_(0xf, 0, 0xf, 0)) == B_FOLLOW_BOTTOM)
|
} else if ((view->ResizingMode() & _rule_(0xf, 0, 0xf, 0))
|
||||||
|
== B_FOLLOW_BOTTOM)
|
||||||
viewBottom = 8 + view->Frame().Height();
|
viewBottom = 8 + view->Frame().Height();
|
||||||
|
|
||||||
if (viewRight > right)
|
if (viewRight > right)
|
||||||
@@ -604,8 +629,9 @@ ModulesView::_OpenSaver()
|
|||||||
|
|
||||||
|
|
||||||
ScreenSaverWindow::ScreenSaverWindow()
|
ScreenSaverWindow::ScreenSaverWindow()
|
||||||
: BWindow(BRect(50, 50, 496, 375), "ScreenSaver",
|
:
|
||||||
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS /*| B_NOT_ZOOMABLE | B_NOT_RESIZABLE*/)
|
BWindow(BRect(50, 50, 496, 375), "ScreenSaver",
|
||||||
|
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS)
|
||||||
{
|
{
|
||||||
fSettings.Load();
|
fSettings.Load();
|
||||||
|
|
||||||
@@ -639,7 +665,8 @@ ScreenSaverWindow::ScreenSaverWindow()
|
|||||||
MoveTo(fSettings.WindowFrame().left, fSettings.WindowFrame().top);
|
MoveTo(fSettings.WindowFrame().left, fSettings.WindowFrame().top);
|
||||||
ResizeTo(fSettings.WindowFrame().Width(), fSettings.WindowFrame().Height());
|
ResizeTo(fSettings.WindowFrame().Width(), fSettings.WindowFrame().Height());
|
||||||
|
|
||||||
fEnableCheckBox->SetValue(fSettings.TimeFlags() & ENABLE_SAVER ? B_CONTROL_ON : B_CONTROL_OFF);
|
fEnableCheckBox->SetValue(
|
||||||
|
fSettings.TimeFlags() & ENABLE_SAVER ? B_CONTROL_ON : B_CONTROL_OFF);
|
||||||
fRunSlider->SetTime(fSettings.BlankTime());
|
fRunSlider->SetTime(fSettings.BlankTime());
|
||||||
fTurnOffSlider->SetTime(fSettings.OffTime() + fSettings.BlankTime());
|
fTurnOffSlider->SetTime(fSettings.OffTime() + fSettings.BlankTime());
|
||||||
fFadeNow->SetCorner(fSettings.BlankCorner());
|
fFadeNow->SetCorner(fSettings.BlankCorner());
|
||||||
@@ -680,7 +707,8 @@ ScreenSaverWindow::_SetupFadeTab(BRect rect)
|
|||||||
float textHeight = ceilf(fontHeight.ascent + fontHeight.descent);
|
float textHeight = ceilf(fontHeight.ascent + fontHeight.descent);
|
||||||
|
|
||||||
// taken from BRadioButton:
|
// taken from BRadioButton:
|
||||||
float radioButtonOffset = 2 * floorf(textHeight / 2 - 2) + floorf(textHeight / 2);
|
float radioButtonOffset = 2 * floorf(textHeight / 2 - 2)
|
||||||
|
+ floorf(textHeight / 2);
|
||||||
|
|
||||||
fEnableCheckBox = new BCheckBox(BRect(0, 0, 1, 1), "EnableCheckBox",
|
fEnableCheckBox = new BCheckBox(BRect(0, 0, 1, 1), "EnableCheckBox",
|
||||||
"Enable screen saver", new BMessage(kMsgEnableScreenSaverBox));
|
"Enable screen saver", new BMessage(kMsgEnableScreenSaverBox));
|
||||||
@@ -737,8 +765,9 @@ ScreenSaverWindow::_SetupFadeTab(BRect rect)
|
|||||||
|
|
||||||
rect.OffsetBy(0, fTurnOffSlider->Bounds().Height() + 4.0f);
|
rect.OffsetBy(0, fTurnOffSlider->Bounds().Height() + 4.0f);
|
||||||
rect.left = rect.right;
|
rect.left = rect.right;
|
||||||
fPasswordButton = new BButton(rect, "PasswordButton", "Password" B_UTF8_ELLIPSIS,
|
fPasswordButton = new BButton(rect, "PasswordButton",
|
||||||
new BMessage(kMsgChangePassword), B_FOLLOW_TOP | B_FOLLOW_RIGHT);
|
"Password" B_UTF8_ELLIPSIS, new BMessage(kMsgChangePassword),
|
||||||
|
B_FOLLOW_TOP | B_FOLLOW_RIGHT);
|
||||||
fPasswordButton->ResizeToPreferred();
|
fPasswordButton->ResizeToPreferred();
|
||||||
fPasswordButton->MoveBy(-fPasswordButton->Bounds().Width(), 0);
|
fPasswordButton->MoveBy(-fPasswordButton->Bounds().Width(), 0);
|
||||||
box->AddChild(fPasswordButton);
|
box->AddChild(fPasswordButton);
|
||||||
@@ -774,7 +803,8 @@ ScreenSaverWindow::_SetupFadeTab(BRect rect)
|
|||||||
rect.right = rect.left + monitorWidth;
|
rect.right = rect.left + monitorWidth;
|
||||||
rect.bottom = rect.top + monitorHeight;
|
rect.bottom = rect.top + monitorHeight;
|
||||||
box->AddChild(fFadeNever = new ScreenCornerSelector(rect, "FadeNever",
|
box->AddChild(fFadeNever = new ScreenCornerSelector(rect, "FadeNever",
|
||||||
new BMessage(kMsgNeverFadeCornerChanged), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM));
|
new BMessage(kMsgNeverFadeCornerChanged),
|
||||||
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM));
|
||||||
|
|
||||||
rect.OffsetBy(monitorWidth + 10, 0);
|
rect.OffsetBy(monitorWidth + 10, 0);
|
||||||
stringView = new BStringView(rect, NULL,"Don't fade when",
|
stringView = new BStringView(rect, NULL,"Don't fade when",
|
||||||
@@ -901,7 +931,8 @@ ScreenSaverWindow::MessageReceived(BMessage *msg)
|
|||||||
// "Fade" tab
|
// "Fade" tab
|
||||||
|
|
||||||
case kMsgTurnOffCheckBox:
|
case kMsgTurnOffCheckBox:
|
||||||
fTurnOffSlider->SetEnabled(fTurnOffCheckBox->Value() == B_CONTROL_ON);
|
fTurnOffSlider->SetEnabled(
|
||||||
|
fTurnOffCheckBox->Value() == B_CONTROL_ON);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kMsgRunSliderChanged:
|
case kMsgRunSliderChanged:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2003-2006, Haiku.
|
* Copyright 2003-2010, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <Slider.h>
|
#include <Slider.h>
|
||||||
#include <ListView.h>
|
#include <ListView.h>
|
||||||
|
|
||||||
|
|
||||||
class BButton;
|
class BButton;
|
||||||
class BTabView;
|
class BTabView;
|
||||||
|
|
||||||
@@ -28,46 +29,51 @@ class ScreenCornerSelector;
|
|||||||
class ScreenSaverRunner;
|
class ScreenSaverRunner;
|
||||||
class TimeSlider;
|
class TimeSlider;
|
||||||
|
|
||||||
|
|
||||||
class ScreenSaverWindow : public BWindow {
|
class ScreenSaverWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
ScreenSaverWindow();
|
ScreenSaverWindow();
|
||||||
virtual ~ScreenSaverWindow();
|
virtual ~ScreenSaverWindow();
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual void ScreenChanged(BRect frame, color_space colorSpace);
|
virtual void ScreenChanged(BRect frame, color_space space);
|
||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
|
|
||||||
void LoadSettings();
|
void LoadSettings();
|
||||||
void SetMinimalSizeLimit(float width, float height);
|
void SetMinimalSizeLimit(float width, float height);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _SetupFadeTab(BRect frame);
|
void _SetupFadeTab(BRect frame);
|
||||||
void _UpdateTurnOffScreen();
|
void _UpdateTurnOffScreen();
|
||||||
void _UpdateStatus();
|
void _UpdateStatus();
|
||||||
|
|
||||||
float fMinWidth, fMinHeight;
|
private:
|
||||||
ScreenSaverSettings fSettings;
|
float fMinWidth;
|
||||||
uint32 fTurnOffScreenFlags;
|
float fMinHeight;
|
||||||
|
ScreenSaverSettings fSettings;
|
||||||
|
uint32 fTurnOffScreenFlags;
|
||||||
|
|
||||||
BView* fFadeView;
|
BView* fFadeView;
|
||||||
ModulesView* fModulesView;
|
ModulesView* fModulesView;
|
||||||
BTabView* fTabView;
|
BTabView* fTabView;
|
||||||
|
|
||||||
BCheckBox* fEnableCheckBox;
|
BCheckBox* fEnableCheckBox;
|
||||||
TimeSlider* fRunSlider;
|
TimeSlider* fRunSlider;
|
||||||
|
|
||||||
BCheckBox* fTurnOffCheckBox;
|
BCheckBox* fTurnOffCheckBox;
|
||||||
TimeSlider* fTurnOffSlider;
|
TimeSlider* fTurnOffSlider;
|
||||||
|
|
||||||
BCheckBox* fPasswordCheckBox;
|
BCheckBox* fPasswordCheckBox;
|
||||||
TimeSlider* fPasswordSlider;
|
TimeSlider* fPasswordSlider;
|
||||||
BButton* fPasswordButton;
|
BButton* fPasswordButton;
|
||||||
PasswordWindow* fPasswordWindow;
|
PasswordWindow* fPasswordWindow;
|
||||||
|
|
||||||
ScreenCornerSelector* fFadeNow;
|
ScreenCornerSelector* fFadeNow;
|
||||||
ScreenCornerSelector* fFadeNever;
|
ScreenCornerSelector* fFadeNever;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static const int32 kMsgUpdateList = 'UPDL';
|
static const int32 kMsgUpdateList = 'UPDL';
|
||||||
|
|
||||||
|
|
||||||
#endif // SCREEN_SAVER_WINDOW_H
|
#endif // SCREEN_SAVER_WINDOW_H
|
||||||
|
|||||||
Reference in New Issue
Block a user