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 : 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
@@ -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:
+3 -3
View File
@@ -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();
@@ -78,7 +78,7 @@ 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();
+1 -1
View File
@@ -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
{ {
+2 -1
View File
@@ -69,7 +69,8 @@ ScreenSaverPrefs::LoadSettings()
fPassword = password; fPassword = password;
} }
} }
} return true;
} else
return false; return false;
} }