From eb15b6f93618f34516e00d3ba96237fde8663f58 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 28 Jun 2012 17:55:10 -0400 Subject: Remove redundant "create_account_url" string from panel_login.xml. We already have a "create_account_url" string in strings.xml, and in fact -- according to Eli -- the strings.xml values are "better" for non-English languages. Unfortunately those "better" strings weren't being used. They were tied to the FirstRun notification, which seems to have been disengaged. Changed llpanellogin.cpp to look in strings.xml rather than panel_login.xml when clicking the "Sign Up" link on the login panel. --- indra/newview/llpanellogin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 76aadcd913..a7aa99dfde 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -877,7 +877,7 @@ void LLPanelLogin::onClickConnect(void *) // static void LLPanelLogin::onClickNewAccount(void*) { - LLWeb::loadURLExternal(sInstance->getString("create_account_url")); + LLWeb::loadURLExternal(LLTrans::getString("create_account_url")); } -- cgit v1.2.3 From 8356cc1c4fd921cac46d9d98bdf80c7c8ae05b22 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 13 Jul 2012 12:38:26 -0400 Subject: Try reorganizing panel_login.xml per Leo's redesign. This includes replacing the small "Sign up" link with a "CREATE YOUR ACCOUNT: Start now" button, requiring a small tweak to the C++ code to Do The Right Thing when the button (vs. the link) is clicked. --- indra/newview/llpanellogin.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index a7aa99dfde..e37155aeb6 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -175,8 +175,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, 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); + childSetAction("create_new_account_btn", onClickNewAccount, NULL); LLTextBox* need_help_text = getChild("login_help"); need_help_text->setClickedCallback(onClickHelp, NULL); @@ -1025,7 +1024,7 @@ void LLPanelLogin::updateLoginPanelLinks() // need to call through sInstance, as it's called from onSelectServer, which // is static. - sInstance->getChildView("create_new_account_text")->setVisible( system_grid); + sInstance->getChildView("create_new_account_btn")->setVisible( system_grid); sInstance->getChildView("forgot_password_text")->setVisible( system_grid); } -- cgit v1.2.3 From f7449bdc570e97a2ded2864779c72cce7f52e608 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 18 Jul 2012 14:47:16 -0400 Subject: Make "Log In" button (etc.) move with start/grid combo visibility. The "Start at:" combo box and the grid-selector box can be turned on and off with checkboxes on the Preferences floater. Break the bottom-left layout_panel on panel_login into several different layout_panels so when these UI elements disappear, other controls move left to fill the holes. Similarly, when you turn on either or both of the UI elements in question, the remaining controls in that general bottom-left area move right to accommodate. Tweak C++ and non-English panel_login.xml overrides to reflect widgets' containment in new layout_panel elements. Discard obsolete "mode_selection_text" and "mode_combo" translations from non- English panel_login.xml overrides. --- indra/newview/llpanellogin.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index e37155aeb6..c4bd8c750d 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llpanellogin.h" +#include "lllayoutstack.h" #include "indra_constants.h" // for key and mask constants #include "llfloaterreg.h" @@ -161,7 +162,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, childSetAction("connect_btn", onClickConnect, this); - getChild("login")->setDefaultBtn("connect_btn"); + getChild("links_login_panel")->setDefaultBtn("connect_btn"); std::string channel = LLVersionInfo::getChannel(); std::string version = llformat("%s (%d)", @@ -640,13 +641,11 @@ void LLPanelLogin::updateLocationCombo( bool force_visible ) if ( ! force_visible ) show_start = gSavedSettings.getBOOL("ShowStartLocation"); - - sInstance->getChildView("start_location_combo")->setVisible( show_start); - sInstance->getChildView("start_location_text")->setVisible( show_start); - + + sInstance->getChild("start_location_panel")->setVisible(show_start); + BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid"); - sInstance->getChildView("server_combo_text")->setVisible( show_server); - sInstance->getChildView("server_combo")->setVisible( show_server); + sInstance->getChild("grid_panel")->setVisible(show_server); } // static -- cgit v1.2.3 From df767cef781c9bf7a64f892918f07e5f463d5df0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 2 Aug 2012 16:04:39 -0400 Subject: Manual cleanup from merge up to viewer-development. Some viewer-development code had been moved, and so wasn't patched with my panel_login layout changes; verified each of my llpanellogin.cpp commits against new tip rev. Reformatted panel_login.xml in the spirit of the preferred indentation scheme but with my layout changes. --- indra/newview/llpanellogin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index ca7e032dca..ba25f78e0d 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -619,10 +619,10 @@ void LLPanelLogin::updateLocationSelectorsVisibility() if (sInstance) { BOOL show_start = gSavedSettings.getBOOL("ShowStartLocation"); - sInstance->getChild("start_location_panel")->setVisible(show_start); + sInstance->getChild("start_location_panel")->setVisible(show_start); BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid"); - sInstance->getChild("grid_panel")->setVisible(show_server); + sInstance->getChild("grid_panel")->setVisible(show_server); } } @@ -909,7 +909,7 @@ void LLPanelLogin::updateServer() // update the login panel links bool system_grid = LLGridManager::getInstance()->isSystemGrid(); - sInstance->getChildView("create_new_account_text")->setVisible( system_grid); + sInstance->getChildView("create_new_account_btn")->setVisible( system_grid); sInstance->getChildView("forgot_password_text")->setVisible( system_grid); // grid changed so show new splash screen (possibly) -- cgit v1.2.3 From e4e58f0095dc47f8ab666b050a4a84aeb6fdd650 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 3 Aug 2012 14:58:57 -0400 Subject: When turning off create-account button, also turn off its title text. Login-panel logic distinguishes "system grid" from "non-system grid." With Oz's recent changes for pathfinding, now only agni and aditi are "system grids;" anything else configured into grids.xml is a "non-system grid." The difference is that when you select a "non-system grid" on the grid selector, we turn off the "lost password?" link and the "create account" button -- since how can we help with either if we don't recognize the grid? This logic already existed, but only turned off the create-account button, leaving the new title "CREATE YOUR ACCOUNT" over an empty corner of the login panel. Turn that off too. --- indra/newview/llpanellogin.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index ba25f78e0d..6bd174186a 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -908,9 +908,11 @@ void LLPanelLogin::updateServer() // update the login panel links bool system_grid = LLGridManager::getInstance()->isSystemGrid(); - - sInstance->getChildView("create_new_account_btn")->setVisible( system_grid); - sInstance->getChildView("forgot_password_text")->setVisible( system_grid); + + // Want to vanish not only create_new_account_btn, but also the + // title text over it, so turn on/off the whole layout_panel element. + sInstance->getChild("links")->setVisible(system_grid); + sInstance->getChildView("forgot_password_text")->setVisible(system_grid); // grid changed so show new splash screen (possibly) loadLoginPage(); -- cgit v1.2.3 From 488362b0ac926c51fccf093276ca15d93369c96f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 31 Aug 2012 11:32:31 -0400 Subject: Now that LLURI isn't broken, use it to construct login-page URL. Previous logic constructed a std::ostringstream, directly messing with '?' vs. '&', ugly libcurl escape calls etc. Now we can deconstruct the LLGridManager:: getLoginPage() URL, supplement the params map as needed and then rebuild a new URL using LLURI::buildHTTP(). --- indra/newview/llpanellogin.cpp | 62 +++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 40 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 3bb3e5cf47..d787b69b5e 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -744,63 +744,45 @@ void LLPanelLogin::setAlwaysRefresh(bool refresh) void LLPanelLogin::loadLoginPage() { if (!sInstance) return; - - std::ostringstream oStr; - std::string login_page = LLGridManager::getInstance()->getLoginPage(); + LLURI login_page = LLURI(LLGridManager::getInstance()->getLoginPage()); + LLSD params(login_page.queryMap()); - oStr << login_page; - - // Use the right delimeter depending on how LLURI parses the URL - LLURI login_page_uri = LLURI(login_page); - - std::string first_query_delimiter = "&"; - if (login_page_uri.queryMap().size() == 0) - { - first_query_delimiter = "?"; - } + LL_DEBUGS("AppInit") << "login_page: " << login_page << LL_ENDL; // Language - std::string language = LLUI::getLanguage(); - oStr << first_query_delimiter<<"lang=" << language; - + params["lang"] = LLUI::getLanguage(); + // First Login? if (gSavedSettings.getBOOL("FirstLoginThisInstall")) { - oStr << "&firstlogin=TRUE"; + params["firstlogin"] = "TRUE"; // not bool: server expects string TRUE } // Channel and Version - std::string version = llformat("%s (%d)", - LLVersionInfo::getShortVersion().c_str(), - LLVersionInfo::getBuild()); + params["version"] = llformat("%s (%d)", + LLVersionInfo::getShortVersion().c_str(), + LLVersionInfo::getBuild()); + params["channel"] = LLVersionInfo::getChannel(); - char* curl_channel = curl_escape(LLVersionInfo::getChannel().c_str(), 0); - char* curl_version = curl_escape(version.c_str(), 0); + // Grid + params["grid"] = LLGridManager::getInstance()->getGridId(); - oStr << "&channel=" << curl_channel; - oStr << "&version=" << curl_version; + // add OS info + params["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); - curl_free(curl_channel); - curl_free(curl_version); + // Make an LLURI with this augmented info + LLURI login_uri(LLURI::buildHTTP(login_page.authority(), + login_page.path(), + params)); - // Grid - char* curl_grid = curl_escape(LLGridManager::getInstance()->getGridId().c_str(), 0); - oStr << "&grid=" << curl_grid; - curl_free(curl_grid); - - // add OS info - char * os_info = curl_escape(LLAppViewer::instance()->getOSInfo().getOSStringSimple().c_str(), 0); - oStr << "&os=" << os_info; - curl_free(os_info); - gViewerWindow->setMenuBackgroundColor(false, !LLGridManager::getInstance()->isInProductionGrid()); - + LLMediaCtrl* web_browser = sInstance->getChild("login_html"); - if (web_browser->getCurrentNavUrl() != oStr.str()) + if (web_browser->getCurrentNavUrl() != login_uri.asString()) { - LL_DEBUGS("AppInit")<navigateTo( oStr.str(), "text/html" ); + LL_DEBUGS("AppInit") << "loading: " << login_uri << LL_ENDL; + web_browser->navigateTo( login_uri.asString(), "text/html" ); } } -- cgit v1.2.3 From f346cbbdeb8502e1cb06a01a184dde7a7f53a087 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 31 Aug 2012 11:58:25 -0400 Subject: Copy sourceid= from create_account_url to login-page URL. This allows the login-page server to respond to any sourceid= associated with the create_account_url, which (we happen to know) varies by skin -- e.g. for the Steam viewer. --- indra/newview/llpanellogin.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index d787b69b5e..c6bcaeab07 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -771,6 +771,14 @@ void LLPanelLogin::loadLoginPage() // add OS info params["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + // sourceid: create_account_url's sourceid= varies by skin + LLURI create_account_url(LLTrans::getString("create_account_url")); + LLSD create_account_params(create_account_url.queryMap()); + if (create_account_params.has("sourceid")) + { + params["sourceid"] = create_account_params["sourceid"]; + } + // Make an LLURI with this augmented info LLURI login_uri(LLURI::buildHTTP(login_page.authority(), login_page.path(), -- cgit v1.2.3 From ad4102db1b0b6730d6d1fe7119cab2149bb48e2c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 16 Oct 2012 21:13:25 -0400 Subject: LLPanelLogin::loadLoginPage() can now use "sourceid" settings var. Previously we borrowed the sourceid= param value from create_account_url, which we "happened to know" was overridden with the sourceid of interest. Now that we have a settings variable that directly captures sourceid, though, much more straightforward to use that. --- indra/newview/llpanellogin.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index c6bcaeab07..58e9a6b342 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -771,13 +771,8 @@ void LLPanelLogin::loadLoginPage() // add OS info params["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); - // sourceid: create_account_url's sourceid= varies by skin - LLURI create_account_url(LLTrans::getString("create_account_url")); - LLSD create_account_params(create_account_url.queryMap()); - if (create_account_params.has("sourceid")) - { - params["sourceid"] = create_account_params["sourceid"]; - } + // sourceid + params["sourceid"] = gSavedSettings.getString("sourceid"); // Make an LLURI with this augmented info LLURI login_uri(LLURI::buildHTTP(login_page.authority(), -- cgit v1.2.3 From 379bc7bd1db5a728a730f7e0e7d0a3bfbdfc3870 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 5 Nov 2012 16:34:12 -0500 Subject: STEAM-14: login when user presses Enter at username or password. The tricky thing about this fix is that the "Log In" button used to be in the same layout_panel as the username and password fields. Now it's not, so the fact that it's the default button for its layout_panel doesn't matter because that layout_panel doesn't have focus. Richard pointed out that we can make the commit action for the username and password fields initiate login -- as long as neither field implicitly runs its commit action when it loses focus! --- indra/newview/llpanellogin.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanellogin.cpp') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 58e9a6b342..bcb90bcb56 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -139,14 +139,17 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, mLogoImage = LLUI::getUIImage("startup_logo"); buildFromFile( "panel_login.xml"); - + reshape(rect.getWidth(), rect.getHeight()); - getChild("password_edit")->setKeystrokeCallback(onPassKey, this); + 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(&LLPanelLogin::onClickConnect, this)); // change z sort of clickable text to be behind buttons sendChildToBack(getChildView("forgot_password_text")); - + LLComboBox* location_combo = getChild("start_location_combo"); updateLocationSelectorsVisibility(); // separate so that it can be called from preferences location_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onLocationSLURL, this)); @@ -220,14 +223,17 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, // get the web browser control LLMediaCtrl* web_browser = getChild("login_html"); web_browser->addObserver(this); - + reshapeBrowser(); loadLoginPage(); - + // Show last logged in user favorites in "Start at" combo. addUsersWithFavoritesToUsername(); - getChild("username_combo")->setTextChangedCallback(boost::bind(&LLPanelLogin::addFavoritesToStartLocation, this)); + LLComboBox* username_combo(getChild("username_combo")); + username_combo->setTextChangedCallback(boost::bind(&LLPanelLogin::addFavoritesToStartLocation, this)); + // STEAM-14: When user presses Enter with this field in focus, initiate login + username_combo->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnect, this)); } void LLPanelLogin::addUsersWithFavoritesToUsername() -- cgit v1.2.3