more fixes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13975 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
|
#include <StringView.h>
|
||||||
#include "PasswordWindow.h"
|
#include "PasswordWindow.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -22,10 +23,11 @@ PasswordWindow::Setup()
|
|||||||
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");
|
BStringView *label = new BStringView(BRect(0,0,60,15), "labelView", "Unlock screen saver");
|
||||||
|
fCustomBox->SetLabel(label);
|
||||||
fBgd->AddChild(fCustomBox);
|
fBgd->AddChild(fCustomBox);
|
||||||
|
|
||||||
fPassword = new BTextControl(BRect(10,28,255,47),"pwdCntrl","Enter password:", NULL, B_FOLLOW_NONE);
|
fPassword = new BTextControl(BRect(10,28,260,47),"pwdCntrl","Enter password:", NULL, B_FOLLOW_NONE);
|
||||||
fPassword->TextView()->HideTyping(true);
|
fPassword->TextView()->HideTyping(true);
|
||||||
fPassword->SetDivider(100);
|
fPassword->SetDivider(100);
|
||||||
fCustomBox->AddChild(fPassword);
|
fCustomBox->AddChild(fPassword);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class PasswordWindow : public BWindow
|
|||||||
B_ALL_WORKSPACES), fDie(false) { Setup(); }
|
B_ALL_WORKSPACES), fDie(false) { Setup(); }
|
||||||
void Setup(void);
|
void Setup(void);
|
||||||
const char *GetPassword(void) {return fPassword->Text();}
|
const char *GetPassword(void) {return fPassword->Text();}
|
||||||
|
void SetPassword(const char* text) { Lock(); fPassword->SetText(text); Unlock(); }
|
||||||
|
|
||||||
bool fDie;
|
bool fDie;
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -86,17 +86,13 @@ ScreenSaverApp::MessageReceived(BMessage *message)
|
|||||||
{
|
{
|
||||||
char salt[3] = "";
|
char salt[3] = "";
|
||||||
strncpy(salt, fPref.Password(), 2);
|
strncpy(salt, fPref.Password(), 2);
|
||||||
if (strcmp(crypt(fPww->GetPassword(), salt),fPref.Password())) {
|
if (strcmp(crypt(fPww->GetPassword(), salt),fPref.Password()) != 0) {
|
||||||
beep();
|
beep();
|
||||||
fPww->Hide();
|
fPww->SetPassword("");
|
||||||
fWin->SetFullScreen(true);
|
} else {
|
||||||
if (fThreadID)
|
PRINT(("Quitting!\n"));
|
||||||
resume_thread(fThreadID);
|
Shutdown();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
PRINT(("Quitting!\n"));
|
|
||||||
Shutdown();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -109,7 +105,7 @@ ScreenSaverApp::MessageReceived(BMessage *message)
|
|||||||
bool
|
bool
|
||||||
ScreenSaverApp::QuitRequested()
|
ScreenSaverApp::QuitRequested()
|
||||||
{
|
{
|
||||||
if (system_time()-fBlankTime>fPref.PasswordTime()) {
|
if (system_time()-fBlankTime > fPref.PasswordTime()) {
|
||||||
ShowPW();
|
ShowPW();
|
||||||
return false;
|
return false;
|
||||||
} else
|
} else
|
||||||
|
|||||||
Reference in New Issue
Block a user