blob: a060409cb6ac56ef55be827336ce6a953292ee84 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
/*
* AuthenticationController.cpp
* SecondLife
*
* Created by RMS on 7/1/08.
*
*/
#include "llviewerprecompiledheaders.h"
#include "authentication_floater.h"
#include "llviewerobject.h"
#include "llcheckboxctrl.h"
#include "llselectmgr.h"
#include "authentication_controller.h"
// Statics
std::string AuthenticationController::target_grid;
std::string AuthenticationController::username;
std::string AuthenticationController::password;
BOOL AuthenticationController::store_pw = FALSE;
AuthenticationController::AuthenticationController(const std::string& tg, void (*cb)(void*))
{
target_grid = tg;
callback = cb;
}
AuthenticationController::~AuthenticationController()
{
}
// user interface callbacks: all static
void AuthenticationController::onCommitUser(LLUICtrl* ctrl, void* userdata)
{
AuthenticationFloater *floater = (AuthenticationFloater*)userdata;
username = floater->childGetText("User_edit");
}
void AuthenticationController::onCommitPassword(LLUICtrl* ctrl, void* userdata)
{
AuthenticationFloater *floater = (AuthenticationFloater*)userdata;
password = floater->childGetText("Password_edit");
}
void AuthenticationController::onCommitRemember(LLUICtrl* ctrl, void* userdata)
{
LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
if(!object) return;
LLCheckBoxCtrl *check = (LLCheckBoxCtrl*)ctrl;
store_pw = check->get();
}
void AuthenticationController::onAccept(void* userdata)
{
}
void AuthenticationController::onCancel(void* userdata)
{
AuthenticationFloater *floater = (AuthenticationFloater*)userdata;
floater->cancel();
floater->close();
}
void AuthenticationController::onClickRegister(void* userdata)
{
llinfos << "onClickRegister" << llendl;
}
void AuthenticationController::retrieveStoredAccountData(void* userdata)
{
}
// static
std::string AuthenticationController::getTargetGrid()
{
return target_grid;
}
|