From b6b586e4b5ead83b69ae28a4b97d37661a75fe31 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 13 May 2016 17:00:39 +0200 Subject: [PATCH 01/19] FIRE-18295: Region eventually gets spammed with MapBlockRequest messages --- indra/newview/llworldmap.cpp | 32 +++++++++++++++----------------- indra/newview/llworldmap.h | 4 ++-- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 7ccf03f7f4..7bc94105d3 100755 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -256,8 +256,7 @@ LLWorldMap::LLWorldMap() : mIsTrackingDoubleClick( false ), mIsTrackingCommit( false ), mTrackingLocation( 0, 0, 0 ), - mFirstRequest(true), - mMapBlockLastUpdate(0.0) // Periodically update sim info + mFirstRequest(true) { //LL_INFOS("World Map") << "Creating the World Map -> LLWorldMap::LLWorldMap()" << LL_ENDL; mMapBlockLoaded = new bool[MAP_BLOCK_RES*MAP_BLOCK_RES]; @@ -332,7 +331,6 @@ void LLWorldMap::clearSimFlags() { mMapBlockLoaded[idx] = false; // Periodically update sim info - mMapBlockLastUpdate = 0.0; mMapBlockLastUpdateOffsets.clear(); // } @@ -662,9 +660,19 @@ void LLWorldMap::updateRegions(S32 x0, S32 y0, S32 x1, S32 y1) y1 = y1 / MAP_BLOCK_SIZE; // Periodically update sim info - std::set new_offsets; - bool did_update = false; + block_last_update_map_t new_offsets; F64 time_now = LLTimer::getElapsedSeconds(); + + // Remove blocks that have been request more than BLOCK_UPDATE_TIMER ago + // so we re-request them for an update + for (block_last_update_map_t::iterator it = mMapBlockLastUpdateOffsets.begin(); it != mMapBlockLastUpdateOffsets.end(); ++it) + { + if ((time_now - it->second) <= BLOCK_UPDATE_TIMER) + { + new_offsets[it->first] = it->second; + } + } + mMapBlockLastUpdateOffsets.swap(new_offsets); // // Load the region info those blocks @@ -675,27 +683,17 @@ void LLWorldMap::updateRegions(S32 x0, S32 y0, S32 x1, S32 y1) S32 offset = block_x | (block_y * MAP_BLOCK_RES); // Periodically update sim info //if (!mMapBlockLoaded[offset]) - if (!mMapBlockLoaded[offset] || (time_now - mMapBlockLastUpdate) > BLOCK_UPDATE_TIMER || mMapBlockLastUpdateOffsets.find(offset) == mMapBlockLastUpdateOffsets.end()) + if (!mMapBlockLoaded[offset] || mMapBlockLastUpdateOffsets.find(offset) == mMapBlockLastUpdateOffsets.end()) // { //LL_INFOS("World Map") << "Loading Block (" << block_x << "," << block_y << ")" << LL_ENDL; LLWorldMapMessage::getInstance()->sendMapBlockRequest(block_x * MAP_BLOCK_SIZE, block_y * MAP_BLOCK_SIZE, (block_x * MAP_BLOCK_SIZE) + MAP_BLOCK_SIZE - 1, (block_y * MAP_BLOCK_SIZE) + MAP_BLOCK_SIZE - 1); mMapBlockLoaded[offset] = true; // Periodically update sim info - new_offsets.insert(offset); - did_update = true; - // + mMapBlockLastUpdateOffsets[offset] = time_now; } } } - - // Periodically update sim info - if (did_update) - { - mMapBlockLastUpdate = time_now; - mMapBlockLastUpdateOffsets.swap(new_offsets); - } - // } void LLWorldMap::dump() diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index 25d3d7dd61..9aee81bb23 100755 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -294,8 +294,8 @@ private: bool * mMapBlockLoaded; // Telling us if the block of regions has been requested or not // Periodically update sim info - F64 mMapBlockLastUpdate; - std::set mMapBlockLastUpdateOffsets; + typedef std::map block_last_update_map_t; + block_last_update_map_t mMapBlockLastUpdateOffsets; // Track location data : used while there's nothing tracked yet by LLTracker bool mIsTrackingLocation; // True when we're tracking a point From 632b420dcf6834e41dc53fa5df83d997b8326b04 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 13 May 2016 18:33:22 +0200 Subject: [PATCH 02/19] FIRE-18296: Expose PieMenuPopupFontEffect in Prefs (User Interface -> 2D Overlay -> Enable text animation) --- .../skins/default/xui/de/panel_preferences_UI.xml | 1 + .../skins/default/xui/en/panel_preferences_UI.xml | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/de/panel_preferences_UI.xml b/indra/newview/skins/default/xui/de/panel_preferences_UI.xml index 37dde49f18..49a9708591 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_UI.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_UI.xml @@ -59,6 +59,7 @@ + (Erfordert Neustart) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_UI.xml b/indra/newview/skins/default/xui/en/panel_preferences_UI.xml index db59781025..186a780725 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_UI.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_UI.xml @@ -397,13 +397,23 @@ + Date: Wed, 20 Apr 2016 14:50:21 +0200 Subject: [PATCH 03/19] Version blocking done right --- indra/newview/fspanellogin.cpp | 76 +++++++++++++++------------------- indra/newview/llstartup.cpp | 11 +++++ 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index 6dc2eb0d12..e5dd49ced4 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -943,52 +943,44 @@ void FSPanelLogin::onClickConnect(void *) std::string password = sInstance->getChild("password_edit")->getValue().asString(); gSavedSettings.setString("UserLoginInfo", credentialName()); - LLSD blocked = FSData::instance().allowedLogin(); - if (!blocked.isMap()) //hack for testing for an empty LLSD + if(username.empty()) { - if(username.empty()) - { - // user must type in something into the username field - LLNotificationsUtil::add("MustHaveAccountToLogIn"); - } - else if(password.empty()) - { - LLNotificationsUtil::add("MustEnterPasswordToLogIn"); - } - else - { - LLPointer cred; - BOOL remember; - getFields(cred, remember); - std::string identifier_type; - cred->identifierType(identifier_type); - LLSD allowed_credential_types; - LLGridManager::getInstance()->getLoginIdentifierTypes(allowed_credential_types); - - // check the typed in credential type against the credential types expected by the server. - for(LLSD::array_iterator i = allowed_credential_types.beginArray(); - i != allowed_credential_types.endArray(); - i++) - { - - if(i->asString() == identifier_type) - { - // yay correct credential type - sInstance->mCallback(0, sInstance->mCallbackData); - return; - } - } - - // Right now, maingrid is the only thing that is picky about - // credential format, as it doesn't yet allow account (single username) - // format creds. - Rox. James, we wanna fix the message when we change - // this. - LLNotificationsUtil::add("InvalidCredentialFormat"); - } + // user must type in something into the username field + LLNotificationsUtil::add("MustHaveAccountToLogIn"); + } + else if(password.empty()) + { + LLNotificationsUtil::add("MustEnterPasswordToLogIn"); } else { - LLNotificationsUtil::add("BlockLoginInfo", blocked); + LLPointer cred; + BOOL remember; + getFields(cred, remember); + std::string identifier_type; + cred->identifierType(identifier_type); + LLSD allowed_credential_types; + LLGridManager::getInstance()->getLoginIdentifierTypes(allowed_credential_types); + + // check the typed in credential type against the credential types expected by the server. + for(LLSD::array_iterator i = allowed_credential_types.beginArray(); + i != allowed_credential_types.endArray(); + i++) + { + + if(i->asString() == identifier_type) + { + // yay correct credential type + sInstance->mCallback(0, sInstance->mCallbackData); + return; + } + } + + // Right now, maingrid is the only thing that is picky about + // credential format, as it doesn't yet allow account (single username) + // format creds. - Rox. James, we wanna fix the message when we change + // this. + LLNotificationsUtil::add("InvalidCredentialFormat"); } } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index dc0e790bdd..e11e5fca65 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1185,6 +1185,17 @@ bool idle_startup() if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState()) { + // Login block + LLSD blocked = FSData::instance().allowedLogin(); + if (blocked.isMap()) //hack for testing for an empty LLSD + { + LLNotificationsUtil::add("BlockLoginInfo", blocked, LLSD(), login_alert_done); + LLStartUp::setStartupState(STATE_LOGIN_CONFIRM_NOTIFICATON); + show_connect_box = true; + return FALSE; + } + // + // Post login screen, we should see if any settings have changed that may // require us to either start/stop or change the socks proxy. As various communications // past this point may require the proxy to be up. From b376d3c079ceca1c05461a40fa1424600eb46607 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 20 Apr 2016 16:33:30 +0200 Subject: [PATCH 04/19] What is this junk? Dump some old crappy custom resize code for the login panel --- indra/newview/fspanellogin.cpp | 68 +------------------ indra/newview/fspanellogin.h | 5 -- .../skins/default/xui/en/panel_fs_login.xml | 24 +++---- 3 files changed, 13 insertions(+), 84 deletions(-) diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index e5dd49ced4..846e851403 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -79,7 +79,6 @@ #include "llsdserialize.h" -const S32 BLACK_BORDER_HEIGHT = 160; const S32 MAX_PASSWORD_SL = 16; const S32 MAX_PASSWORD_OPENSIM = 255; @@ -179,7 +178,6 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, void (*callback)(S32 option, void* user_data), void *cb_data) : LLPanel(), - mLogoImage(), mCallback(callback), mCallbackData(cb_data), mShowFavorites(false) @@ -196,9 +194,6 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, login_holder->addChild(this); } - // Logo - mLogoImage = LLUI::getUIImage("startup_logo"); - buildFromFile( "panel_fs_login.xml"); reshape(rect.getWidth(), rect.getHeight()); @@ -251,8 +246,6 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, LLMediaCtrl* web_browser = getChild("login_html"); web_browser->addObserver(this); - reshapeBrowser(); - // Show last logged in user favorites in "Start at" combo. LLComboBox* username_combo(getChild("username_combo")); username_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectUser, this)); @@ -351,21 +344,6 @@ void FSPanelLogin::addFavoritesToStartLocation() LLFloaterPreference::updateShowFavoritesCheckbox(mShowFavorites); } -// force the size to be correct (XML doesn't seem to be sufficient to do this) -// (with some padding so the other login screen doesn't show through) -void FSPanelLogin::reshapeBrowser() -{ - LLMediaCtrl* web_browser = getChild("login_html"); - LLRect rect = gViewerWindow->getWindowRectScaled(); - LLRect html_rect; - html_rect.setCenterAndSize( - rect.getCenterX() - 2, rect.getCenterY() + 40, - rect.getWidth() + 6, rect.getHeight() - 78 ); - web_browser->setRect( html_rect ); - web_browser->reshape( html_rect.getWidth(), html_rect.getHeight(), TRUE ); - reshape( rect.getWidth(), rect.getHeight(), 1 ); -} - FSPanelLogin::~FSPanelLogin() { FSPanelLogin::sInstance = NULL; @@ -375,50 +353,6 @@ FSPanelLogin::~FSPanelLogin() gFocusMgr.setDefaultKeyboardFocus(NULL); } -// virtual -void FSPanelLogin::draw() -{ - gGL.pushMatrix(); - { - F32 image_aspect = 1.333333f; - F32 view_aspect = (F32)getRect().getWidth() / (F32)getRect().getHeight(); - // stretch image to maintain aspect ratio - if (image_aspect > view_aspect) - { - gGL.translatef(-0.5f * (image_aspect / view_aspect - 1.f) * getRect().getWidth(), 0.f, 0.f); - gGL.scalef(image_aspect / view_aspect, 1.f, 1.f); - } - - S32 width = getRect().getWidth(); - S32 height = getRect().getHeight(); - - if (getChild("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()); - }; - } - gGL.popMatrix(); - - LLPanel::draw(); -} - -// virtual -BOOL FSPanelLogin::handleKeyHere(KEY key, MASK mask) -{ - if ( KEY_F1 == key ) - { - LLViewerHelp* vhelp = LLViewerHelp::getInstance(); - vhelp->showTopic(vhelp->f1HelpTopic()); - return TRUE; - } - - return LLPanel::handleKeyHere(key, mask); -} - // virtual void FSPanelLogin::setFocus(BOOL b) { @@ -483,7 +417,7 @@ void FSPanelLogin::showLoginWidgets() // It seems to be part of the defunct? reg-in-client project. sInstance->getChildView("login_widgets")->setVisible( true); LLMediaCtrl* web_browser = sInstance->getChild("login_html"); - sInstance->reshapeBrowser(); + // *TODO: Append all the usual login parameters, like first_login=Y etc. std::string splash_screen_url = LLGridManager::getInstance()->getLoginPage(); web_browser->navigateTo( splash_screen_url, HTTP_CONTENT_TEXT_HTML ); diff --git a/indra/newview/fspanellogin.h b/indra/newview/fspanellogin.h index 420b56f5ff..c653963d2a 100644 --- a/indra/newview/fspanellogin.h +++ b/indra/newview/fspanellogin.h @@ -51,8 +51,6 @@ public: void *callback_data); ~FSPanelLogin(); - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual void draw(); virtual void setFocus( BOOL b ); // Show the XUI first name, last name, and password widgets. They are @@ -96,7 +94,6 @@ public: private: friend class LLPanelLoginListener; - void reshapeBrowser(); void addFavoritesToStartLocation(); void addUsersToCombo(BOOL show_server); void onSelectUser(); @@ -119,8 +116,6 @@ private: static std::string credentialName(); private: - LLPointer mLogoImage; - void (*mCallback)(S32 option, void *userdata); void* mCallbackData; diff --git a/indra/newview/skins/default/xui/en/panel_fs_login.xml b/indra/newview/skins/default/xui/en/panel_fs_login.xml index 49ef145546..fb2ce65eaf 100644 --- a/indra/newview/skins/default/xui/en/panel_fs_login.xml +++ b/indra/newview/skins/default/xui/en/panel_fs_login.xml @@ -1,13 +1,15 @@ + background_visible="true" + bg_opaque_color="0.16 0.16 0.16 1" + background_opaque="true" + width="1024"> http://phoenixviewer.com/app/loginV3/ @@ -19,20 +21,18 @@ name="forgot_password_url"> http://secondlife.com/account/request.php - + top="18" + height="670" + width="1024" /> Date: Wed, 20 Apr 2016 17:20:26 +0200 Subject: [PATCH 05/19] Sync'ing the login panel --- indra/newview/fspanellogin.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index 846e851403..193495ddad 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -431,17 +431,10 @@ void FSPanelLogin::show(const LLRect &rect, void (*callback)(S32 option, void* user_data), void* callback_data) { - // instance management - if (FSPanelLogin::sInstance) - { - LL_WARNS("AppInit") << "Duplicate instance of login view deleted" << LL_ENDL; - // Don't leave bad pointer in gFocusMgr - gFocusMgr.setDefaultKeyboardFocus(NULL); - - delete FSPanelLogin::sInstance; - } - - new FSPanelLogin(rect, callback, callback_data); + if (!FSPanelLogin::sInstance) + { + new FSPanelLogin(rect, callback, callback_data); + } if( !gFocusMgr.getKeyboardFocus() ) { @@ -825,6 +818,9 @@ void FSPanelLogin::loadLoginPage() // sourceid params["sourceid"] = gSavedSettings.getString("sourceid"); + // login page (web) content version + params["login_content_version"] = gSavedSettings.getString("LoginContentVersion"); + // Make an LLURI with this augmented info LLURI login_uri(LLURI::buildHTTP(login_page.authority(), login_page.path(), @@ -973,8 +969,8 @@ void FSPanelLogin::onClickHelp(void*) // static void FSPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) { - FSPanelLogin *This = (FSPanelLogin *) user_data; - This->mPasswordModified = TRUE; + FSPanelLogin *self = (FSPanelLogin *)user_data; + self->mPasswordModified = TRUE; if (gKeyboard->getKeyDown(KEY_CAPSLOCK) && sCapslockDidNotification == FALSE) { // *TODO: use another way to notify user about enabled caps lock, see EXT-6858 From 377a83bd92769d4c0bb27b91e77a57b6d0a26943 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 21 Apr 2016 10:36:33 +0200 Subject: [PATCH 06/19] More hammering on the login page --- indra/newview/fspanellogin.cpp | 192 +++++++++++------- indra/newview/fspanellogin.h | 24 +-- indra/newview/llloginhandler.cpp | 29 --- .../skins/default/xui/en/panel_fs_login.xml | 2 +- .../starlightcui/xui/en/panel_fs_login.xml | 32 +-- 5 files changed, 145 insertions(+), 134 deletions(-) diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index 193495ddad..7827c66459 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -180,6 +180,9 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, : LLPanel(), mCallback(callback), mCallbackData(cb_data), + mUsernameLength(0), + mPasswordLength(0), + mLocationLength(0), mShowFavorites(false) { setBackgroundVisible(FALSE); @@ -208,13 +211,13 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, // change z sort of clickable text to be behind buttons sendChildToBack(getChildView("forgot_password_text")); - LLComboBox* location_combo = getChild("start_location_combo"); + LLComboBox* favorites_combo = getChild("start_location_combo"); updateLocationSelectorsVisibility(); // separate so that it can be called from preferences - location_combo->setFocusLostCallback(boost::bind(&FSPanelLogin::onLocationSLURL, this)); + favorites_combo->setFocusLostCallback(boost::bind(&FSPanelLogin::onLocationSLURL, this)); LLComboBox* server_choice_combo = getChild("server_combo"); server_choice_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectServer, this)); - + updateServer(); if(LLStartUp::getStartSLURL().getType() != LLSLURL::LOCATION) { @@ -222,42 +225,18 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, LLStartUp::setStartSLURL(slurl); } - childSetAction("remove_user_btn", onClickRemove, this); - childSetAction("connect_btn", onClickConnect, this); - - getChild("login")->setDefaultBtn(findChild("connect_btn")); - getChild("start_location_panel")->setDefaultBtn(findChild("connect_btn")); - - std::string channel = LLVersionInfo::getChannel(); - std::string version = llformat("%s (%d)", - LLVersionInfo::getShortVersion().c_str(), - LLVersionInfo::getBuild()); - - LLTextBox* forgot_password_text = getChild("forgot_password_text"); - forgot_password_text->setClickedCallback(onClickForgotPassword, NULL); - LLTextBox* create_new_account_text = getChild("create_new_account_text"); create_new_account_text->setClickedCallback(onClickNewAccount, NULL); LLTextBox* grid_mgr_help_text = getChild("grid_login_text"); grid_mgr_help_text->setClickedCallback(onClickGridMgrHelp, NULL); - - // get the web browser control - LLMediaCtrl* web_browser = getChild("login_html"); - web_browser->addObserver(this); - - // Show last logged in user favorites in "Start at" combo. - LLComboBox* username_combo(getChild("username_combo")); - username_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectUser, this)); - username_combo->setFocusLostCallback(boost::bind(&FSPanelLogin::onSelectUser, this)); - mPreviousUsername = username_combo->getValue().asString(); LLSLURL start_slurl(LLStartUp::getStartSLURL()); - if ( !start_slurl.isSpatial() ) // has a start been established by the command line or NextLoginLocation ? + if ( !start_slurl.isSpatial() ) // has a start been established by the command line or NextLoginLocation ? { - // no, so get the preference setting + // no, so get the preference setting std::string defaultStartLocation = gSavedSettings.getString("LoginLocation"); - LL_INFOS("AppInit") << "default LoginLocation '" << defaultStartLocation << "'" << LL_ENDL; + LL_INFOS("AppInit")<<"default LoginLocation '"<("login")->setDefaultBtn(findChild("connect_btn")); + getChild("start_location_panel")->setDefaultBtn(findChild("connect_btn")); + + std::string channel = LLVersionInfo::getChannel(); + std::string version = llformat("%s (%d)", + LLVersionInfo::getShortVersion().c_str(), + LLVersionInfo::getBuild()); + + LLTextBox* forgot_password_text = getChild("forgot_password_text"); + forgot_password_text->setClickedCallback(onClickForgotPassword, NULL); + + // get the web browser control + LLMediaCtrl* web_browser = getChild("login_html"); + web_browser->addObserver(this); + loadLoginPage(); + + LLComboBox* username_combo(getChild("username_combo")); + username_combo->setTextChangedCallback(boost::bind(&FSPanelLogin::onUsernameTextChanged, this)); + username_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectUser, this)); + username_combo->setFocusLostCallback(boost::bind(&FSPanelLogin::onSelectUser, this)); + mPreviousUsername = username_combo->getValue().asString(); } void FSPanelLogin::addFavoritesToStartLocation() @@ -302,6 +305,8 @@ void FSPanelLogin::addFavoritesToStartLocation() std::string current_user = canonical_user_name + " @ " + current_grid; LL_DEBUGS("Favorites") << "Current user: \"" << current_user << "\"" << LL_ENDL; std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml"); + mUsernameLength = current_user.length(); + updateLoginButtons(); LLSD fav_llsd; llifstream file; @@ -311,6 +316,7 @@ void FSPanelLogin::addFavoritesToStartLocation() return; } LLSDSerialize::fromXML(fav_llsd, file); + for (LLSD::map_const_iterator iter = fav_llsd.beginMap(); iter != fav_llsd.endMap(); ++iter) { @@ -353,7 +359,7 @@ FSPanelLogin::~FSPanelLogin() gFocusMgr.setDefaultKeyboardFocus(NULL); } -// virtual +// virtual void FSPanelLogin::setFocus(BOOL b) { if(b != hasFocus()) @@ -486,17 +492,19 @@ void FSPanelLogin::setFields(LLPointer credential, bool from_start LLSD authenticator = credential->getAuthenticator(); LL_INFOS("Credentials") << "Setting authenticator field " << authenticator["type"].asString() << LL_ENDL; bool remember; - if (authenticator.isMap() && - authenticator.has("secret") && + if(authenticator.isMap() && + authenticator.has("secret") && (authenticator["secret"].asString().size() > 0)) { // This is a MD5 hex digest of a password. // We don't actually use the password input field, // fill it with MAX_PASSWORD_SL characters so we get a - // nice row of asterixes. + // nice row of asterisks. const std::string filler("123456789!123456"); sInstance->getChild("password_edit")->setText(filler); + sInstance->mPasswordLength = filler.length(); + sInstance->updateLoginButtons(); remember = true; // We run into this case, if a user tries to login with a newly entered password @@ -513,6 +521,8 @@ void FSPanelLogin::setFields(LLPointer credential, bool from_start (stored_credential->getAuthenticator().has("secret") && stored_credential->getAuthenticator()["secret"].asString() != authenticator["secret"].asString())) { sInstance->getChild("password_edit")->setText(sPassword); + sInstance->mPasswordLength = sPassword.length(); + sInstance->updateLoginButtons(); sInstance->mPasswordModified = TRUE; } } @@ -520,6 +530,8 @@ void FSPanelLogin::setFields(LLPointer credential, bool from_start else { sInstance->getChild("password_edit")->clear(); + sInstance->mPasswordLength = 0; + sInstance->updateLoginButtons(); remember = false; } if (from_startup) @@ -601,7 +613,7 @@ void FSPanelLogin::getFields(LLPointer& credential, std::string last; if (separator_index != username.npos) { - last = username.substr(separator_index + 1, username.npos); + last = username.substr(separator_index+1, username.npos); LLStringUtil::trim(last); } else @@ -657,7 +669,7 @@ BOOL FSPanelLogin::areCredentialFieldsDirty() return true; } } - return false; + return false; } @@ -713,6 +725,8 @@ void FSPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl) updateServer(); // to change the links and splash screen } location_combo->setTextEntry(new_start_slurl.getLocationString()); + sInstance->mLocationLength = new_start_slurl.getLocationString().length(); + sInstance->updateLoginButtons(); } else { @@ -794,6 +808,13 @@ void FSPanelLogin::loadLoginPage() LL_DEBUGS("AppInit") << "login_page: " << login_page << LL_ENDL; + // allow users (testers really) to specify a different login content URL + std::string force_login_url = gSavedSettings.getString("ForceLoginURL"); + if ( force_login_url.length() > 0 ) + { + login_page = LLURI(force_login_url); + } + // Language params["lang"] = LLUI::getLanguage(); @@ -880,7 +901,7 @@ void FSPanelLogin::onClickConnect(void *) } else if(password.empty()) { - LLNotificationsUtil::add("MustEnterPasswordToLogIn"); + LLNotificationsUtil::add("MustEnterPasswordToLogIn"); } else { @@ -910,7 +931,7 @@ void FSPanelLogin::onClickConnect(void *) // credential format, as it doesn't yet allow account (single username) // format creds. - Rox. James, we wanna fix the message when we change // this. - LLNotificationsUtil::add("InvalidCredentialFormat"); + LLNotificationsUtil::add("InvalidCredentialFormat"); } } } @@ -976,41 +997,51 @@ void FSPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) // *TODO: use another way to notify user about enabled caps lock, see EXT-6858 sCapslockDidNotification = TRUE; } + + LLLineEditor* password_edit(self->getChild("password_edit")); + self->mPasswordLength = password_edit->getText().length(); + self->updateLoginButtons(); } void FSPanelLogin::updateServer() { - if (!sInstance) + if (sInstance) { - return; - } - try - { - // if they've selected another grid, we should load the credentials - // for that grid and set them to the UI. - if(!sInstance->areCredentialFieldsDirty()) + try { - LLPointer credential = gSecAPIHandler->loadCredential(credentialName()); - sInstance->setFields(credential); - } + // if they've selected another grid, we should load the credentials + // for that grid and set them to the UI. + if(!sInstance->areCredentialFieldsDirty()) + { + LLPointer credential = gSecAPIHandler->loadCredential(credentialName()); + sInstance->setFields(credential); + } - // grid changed so show new splash screen (possibly) - updateServerCombo(); - loadLoginPage(); + // grid changed so show new splash screen (possibly) + updateServerCombo(); + loadLoginPage(); #ifdef OPENSIM - sInstance->getChild("password_edit")->setMaxTextLength(LLGridManager::getInstance()->isInSecondLife() ? MAX_PASSWORD_SL : MAX_PASSWORD_OPENSIM); + sInstance->getChild("password_edit")->setMaxTextLength(LLGridManager::getInstance()->isInSecondLife() ? MAX_PASSWORD_SL : MAX_PASSWORD_OPENSIM); #endif + } + catch (LLInvalidGridName ex) + { + LL_WARNS("AppInit")<<"server '"<("connect_btn"); + + login_btn->setEnabled(mUsernameLength != 0 && mPasswordLength != 0); } void FSPanelLogin::onSelectServer() @@ -1055,9 +1086,10 @@ void FSPanelLogin::onSelectServer() location_combo->setCurrentByIndex(0); // last location on the new grid location_combo->setTextEntry(LLStringUtil::null); } - } + } break; } + updateServer(); } @@ -1065,7 +1097,7 @@ void FSPanelLogin::onLocationSLURL() { LLComboBox* location_combo = getChild("start_location_combo"); std::string location = location_combo->getValue().asString(); - LL_DEBUGS("AppInit") << location << LL_ENDL; + LL_DEBUGS("AppInit")<addFavoritesToStartLocation(); sInstance->mPreviousUsername = combo->getValue().asString(); + sInstance->mUsernameLength = combo->getValue().asString().length(); + sInstance->updateLoginButtons(); sInstance->getChild("remove_user_btn")->setEnabled(FALSE); return; } @@ -1337,6 +1371,25 @@ void FSPanelLogin::gridListChanged(bool success) updateServer(); } +// static +bool FSPanelLogin::getShowFavorites() +{ + if (sInstance) + { + return sInstance->mShowFavorites; + } + else + { + return gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin"); + } +} + +void FSPanelLogin::onUsernameTextChanged() +{ + mUsernameLength = getChild("username_combo")->getValue().asString().length(); + updateLoginButtons(); +} + ///////////////////////// // Mode selector // ///////////////////////// @@ -1373,16 +1426,3 @@ void FSPanelLogin::onModeChangeConfirm(const LLSD& original_value, const LLSD& n break; } } - -// static -bool FSPanelLogin::getShowFavorites() -{ - if (sInstance) - { - return sInstance->mShowFavorites; - } - else - { - return gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin"); - } -} diff --git a/indra/newview/fspanellogin.h b/indra/newview/fspanellogin.h index c653963d2a..656e6654b5 100644 --- a/indra/newview/fspanellogin.h +++ b/indra/newview/fspanellogin.h @@ -24,7 +24,7 @@ * $/LicenseInfo$ */ -// Original file: llpanellogin.cpp +// Original file: llpanellogin.h #ifndef FS_PANELLOGIN_H #define FS_PANELLOGIN_H @@ -32,11 +32,8 @@ #include "llpanel.h" #include "llpointer.h" // LLPointer<> #include "llmediactrl.h" // LLMediaCtrlObserver -#include class LLLineEditor; -class LLUIImage; -class LLPanelLoginListener; class LLSLURL; class LLCredential; @@ -53,10 +50,6 @@ public: virtual void setFocus( BOOL b ); - // Show the XUI first name, last name, and password widgets. They are - // hidden on startup for reg-in-client - static void showLoginWidgets(); - static void show(const LLRect &rect, void (*callback)(S32 option, void* user_data), void* callback_data); @@ -76,6 +69,8 @@ public: void setSiteIsAlive( bool alive ); + void showLoginWidgets(); + static void loadLoginPage(); static void giveFocus(); static void setAlwaysRefresh(bool refresh); @@ -87,13 +82,12 @@ public: /// to be called from LLStartUp::setStartSLURL static void onUpdateStartSLURL(const LLSLURL& new_start_slurl); - // called from prefs when initializing pane + // called from prefs when initializing panel static bool getShowFavorites(); static void clearPassword() { sPassword.clear(); } private: - friend class LLPanelLoginListener; void addFavoritesToStartLocation(); void addUsersToCombo(BOOL show_server); void onSelectUser(); @@ -101,6 +95,7 @@ private: void onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response); void onSelectServer(); void onLocationSLURL(); + void onUsernameTextChanged(); static void onClickConnect(void*); static void onClickNewAccount(void*); @@ -116,17 +111,22 @@ private: static std::string credentialName(); private: + void updateLoginButtons(); + void (*mCallback)(S32 option, void *userdata); void* mCallbackData; - BOOL mPasswordModified; + BOOL mPasswordModified; bool mShowFavorites; static FSPanelLogin* sInstance; static BOOL sCapslockDidNotification; - std::string mPreviousUsername; + unsigned int mUsernameLength; + unsigned int mPasswordLength; + unsigned int mLocationLength; + std::string mPreviousUsername; static std::string sPassword; }; diff --git a/indra/newview/llloginhandler.cpp b/indra/newview/llloginhandler.cpp index 20f7b3a7fa..0230be2e2c 100755 --- a/indra/newview/llloginhandler.cpp +++ b/indra/newview/llloginhandler.cpp @@ -99,35 +99,6 @@ bool LLLoginHandler::handle(const LLSD& tokens, return true; } - // [FS Login Panel] - if (tokens.size() == 1 - && tokens[0].asString() == "show") - { - // We're using reg-in-client, so show the XUI login widgets - FSPanelLogin::showLoginWidgets(); - return true; - } - - if (tokens.size() == 1 - && tokens[0].asString() == "reg") - { - LLWindow* window = gViewerWindow->getWindow(); - window->incBusyCount(); - window->setCursor(UI_CURSOR_ARROW); - - // Do this first, as it may be slow and we want to keep something - // on the user's screen as long as possible - LLWeb::loadURLExternal( "http://join.eniac15.lindenlab.com/" ); - - window->decBusyCount(); - window->setCursor(UI_CURSOR_ARROW); - - // Then hide the window - window->minimize(); - return true; - } - // [FS Login Panel] - // Make sure window is visible LLWindow* window = gViewerWindow->getWindow(); if (window->getMinimized()) diff --git a/indra/newview/skins/default/xui/en/panel_fs_login.xml b/indra/newview/skins/default/xui/en/panel_fs_login.xml index fb2ce65eaf..9fdccec641 100644 --- a/indra/newview/skins/default/xui/en/panel_fs_login.xml +++ b/indra/newview/skins/default/xui/en/panel_fs_login.xml @@ -116,7 +116,7 @@ width="128"> Password: - + + bg_opaque_color="0.16 0.16 0.16 1" + background_opaque="true" + width="1024"> http://phoenixviewer.com/app/loginV3/ @@ -20,20 +21,18 @@ name="forgot_password_url"> http://secondlife.com/account/request.php - + top="18" + height="670" + width="1024" /> Password: + + name="Typeregionname" value="" /> Date: Thu, 21 Apr 2016 12:00:05 +0200 Subject: [PATCH 07/19] FIRE-17518: Opening Preferences from the login screen breaks the login page layout --- indra/newview/fspanellogin.cpp | 7 ------- indra/newview/llfloaterpreference.cpp | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index 7827c66459..265bbdc55d 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -268,10 +268,6 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, LLTextBox* forgot_password_text = getChild("forgot_password_text"); forgot_password_text->setClickedCallback(onClickForgotPassword, NULL); - // get the web browser control - LLMediaCtrl* web_browser = getChild("login_html"); - web_browser->addObserver(this); - loadLoginPage(); LLComboBox* username_combo(getChild("username_combo")); @@ -1318,9 +1314,6 @@ void FSPanelLogin::updateServerCombo() { if (!sInstance) return; -#ifdef OPENSIM - LLGridManager::getInstance()->addGridListChangedCallback(&FSPanelLogin::gridListChanged); -#endif // OPENSIM // We add all of the possible values, sorted, and then add a bar and the current value at the top LLComboBox* server_choice_combo = sInstance->getChild("server_combo"); server_choice_combo->removeall(); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 7cef8a3172..6625729b3e 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -4495,6 +4495,7 @@ void LLPanelPreferenceOpensim::onSelectGrid() void LLPanelPreferenceOpensim::apply() { LLGridManager::getInstance()->saveGridList(); + FSPanelLogin::updateServer(); } void LLPanelPreferenceOpensim::cancel() @@ -4596,6 +4597,8 @@ bool LLPanelPreferenceOpensim::removeGridCB(const LLSD& notification, const LLSD void LLPanelPreferenceOpensim::refreshGridList(bool success) { + FSPanelLogin::updateServer(); + getChild("grid_management_panel")->setEnabled(TRUE); if (!mGridListControl) From 500a462508f0ebee806f80eb870f9b7a0c9acf46 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 22 Apr 2016 14:28:05 +0200 Subject: [PATCH 08/19] New login page layout - set FSUseLegacyLoginPanel to TRUE if you favor the old crap --- indra/newview/app_settings/settings.xml | 11 + indra/newview/fspanellogin.cpp | 15 +- .../skins/default/textures/textures.xml | 1 + .../skins/default/xui/de/panel_fs_login.xml | 8 +- .../default/xui/de/panel_fs_nui_login.xml | 59 +++ .../default/xui/en/panel_fs_nui_login.xml | 379 ++++++++++++++++++ 6 files changed, 466 insertions(+), 7 deletions(-) create mode 100644 indra/newview/skins/default/xui/de/panel_fs_nui_login.xml create mode 100644 indra/newview/skins/default/xui/en/panel_fs_nui_login.xml diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ebc8b10cc5..7c0e0ba513 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -23852,6 +23852,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value eff31dd2-1b65-5a03-5e37-15aca8e53ab7 + FSUseLegacyLoginPanel + + Comment + If enabled, the legacy layout version of the login panel will be used + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index 265bbdc55d..27de211e8c 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -197,7 +197,14 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, login_holder->addChild(this); } - buildFromFile( "panel_fs_login.xml"); + if (!gSavedSettings.getBOOL("FSUseLegacyLoginPanel")) + { + buildFromFile( "panel_fs_nui_login.xml"); + } + else + { + buildFromFile( "panel_fs_login.xml"); + } reshape(rect.getWidth(), rect.getHeight()); @@ -207,6 +214,8 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, LLLineEditor* password_edit(getChild("password_edit")); password_edit->setKeystrokeCallback(onPassKey, this); + // STEAM-14: When user presses Enter with this field in focus, initiate login + password_edit->setCommitCallback(boost::bind(&FSPanelLogin::onClickConnect, this)); // change z sort of clickable text to be behind buttons sendChildToBack(getChildView("forgot_password_text")); @@ -257,8 +266,8 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, childSetAction("remove_user_btn", onClickRemove, this); childSetAction("connect_btn", onClickConnect, this); - getChild("login")->setDefaultBtn(findChild("connect_btn")); - getChild("start_location_panel")->setDefaultBtn(findChild("connect_btn")); + getChild("login")->setDefaultBtn(findChild("connect_btn")); + getChild("start_location_panel")->setDefaultBtn(findChild("connect_btn")); std::string channel = LLVersionInfo::getChannel(); std::string version = llformat("%s (%d)", diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 37a3fbabb8..c215cf371b 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -670,6 +670,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/xui/de/panel_fs_login.xml b/indra/newview/skins/default/xui/de/panel_fs_login.xml index 7b6e783ede..f29e8c5042 100644 --- a/indra/newview/skins/default/xui/de/panel_fs_login.xml +++ b/indra/newview/skins/default/xui/de/panel_fs_login.xml @@ -15,7 +15,7 @@ Benutzername: - +