diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-08-02 19:24:07 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-08-02 19:24:07 -0400 |
commit | af947de6928daa70098edb8346effb9dc8146f47 (patch) | |
tree | cb7d34770012bb4e9baf6354645182c9c8451fd9 /indra/newview/scripts | |
parent | 1913ea4ec2f46458e2971e6e02afacf4da670af2 (diff) |
Add 'LLPanelLogin' 'login', 'savedLogins' operations.
'login' accepts optional 'username', 'slurl', 'grid'.
'savedLogins' returns the list of saved usernames in both display form and
internal form.
Make LLPanelLogin::getUserName() accept (const LLPointer<LLCredential>&).
There's a whole separate discussion pending as to whether const LLPointer<T>
should provide access to non-const T methods.
Similarly, make LLCredential::getIdentifier() a const method. These two
changes enable read-only access to credentials.
Make LLPanelLogin methods capture and reuse LLGridManager::instance() as
appropriate.
Add require/login.lua and test_login.lua.
Diffstat (limited to 'indra/newview/scripts')
-rw-r--r-- | indra/newview/scripts/lua/require/login.lua | 21 | ||||
-rw-r--r-- | indra/newview/scripts/lua/test_login.lua | 10 |
2 files changed, 12 insertions, 19 deletions
diff --git a/indra/newview/scripts/lua/require/login.lua b/indra/newview/scripts/lua/require/login.lua index 0d8591cace..f4e65b1606 100644 --- a/indra/newview/scripts/lua/require/login.lua +++ b/indra/newview/scripts/lua/require/login.lua @@ -1,19 +1,12 @@ -local UI = require 'UI' local leap = require 'leap' +local startup = require 'startup' +local mapargs = require 'mapargs' -local function login(username, password) - if username and password then - local userpath = '//username_combo/Combo Text Entry' - local passpath = '//password_edit' - -- first clear anything presently in those text fields - for _, path in pairs({userpath, passpath}) do - UI.click(path) - UI.keypress{keysym='Backsp', path=path} - end - UI.type{path=userpath, text=username} - UI.type{path=passpath, text=password} - end - leap.send('LLPanelLogin', {op='onClickConnect'}) +local function login(...) + startup.wait('STATE_LOGIN_WAIT') + local args = mapargs('username,grid,slurl', ...) + args.op = 'login' + return leap.request('LLPanelLogin', args) end return login diff --git a/indra/newview/scripts/lua/test_login.lua b/indra/newview/scripts/lua/test_login.lua index a8c31807bc..f263940f79 100644 --- a/indra/newview/scripts/lua/test_login.lua +++ b/indra/newview/scripts/lua/test_login.lua @@ -1,7 +1,7 @@ -startup = require 'startup' +inspect = require 'inspect' login = require 'login' -startup.wait('STATE_LOGIN_WAIT') -login() --- Fill in valid credentials as they would be entered on the login screen --- login('My Username', 'password') +print(inspect(login{ + username='Nat Linden', +-- grid='agni' + })) |