summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcallum <none@none>2011-04-22 12:05:30 -0700
committercallum <none@none>2011-04-22 12:05:30 -0700
commita53043e8e2535dbb82c5672259a878664f5036ce (patch)
treef53f9c883deae2ee4547bf13b5a2554d9241503d
parentec43b68b223ce7d1178c2ed3d5e17e4a9c21dc0a (diff)
EXP-738 FIX Login screen background image takes too long to load
Misc improvements to make the login page load properly.
-rw-r--r--indra/newview/llmediactrl.cpp20
-rw-r--r--indra/newview/llpanellogin.cpp170
-rw-r--r--indra/newview/llpanellogin.h2
3 files changed, 15 insertions, 177 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 5007f1c17a..b3ad9efeb2 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -68,7 +68,6 @@ LLMediaCtrl::Params::Params()
: start_url("start_url"),
border_visible("border_visible", true),
ignore_ui_scale("ignore_ui_scale", true),
- hide_loading("hide_loading", false),
decouple_texture_size("decouple_texture_size", false),
texture_width("texture_width", 1024),
texture_height("texture_height", 1024),
@@ -97,8 +96,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
mCurrentNavUrl( "" ),
mStretchToFill( true ),
mMaintainAspectRatio ( true ),
- mHideLoading (false),
- mHidingInitialLoad (false),
mDecoupleTextureSize ( false ),
mTextureWidth ( 1024 ),
mTextureHeight ( 1024 ),
@@ -121,8 +118,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
setBorderVisible(p.border_visible);
- mHideLoading = p.hide_loading;
-
setDecoupleTextureSize(p.decouple_texture_size);
setTextureSize(p.texture_width, p.texture_height);
@@ -684,11 +679,6 @@ bool LLMediaCtrl::ensureMediaSourceExists()
mMediaSource->clearCache();
mClearCache = false;
}
-
- if(mHideLoading)
- {
- mHidingInitialLoad = true;
- }
}
else
{
@@ -756,11 +746,11 @@ void LLMediaCtrl::draw()
}
}
- if(mHidingInitialLoad)
- {
- // If we're hiding loading, don't draw at all.
- draw_media = false;
- }
+// if(mHidingInitialLoad)
+// {
+// // If we're hiding loading, don't draw at all.
+// draw_media = false;
+// }
bool background_visible = isBackgroundVisible();
bool background_opaque = isBackgroundOpaque();
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 7820ac3ecd..a5385b0b1c 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -81,7 +81,6 @@ const S32 MAX_PASSWORD = 16;
LLPanelLogin *LLPanelLogin::sInstance = NULL;
BOOL LLPanelLogin::sCapslockDidNotification = FALSE;
-
class LLLoginRefreshHandler : public LLCommandHandler
{
public:
@@ -97,58 +96,6 @@ public:
}
};
-LLLoginRefreshHandler gLoginRefreshHandler;
-
-
-// helper class that trys to download a URL from a web site and calls a method
-// on parent class indicating if the web server is working or not
-class LLIamHereLogin : public LLHTTPClient::Responder
-{
- private:
- LLIamHereLogin( LLPanelLogin* parent ) :
- mParent( parent )
- {}
-
- LLPanelLogin* mParent;
-
- public:
- static boost::intrusive_ptr< LLIamHereLogin > build( LLPanelLogin* parent )
- {
- return boost::intrusive_ptr< LLIamHereLogin >( new LLIamHereLogin( parent ) );
- };
-
- virtual void setParent( LLPanelLogin* parentIn )
- {
- mParent = parentIn;
- };
-
- // We don't actually expect LLSD back, so need to override completedRaw
- virtual void completedRaw(U32 status, const std::string& reason,
- const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer)
- {
- completed(status, reason, LLSD()); // will call result() or error()
- }
-
- virtual void result( const LLSD& content )
- {
- if ( mParent )
- mParent->setSiteIsAlive( true );
- };
-
- virtual void error( U32 status, const std::string& reason )
- {
- if ( mParent )
- mParent->setSiteIsAlive( false );
- };
-};
-
-// this is global and not a class member to keep crud out of the header file
-namespace {
- boost::intrusive_ptr< LLIamHereLogin > gResponsePtr = 0;
-};
-
-
//---------------------------------------------------------------------------
// Public methods
//---------------------------------------------------------------------------
@@ -160,7 +107,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
mLogoImage(),
mCallback(callback),
mCallbackData(cb_data),
- mHtmlAvailable( TRUE ),
mListener(new LLPanelLoginListener(this))
{
setBackgroundVisible(FALSE);
@@ -190,21 +136,11 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
buildFromFile( "panel_login.xml");
- // Legacy login web page is hidden under the menu bar.
- // Adjust reg-in-client web browser widget to not be hidden.
- if (gSavedSettings.getBOOL("RegInClient"))
- {
- reshape(rect.getWidth(), rect.getHeight() - MENU_BAR_HEIGHT);
- }
- else
- {
- reshape(rect.getWidth(), rect.getHeight());
- }
+ reshape(rect.getWidth(), rect.getHeight());
getChild<LLLineEditor>("password_edit")->setKeystrokeCallback(onPassKey, this);
// change z sort of clickable text to be behind buttons
- //sendChildToBack(getChildView("channel_text"));
sendChildToBack(getChildView("forgot_password_text"));
if(LLStartUp::getStartSLURL().getType() != LLSLURL::LOCATION)
@@ -249,16 +185,10 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
web_browser->addObserver(this);
- // Clear the browser's cache to avoid any potential for the cache messing up the login screen.
- web_browser->clearCache();
-
reshapeBrowser();
- // kick off a request to grab the url manually
- gResponsePtr = LLIamHereLogin::build( this );
-
- LLHTTPClient::head( LLGridManager::getInstance()->getLoginPage(), gResponsePtr );
-
+ loadLoginPage();
+
// Show last logged in user favorites in "Start at" combo.
addUsersWithFavoritesToUsername();
getChild<LLComboBox>("username_combo")->setTextChangedCallback(boost::bind(&LLPanelLogin::addFavoritesToStartLocation, this));
@@ -334,46 +264,10 @@ void LLPanelLogin::reshapeBrowser()
reshape( rect.getWidth(), rect.getHeight(), 1 );
}
-void LLPanelLogin::setSiteIsAlive( bool alive )
-{
- LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
- // if the contents of the site was retrieved
- if ( alive )
- {
- if ( web_browser )
- {
- loadLoginPage();
-
- // mark as available
- mHtmlAvailable = TRUE;
- }
- }
- else
- // the site is not available (missing page, server down, other badness)
- {
- if ( web_browser )
- {
- // hide browser control (revealing default one)
- web_browser->setVisible( FALSE );
-
- // mark as unavailable
- mHtmlAvailable = FALSE;
- }
- }
-}
-
-
LLPanelLogin::~LLPanelLogin()
{
LLPanelLogin::sInstance = NULL;
- // tell the responder we're not here anymore
- if ( gResponsePtr )
- gResponsePtr->setParent( 0 );
-
- //// We know we're done with the image, so be rid of it.
- //gTextureList.deleteImage( mLogoImage );
-
// Controls having keyboard focus by default
// must reset it on destroy. (EXT-2748)
gFocusMgr.setDefaultKeyboardFocus(NULL);
@@ -396,22 +290,13 @@ void LLPanelLogin::draw()
S32 width = getRect().getWidth();
S32 height = getRect().getHeight();
- if ( mHtmlAvailable )
- {
- if (getChild<LLView>("login_widgets")->getVisible())
- {
- // draw a background box in black
- gl_rect_2d( 0, height - 264, width, 264, LLColor4::black );
- // draw the bottom part of the background image
- // just the blue background to the native client UI
- mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight());
- }
- }
- else
+ if (getChild<LLView>("login_widgets")->getVisible())
{
- // the HTML login page is not available so default to the original screen
- S32 offscreen_part = height / 3;
- mLogoImage->draw(0, -offscreen_part, width, height+offscreen_part);
+ // draw a background box in black
+ gl_rect_2d( 0, height - 264, width, 264, LLColor4::black );
+ // draw the bottom part of the background image
+ // just the blue background to the native client UI
+ mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight());
};
}
glPopMatrix();
@@ -870,23 +755,10 @@ void LLPanelLogin::loadLoginPage()
oStr << "&os=" << os_info;
curl_free(os_info);
-
gViewerWindow->setMenuBackgroundColor(false, !LLGridManager::getInstance()->isInProductionGrid());
- gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
-
- // navigate to the "real" page
- if (gSavedSettings.getBOOL("RegInClient"))
- {
- web_browser->setFocus(TRUE);
- login_page = sInstance->getString("reg_in_client_url");
- web_browser->navigateTo(login_page, "text/html");
- }
- else
- {
- web_browser->navigateTo( oStr.str(), "text/html" );
- }
+ web_browser->navigateTo( oStr.str(), "text/html" );
}
void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event)
@@ -917,10 +789,6 @@ void LLPanelLogin::onClickConnect(void *)
{
if (sInstance && sInstance->mCallback)
{
- // tell the responder we're not here anymore
- if ( gResponsePtr )
- gResponsePtr->setParent( 0 );
-
// JC - Make sure the fields all get committed.
sInstance->setFocus(FALSE);
@@ -988,24 +856,6 @@ void LLPanelLogin::onClickConnect(void *)
}
}
-/*
-// static
-bool LLPanelLogin::newAccountAlertCallback(const LLSD& notification, const LLSD& response)
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- if (0 == option)
- {
- llinfos << "Going to account creation URL" << llendl;
- LLWeb::loadURLExternal( LLNotifications::instance().getGlobalString("CREATE_ACCOUNT_URL"));
- }
- else
- {
- sInstance->setFocus(TRUE);
- }
- return false;
-}
-*/
-
// static
void LLPanelLogin::onClickNewAccount(void*)
{
diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h
index 9cc5e3456a..11273453ba 100644
--- a/indra/newview/llpanellogin.h
+++ b/indra/newview/llpanellogin.h
@@ -89,7 +89,6 @@ private:
void addUsersWithFavoritesToUsername();
static void onClickConnect(void*);
static void onClickNewAccount(void*);
-// static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response);
static void onClickVersion(void*);
static void onClickForgotPassword(void*);
static void onClickHelp(void*);
@@ -114,7 +113,6 @@ private:
static LLPanelLogin* sInstance;
static BOOL sCapslockDidNotification;
- BOOL mHtmlAvailable;
};
std::string load_password_from_disk(void);