fixes Loadsettings return value
rename pwWindow to PasswordWindow added ScreenSaver to Jamfile to have Matrix screensaver loaded correctly git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13876 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5,7 +5,11 @@ UsePrivateHeaders screen_saver ;
|
|||||||
BinCommand screen_blanker :
|
BinCommand screen_blanker :
|
||||||
ScreenSaverApp.cpp
|
ScreenSaverApp.cpp
|
||||||
SSAwindow.cpp
|
SSAwindow.cpp
|
||||||
pwWindow.cpp
|
PasswordWindow.cpp
|
||||||
|
ScreenSaver.cpp
|
||||||
: be game libscreensaver.so
|
: be game libscreensaver.so
|
||||||
;
|
;
|
||||||
|
|
||||||
|
SEARCH on [ FGristFiles
|
||||||
|
ScreenSaver.cpp
|
||||||
|
] = [ FDirName $(OBOS_TOP) src kits screensaver ] ;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
#include "pwWindow.h"
|
#include "PasswordWindow.h"
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -21,7 +21,7 @@ PasswordWindow::Setup()
|
|||||||
BRect bounds(fBgd->Bounds());
|
BRect bounds(fBgd->Bounds());
|
||||||
bounds.InsetBy(5,5);
|
bounds.InsetBy(5,5);
|
||||||
|
|
||||||
fCustomBox=new BBox(bounds,"custBeBox",B_FOLLOW_NONE);
|
fCustomBox = new BBox(bounds,"custBeBox",B_FOLLOW_NONE);
|
||||||
fCustomBox->SetLabel("Unlock screen saver");
|
fCustomBox->SetLabel("Unlock screen saver");
|
||||||
fBgd->AddChild(fCustomBox);
|
fBgd->AddChild(fCustomBox);
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ PasswordWindow::Setup()
|
|||||||
fPassword->SetDivider(100);
|
fPassword->SetDivider(100);
|
||||||
fCustomBox->AddChild(fPassword);
|
fCustomBox->AddChild(fPassword);
|
||||||
|
|
||||||
fUnlock=new BButton(BRect(160,70,255,85),"fUnlock","Unlock",new BMessage ('DONE'),B_FOLLOW_NONE);
|
fUnlock = new BButton(BRect(160,70,255,85), "fUnlock", "Unlock", new BMessage(UNLOCK_MESSAGE), B_FOLLOW_NONE);
|
||||||
fUnlock->SetTarget(NULL,be_app);
|
fUnlock->SetTarget(NULL,be_app);
|
||||||
fCustomBox->AddChild(fUnlock);
|
fCustomBox->AddChild(fUnlock);
|
||||||
fUnlock->MakeDefault(true);
|
fUnlock->MakeDefault(true);
|
||||||
@@ -10,6 +10,8 @@
|
|||||||
#include <TextControl.h>
|
#include <TextControl.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
|
||||||
|
const int32 UNLOCK_MESSAGE = 'ULMS';
|
||||||
|
|
||||||
class PasswordWindow : public BWindow
|
class PasswordWindow : public BWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <Beep.h>
|
#include <Beep.h>
|
||||||
|
|
||||||
#include <ScreenSaverApp.h>
|
#include "ScreenSaverApp.h"
|
||||||
|
|
||||||
|
|
||||||
// Start the server application. Set pulse to fire once per second.
|
// Start the server application. Set pulse to fire once per second.
|
||||||
@@ -28,7 +28,7 @@ int main(int, char**)
|
|||||||
|
|
||||||
// Construct the server app. Doesn't do much, at this point.
|
// Construct the server app. Doesn't do much, at this point.
|
||||||
ScreenSaverApp::ScreenSaverApp()
|
ScreenSaverApp::ScreenSaverApp()
|
||||||
: BApplication("application/x-vnd.OBOS-ScreenSaverApp"),
|
: BApplication(SCREEN_BLANKER_SIG),
|
||||||
fWin(NULL)
|
fWin(NULL)
|
||||||
{
|
{
|
||||||
fBlankTime = system_time();
|
fBlankTime = system_time();
|
||||||
@@ -77,30 +77,30 @@ ScreenSaverApp::ShowPW(void)
|
|||||||
void
|
void
|
||||||
ScreenSaverApp::MessageReceived(BMessage *message)
|
ScreenSaverApp::MessageReceived(BMessage *message)
|
||||||
{
|
{
|
||||||
switch(message->what) {
|
switch(message->what) {
|
||||||
case 'DONE':
|
case UNLOCK_MESSAGE:
|
||||||
if (strcmp(fPww->GetPassword(),fPref.Password())) {
|
if (strcmp(fPww->GetPassword(),fPref.Password())) {
|
||||||
beep();
|
beep();
|
||||||
fPww->Hide();
|
fPww->Hide();
|
||||||
fWin->SetFullScreen(true);
|
fWin->SetFullScreen(true);
|
||||||
if (fThreadID)
|
if (fThreadID)
|
||||||
resume_thread(fThreadID);
|
resume_thread(fThreadID);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printf ("Quitting!\n");
|
printf ("Quitting!\n");
|
||||||
Shutdown();
|
Shutdown();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'MOO1':
|
case 'MOO1':
|
||||||
if (real_time_clock()-fBlankTime>fPref.PasswordTime())
|
if (real_time_clock()-fBlankTime>fPref.PasswordTime())
|
||||||
ShowPW();
|
ShowPW();
|
||||||
else
|
else
|
||||||
Shutdown();
|
Shutdown();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BApplication::MessageReceived(message);
|
BApplication::MessageReceived(message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "SSAwindow.h"
|
#include "SSAwindow.h"
|
||||||
#include "ScreenSaverPrefs.h"
|
#include "ScreenSaverPrefs.h"
|
||||||
#include "ScreenSaverThread.h"
|
#include "ScreenSaverThread.h"
|
||||||
#include "pwWindow.h"
|
#include "PasswordWindow.h"
|
||||||
|
|
||||||
class ScreenSaverApp : public BApplication
|
class ScreenSaverApp : public BApplication
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -69,8 +69,9 @@ ScreenSaverPrefs::LoadSettings()
|
|||||||
fPassword = password;
|
fPassword = password;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return true;
|
||||||
return false;
|
} else
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user