Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
652247dc
Commit
652247dc
authored
12 years ago
by
Oz Linden
Browse files
Options
Downloads
Patches
Plain Diff
PATH-805: guard all uses of sInstance in LLPanelLogin
parent
e8f0e006
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/llpanellogin.cpp
+50
-55
50 additions, 55 deletions
indra/newview/llpanellogin.cpp
with
50 additions
and
55 deletions
indra/newview/llpanellogin.cpp
+
50
−
55
View file @
652247dc
...
@@ -405,16 +405,19 @@ void LLPanelLogin::giveFocus()
...
@@ -405,16 +405,19 @@ void LLPanelLogin::giveFocus()
// static
// static
void
LLPanelLogin
::
showLoginWidgets
()
void
LLPanelLogin
::
showLoginWidgets
()
{
{
// *NOTE: Mani - This may or may not be obselete code.
if
(
sInstance
)
// It seems to be part of the defunct? reg-in-client project.
{
sInstance
->
getChildView
(
"login_widgets"
)
->
setVisible
(
true
);
// *NOTE: Mani - This may or may not be obselete code.
LLMediaCtrl
*
web_browser
=
sInstance
->
getChild
<
LLMediaCtrl
>
(
"login_html"
);
// It seems to be part of the defunct? reg-in-client project.
sInstance
->
reshapeBrowser
();
sInstance
->
getChildView
(
"login_widgets"
)
->
setVisible
(
true
);
// *TODO: Append all the usual login parameters, like first_login=Y etc.
LLMediaCtrl
*
web_browser
=
sInstance
->
getChild
<
LLMediaCtrl
>
(
"login_html"
);
std
::
string
splash_screen_url
=
LLGridManager
::
getInstance
()
->
getLoginPage
();
sInstance
->
reshapeBrowser
();
web_browser
->
navigateTo
(
splash_screen_url
,
"text/html"
);
// *TODO: Append all the usual login parameters, like first_login=Y etc.
LLUICtrl
*
username_combo
=
sInstance
->
getChild
<
LLUICtrl
>
(
"username_combo"
);
std
::
string
splash_screen_url
=
LLGridManager
::
getInstance
()
->
getLoginPage
();
username_combo
->
setFocus
(
TRUE
);
web_browser
->
navigateTo
(
splash_screen_url
,
"text/html"
);
LLUICtrl
*
username_combo
=
sInstance
->
getChild
<
LLUICtrl
>
(
"username_combo"
);
username_combo
->
setFocus
(
TRUE
);
}
}
}
// static
// static
...
@@ -691,13 +694,14 @@ void LLPanelLogin::closePanel()
...
@@ -691,13 +694,14 @@ void LLPanelLogin::closePanel()
// static
// static
void
LLPanelLogin
::
setAlwaysRefresh
(
bool
refresh
)
void
LLPanelLogin
::
setAlwaysRefresh
(
bool
refresh
)
{
{
if
(
LLStartUp
::
getStartupState
()
>=
STATE_LOGIN_CLEANUP
)
return
;
if
(
sInstance
&&
LLStartUp
::
getStartupState
()
<
STATE_LOGIN_CLEANUP
)
LLMediaCtrl
*
web_browser
=
sInstance
->
getChild
<
LLMediaCtrl
>
(
"login_html"
);
if
(
web_browser
)
{
{
web_browser
->
setAlwaysRefresh
(
refresh
);
LLMediaCtrl
*
web_browser
=
sInstance
->
getChild
<
LLMediaCtrl
>
(
"login_html"
);
if
(
web_browser
)
{
web_browser
->
setAlwaysRefresh
(
refresh
);
}
}
}
}
}
...
@@ -768,21 +772,6 @@ void LLPanelLogin::loadLoginPage()
...
@@ -768,21 +772,6 @@ void LLPanelLogin::loadLoginPage()
void
LLPanelLogin
::
handleMediaEvent
(
LLPluginClassMedia
*
/*self*/
,
EMediaEvent
event
)
void
LLPanelLogin
::
handleMediaEvent
(
LLPluginClassMedia
*
/*self*/
,
EMediaEvent
event
)
{
{
if
(
event
==
MEDIA_EVENT_NAVIGATE_COMPLETE
)
{
LLMediaCtrl
*
web_browser
=
sInstance
->
getChild
<
LLMediaCtrl
>
(
"login_html"
);
if
(
web_browser
)
{
// *HACK HACK HACK HACK!
/* Stuff a Tab key into the browser now so that the first field will
** get the focus! The embedded javascript on the page that properly
** sets the initial focus in a real web browser is not working inside
** the viewer, so this is an UGLY HACK WORKAROUND for now.
*/
// Commented out as it's not reliable
//web_browser->handleKey(KEY_TAB, MASK_NONE, false);
}
}
}
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
...
@@ -859,7 +848,10 @@ void LLPanelLogin::onClickConnect(void *)
...
@@ -859,7 +848,10 @@ void LLPanelLogin::onClickConnect(void *)
// static
// static
void
LLPanelLogin
::
onClickNewAccount
(
void
*
)
void
LLPanelLogin
::
onClickNewAccount
(
void
*
)
{
{
LLWeb
::
loadURLExternal
(
sInstance
->
getString
(
"create_account_url"
));
if
(
sInstance
)
{
LLWeb
::
loadURLExternal
(
sInstance
->
getString
(
"create_account_url"
));
}
}
}
...
@@ -895,7 +887,7 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
...
@@ -895,7 +887,7 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
This
->
mPasswordModified
=
TRUE
;
This
->
mPasswordModified
=
TRUE
;
if
(
gKeyboard
->
getKeyDown
(
KEY_CAPSLOCK
)
&&
sCapslockDidNotification
==
FALSE
)
if
(
gKeyboard
->
getKeyDown
(
KEY_CAPSLOCK
)
&&
sCapslockDidNotification
==
FALSE
)
{
{
// *TODO: use another way to notify user about enabled caps lock, see EXT-6858
// *TODO: use another way to notify user about enabled caps lock, see EXT-6858
sCapslockDidNotification
=
TRUE
;
sCapslockDidNotification
=
TRUE
;
}
}
}
}
...
@@ -903,33 +895,36 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
...
@@ -903,33 +895,36 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
void
LLPanelLogin
::
updateServer
()
void
LLPanelLogin
::
updateServer
()
{
{
try
if
(
sInstance
)
{
{
// if they've selected another grid, we should load the credentials
try
// for that grid and set them to the UI.
if
(
sInstance
&&
!
sInstance
->
areCredentialFieldsDirty
())
{
{
LLPointer
<
LLCredential
>
credential
=
gSecAPIHandler
->
loadCredential
(
LLGridManager
::
getInstance
()
->
getGrid
());
// if they've selected another grid, we should load the credentials
bool
remember
=
sInstance
->
getChild
<
LLUICtrl
>
(
"remember_check"
)
->
getValue
();
// for that grid and set them to the UI.
sInstance
->
setFields
(
credential
,
remember
);
if
(
!
sInstance
->
areCredentialFieldsDirty
())
}
{
LLPointer
<
LLCredential
>
credential
=
gSecAPIHandler
->
loadCredential
(
LLGridManager
::
getInstance
()
->
getGrid
());
bool
remember
=
sInstance
->
getChild
<
LLUICtrl
>
(
"remember_check"
)
->
getValue
();
sInstance
->
setFields
(
credential
,
remember
);
}
// update the login panel links
// update the login panel links
bool
system_grid
=
LLGridManager
::
getInstance
()
->
isSystemGrid
();
bool
system_grid
=
LLGridManager
::
getInstance
()
->
isSystemGrid
();
sInstance
->
getChildView
(
"create_new_account_text"
)
->
setVisible
(
system_grid
);
sInstance
->
getChildView
(
"create_new_account_text"
)
->
setVisible
(
system_grid
);
sInstance
->
getChildView
(
"forgot_password_text"
)
->
setVisible
(
system_grid
);
sInstance
->
getChildView
(
"forgot_password_text"
)
->
setVisible
(
system_grid
);
// grid changed so show new splash screen (possibly)
// grid changed so show new splash screen (possibly)
loadLoginPage
();
loadLoginPage
();
}
}
catch
(
LLInvalidGridName
ex
)
catch
(
LLInvalidGridName
ex
)
{
{
LL_WARNS
(
"AppInit"
)
<<
"server '"
<<
ex
.
name
()
<<
"' selection failed"
<<
LL_ENDL
;
LL_WARNS
(
"AppInit"
)
<<
"server '"
<<
ex
.
name
()
<<
"' selection failed"
<<
LL_ENDL
;
LLSD
args
;
LLSD
args
;
args
[
"GRID"
]
=
ex
.
name
();
args
[
"GRID"
]
=
ex
.
name
();
LLNotificationsUtil
::
add
(
"InvalidGrid"
,
args
);
LLNotificationsUtil
::
add
(
"InvalidGrid"
,
args
);
return
;
return
;
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment