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:
Jérôme Duval
2005-08-02 09:57:45 +00:00
parent 143f3a8060
commit bef4185e93
6 changed files with 39 additions and 32 deletions
+5 -1
View File
@@ -5,7 +5,11 @@ UsePrivateHeaders screen_saver ;
BinCommand screen_blanker :
ScreenSaverApp.cpp
SSAwindow.cpp
pwWindow.cpp
PasswordWindow.cpp
ScreenSaver.cpp
: be game libscreensaver.so
;
SEARCH on [ FGristFiles
ScreenSaver.cpp
] = [ FDirName $(OBOS_TOP) src kits screensaver ] ;
@@ -5,7 +5,7 @@
#include <Application.h>
#include <Screen.h>
#include "pwWindow.h"
#include "PasswordWindow.h"
void
@@ -21,7 +21,7 @@ PasswordWindow::Setup()
BRect bounds(fBgd->Bounds());
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");
fBgd->AddChild(fCustomBox);
@@ -29,7 +29,7 @@ PasswordWindow::Setup()
fPassword->SetDivider(100);
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);
fCustomBox->AddChild(fUnlock);
fUnlock->MakeDefault(true);
@@ -10,6 +10,8 @@
#include <TextControl.h>
#include <Button.h>
const int32 UNLOCK_MESSAGE = 'ULMS';
class PasswordWindow : public BWindow
{
public:
+25 -25
View File
@@ -14,7 +14,7 @@
#include <string.h>
#include <Beep.h>
#include <ScreenSaverApp.h>
#include "ScreenSaverApp.h"
// 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.
ScreenSaverApp::ScreenSaverApp()
: BApplication("application/x-vnd.OBOS-ScreenSaverApp"),
: BApplication(SCREEN_BLANKER_SIG),
fWin(NULL)
{
fBlankTime = system_time();
@@ -77,30 +77,30 @@ ScreenSaverApp::ShowPW(void)
void
ScreenSaverApp::MessageReceived(BMessage *message)
{
switch(message->what) {
case 'DONE':
if (strcmp(fPww->GetPassword(),fPref.Password())) {
beep();
fPww->Hide();
fWin->SetFullScreen(true);
if (fThreadID)
resume_thread(fThreadID);
}
else {
printf ("Quitting!\n");
Shutdown();
}
break;
case 'MOO1':
if (real_time_clock()-fBlankTime>fPref.PasswordTime())
ShowPW();
else
switch(message->what) {
case UNLOCK_MESSAGE:
if (strcmp(fPww->GetPassword(),fPref.Password())) {
beep();
fPww->Hide();
fWin->SetFullScreen(true);
if (fThreadID)
resume_thread(fThreadID);
}
else {
printf ("Quitting!\n");
Shutdown();
}
break;
case 'MOO1':
if (real_time_clock()-fBlankTime>fPref.PasswordTime())
ShowPW();
else
Shutdown();
break;
default:
BApplication::MessageReceived(message);
break;
}
break;
default:
BApplication::MessageReceived(message);
break;
}
}
+1 -1
View File
@@ -10,7 +10,7 @@
#include "SSAwindow.h"
#include "ScreenSaverPrefs.h"
#include "ScreenSaverThread.h"
#include "pwWindow.h"
#include "PasswordWindow.h"
class ScreenSaverApp : public BApplication
{
+3 -2
View File
@@ -69,8 +69,9 @@ ScreenSaverPrefs::LoadSettings()
fPassword = password;
}
}
}
return false;
return true;
} else
return false;
}