fixed network password
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14100 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -39,8 +39,8 @@ PasswordWindow::Setup()
|
|||||||
owner->AddChild(fUseNetwork);
|
owner->AddChild(fUseNetwork);
|
||||||
fUseCustom=new BRadioButton(BRect(30,50,130,60),"fUseCustom","Use custom password",new BMessage(kButton_changed),B_FOLLOW_NONE);
|
fUseCustom=new BRadioButton(BRect(30,50,130,60),"fUseCustom","Use custom password",new BMessage(kButton_changed),B_FOLLOW_NONE);
|
||||||
|
|
||||||
fCustomBox=new BBox(BRect(9,30,269,105),"custBeBox",B_FOLLOW_NONE);
|
BBox *customBox=new BBox(BRect(9,30,269,105),"custBeBox",B_FOLLOW_NONE);
|
||||||
fCustomBox->SetLabel(fUseCustom);
|
customBox->SetLabel(fUseCustom);
|
||||||
fPassword=new BTextControl(BRect(10,20,251,35),"pwdCntrl","Password:",NULL,B_FOLLOW_NONE);
|
fPassword=new BTextControl(BRect(10,20,251,35),"pwdCntrl","Password:",NULL,B_FOLLOW_NONE);
|
||||||
fConfirm=new BTextControl(BRect(10,45,251,60),"fConfirmCntrl","Confirm password:",NULL,B_FOLLOW_NONE);
|
fConfirm=new BTextControl(BRect(10,45,251,60),"fConfirmCntrl","Confirm password:",NULL,B_FOLLOW_NONE);
|
||||||
fPassword->SetAlignment(B_ALIGN_RIGHT,B_ALIGN_LEFT);
|
fPassword->SetAlignment(B_ALIGN_RIGHT,B_ALIGN_LEFT);
|
||||||
@@ -50,9 +50,9 @@ PasswordWindow::Setup()
|
|||||||
fConfirm->SetAlignment(B_ALIGN_RIGHT,B_ALIGN_LEFT);
|
fConfirm->SetAlignment(B_ALIGN_RIGHT,B_ALIGN_LEFT);
|
||||||
fConfirm->SetDivider(divider);
|
fConfirm->SetDivider(divider);
|
||||||
fConfirm->TextView()->HideTyping(true);
|
fConfirm->TextView()->HideTyping(true);
|
||||||
fCustomBox->AddChild(fPassword);
|
customBox->AddChild(fPassword);
|
||||||
fCustomBox->AddChild(fConfirm);
|
customBox->AddChild(fConfirm);
|
||||||
owner->AddChild(fCustomBox);
|
owner->AddChild(customBox);
|
||||||
|
|
||||||
fDone = new BButton(BRect(194,118,269,129),"done","Done",new BMessage (kDone_clicked),B_FOLLOW_NONE);
|
fDone = new BButton(BRect(194,118,269,129),"done","Done",new BMessage (kDone_clicked),B_FOLLOW_NONE);
|
||||||
fCancel = new BButton(BRect(109,118,184,129),"cancel","Cancel",new BMessage (kCancel_clicked),B_FOLLOW_NONE);
|
fCancel = new BButton(BRect(109,118,184,129),"cancel","Cancel",new BMessage (kCancel_clicked),B_FOLLOW_NONE);
|
||||||
@@ -66,13 +66,13 @@ PasswordWindow::Setup()
|
|||||||
void
|
void
|
||||||
PasswordWindow::Update()
|
PasswordWindow::Update()
|
||||||
{
|
{
|
||||||
if (strcmp(fPrefs.LockMethod(), "custom") == 0)
|
if (fPrefs.IsNetworkPassword())
|
||||||
fUseCustom->SetValue(B_CONTROL_ON);
|
|
||||||
else
|
|
||||||
fUseNetwork->SetValue(B_CONTROL_ON);
|
fUseNetwork->SetValue(B_CONTROL_ON);
|
||||||
fUseNetPassword=(fUseCustom->Value()>0);
|
else
|
||||||
fConfirm->SetEnabled(fUseNetPassword);
|
fUseCustom->SetValue(B_CONTROL_ON);
|
||||||
fPassword->SetEnabled(fUseNetPassword);
|
bool useNetPassword=(fUseCustom->Value()>0);
|
||||||
|
fConfirm->SetEnabled(useNetPassword);
|
||||||
|
fPassword->SetEnabled(useNetPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -102,6 +102,7 @@ PasswordWindow::MessageReceived(BMessage *message)
|
|||||||
Hide();
|
Hide();
|
||||||
break;
|
break;
|
||||||
case kButton_changed:
|
case kButton_changed:
|
||||||
|
fPrefs.SetLockMethod(fUseCustom->Value()>0 ? "custom" : "network");
|
||||||
Update();
|
Update();
|
||||||
break;
|
break;
|
||||||
case kShow:
|
case kShow:
|
||||||
|
|||||||
@@ -28,11 +28,9 @@ class PasswordWindow : public BWindow
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
BRadioButton *fUseNetwork,*fUseCustom;
|
BRadioButton *fUseNetwork,*fUseCustom;
|
||||||
BBox *fCustomBox;
|
|
||||||
BTextControl *fPassword,*fConfirm;
|
BTextControl *fPassword,*fConfirm;
|
||||||
BButton *fCancel,*fDone;
|
BButton *fCancel,*fDone;
|
||||||
BString fThePassword;
|
BString fThePassword;
|
||||||
bool fUseNetPassword;
|
|
||||||
ScreenSaverPrefs &fPrefs;
|
ScreenSaverPrefs &fPrefs;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user