diff options
author | Roxie Linden <roxie@lindenlab.com> | 2010-04-21 00:17:58 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2010-04-21 00:17:58 -0700 |
commit | 9fdba53b09193290ab33fc6aa414329d126505ed (patch) | |
tree | 5c10edf86a7904ced900d7217658bc044634d2ed /indra | |
parent | 6823879c1ad2260e553bc6a641975ca478848f3b (diff) |
Show beta grids depending on a settings.xml setting. for SLE, this will be turned off. For trunk, it's turned on.
Also, fixed an issue with manual entry of locations into the location dropdown.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llpanellogin.cpp | 82 | ||||
-rw-r--r-- | indra/newview/llpanellogin.h | 3 | ||||
-rw-r--r-- | indra/newview/llviewernetwork.cpp | 17 | ||||
-rw-r--r-- | indra/newview/tests/llviewernetwork_test.cpp | 44 |
5 files changed, 36 insertions, 121 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 24add573dc..0b2e657fbb 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7973,6 +7973,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>ShowBetaGrids</key> + <map> + <key>Comment</key> + <string>Display the beta grids in the grid selection control.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>ShowCrosshairs</key> <map> <key>Comment</key> diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index a9e6484061..2bd763c681 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -221,16 +221,12 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLLineEditor* edit = getChild<LLLineEditor>("password_edit"); if (edit) edit->setDrawAsterixes(TRUE); - LLComboBox* combo = getChild<LLComboBox>("start_location_combo"); - if(LLStartUp::getStartSLURL().getType() != LLSLURL::LOCATION) { LLSLURL slurl(gSavedSettings.getString("LoginLocation")); LLStartUp::setStartSLURL(slurl); } updateLocationCombo(false); - - combo->setCommitCallback(onSelectLocation, NULL); LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo"); server_choice_combo->setCommitCallback(onSelectServer, NULL); @@ -692,7 +688,6 @@ void LLPanelLogin::updateLocationCombo( bool force_visible ) return; } - llinfos << "updatelocationcombo " << LLStartUp::getStartSLURL().asString() << llendl; LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo"); switch(LLStartUp::getStartSLURL().getType()) @@ -724,7 +719,7 @@ void LLPanelLogin::updateLocationCombo( bool force_visible ) } // static -void LLPanelLogin::onSelectLocation(LLUICtrl*, void*) +void LLPanelLogin::updateStartSLURL() { if (!sInstance) return; @@ -733,30 +728,11 @@ void LLPanelLogin::onSelectLocation(LLUICtrl*, void*) switch (index) { - case 2: + case 0: { - LLSLURL slurl = LLSLURL(combo->getSelectedValue()); - if((slurl.getType() == LLSLURL::LOCATION) && - (slurl.getGrid() != LLStartUp::getStartSLURL().getGrid())) - { - - - // we've changed the grid, so update the grid selection - try - { - LLStartUp::setStartSLURL(slurl); - } - catch (LLInvalidGridName ex) - { - LLSD args; - args["GRID"] = slurl.getGrid(); - LLNotificationsUtil::add("InvalidGrid", args); - return; - } - loadLoginPage(); - } + LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST)); break; - } + } case 1: { LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME)); @@ -764,44 +740,18 @@ void LLPanelLogin::onSelectLocation(LLUICtrl*, void*) } default: { - LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST)); + LLSLURL slurl = LLSLURL(combo->getValue().asString()); + if(slurl.getType() == LLSLURL::LOCATION) + { + // we've changed the grid, so update the grid selection + LLStartUp::setStartSLURL(slurl); + } break; - } + } } } -// static -void LLPanelLogin::getLocation(LLSLURL& slurl) -{ - LLSLURL result; - if (!sInstance) - { - llwarns << "Attempted getLocation with no login view shown" << llendl; - } - - LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo"); - - switch(combo->getCurrentIndex()) - { - case 0: - { - slurl = LLSLURL(LLSLURL::SIM_LOCATION_HOME); - break; - } - case 1: - { - slurl = LLSLURL(LLSLURL::SIM_LOCATION_LAST); - break; - } - default: - { - slurl = LLSLURL(combo->getValue().asString()); - break; - } - } -} - void LLPanelLogin::setLocation(const LLSLURL& slurl) { LLStartUp::setStartSLURL(slurl); @@ -1024,7 +974,7 @@ void LLPanelLogin::onClickConnect(void *) LLNotificationsUtil::add("InvalidGrid", args); return; } - + updateStartSLURL(); std::string username = sInstance->childGetText("username_edit"); if(username.empty()) { @@ -1134,11 +1084,9 @@ void LLPanelLogin::updateServerCombo() // 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<LLComboBox>("server_combo"); server_choice_combo->removeall(); -#ifdef LL_RELEASE_FOR_DOWNLOAD - std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids(TRUE); -#else - std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids(FALSE); -#endif + + std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids(!gSavedSettings.getBOOL("ShowBetaGrids")); + for (std::map<std::string, std::string>::iterator grid_choice = known_grids.begin(); grid_choice != known_grids.end(); grid_choice++) diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 9301c263da..bca051691b 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -73,7 +73,6 @@ public: static BOOL isGridComboDirty(); static BOOL areCredentialFieldsDirty(); - static void getLocation(LLSLURL& slurl); static void setLocation(const LLSLURL& slurl); static void updateLocationCombo(bool force_visible); // simply update the combo box @@ -102,7 +101,7 @@ private: static void onSelectServer(LLUICtrl*, void*); static void onServerComboLostFocus(LLFocusableElement*); static void updateServerCombo(); - static void onSelectLocation(LLUICtrl*, void*); + static void updateStartSLURL(); static void updateLoginPanelLinks(); diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index d7bb4efe85..2673ba4e17 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -92,20 +92,11 @@ void LLGridManager::initialize(const std::string& grid_file) -#ifndef LL_RELEASE_FOR_DOWNLOAD - addSystemGrid("Agni", + addSystemGrid("Secondlife.com (Agni)", MAINGRID, "https://login.agni.lindenlab.com/cgi-bin/login.cgi", "https://secondlife.com/helpers/", DEFAULT_LOGIN_PAGE); -#else - addSystemGrid("Secondlife.com", - MAINGRID, - "https://login.agni.lindenlab.com/cgi-bin/login.cgi", - "https://secondlife.com/helpers/", - DEFAULT_LOGIN_PAGE, - "Agni"); -#endif // LL_RELEASE_FOR_DOWNLOAD addSystemGrid("Aditi", "util.aditi.lindenlab.com", "https://login.aditi.lindenlab.com/cgi-bin/login.cgi", @@ -313,11 +304,7 @@ void LLGridManager::initialize(const std::string& grid_file) // the grid name was empty, or the grid isn't actually in the list, then set it to the // appropriate default. LL_INFOS("GridManager") << "Resetting grid as grid name " << mGrid << " is not in the list" << LL_ENDL; -#if LL_RELEASE_FOR_DOWNLOAD mGrid = MAINGRID; -#else - mGrid = ""; -#endif } LL_INFOS("GridManager") << "Selected grid is " << mGrid << LL_ENDL; gSavedSettings.setString("CurrentGrid", mGrid); @@ -418,7 +405,7 @@ void LLGridManager::addSystemGrid(const std::string& label, } else { - grid[GRID_SLURL_BASE] = llformat(SYSTEM_GRID_SLURL_BASE, label.c_str()); + grid[GRID_SLURL_BASE] = llformat(SYSTEM_GRID_SLURL_BASE, label.c_str()); } addGrid(grid); } diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index f9f42cfc86..90c8357453 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -143,30 +143,17 @@ namespace tut manager->initialize("grid_test.xml"); // validate that some of the defaults are available. std::map<std::string, std::string> known_grids = manager->getKnownGrids(); -#ifndef LL_RELEASE_FOR_DOWNLOAD ensure_equals("Known grids is a string-string map of size 18", known_grids.size(), 18); ensure_equals("Agni has the right name and label", - known_grids[std::string("util.agni.lindenlab.com")], std::string("Agni")); -#else // LL_RELEASE_FOR_DOWNLOAD - ensure_equals("Known grids is a string-string map of size 2", known_grids.size(), 2); - ensure_equals("Agni has the right name and label", - known_grids[std::string("util.agni.lindenlab.com")], std::string("Secondlife.com")); -#endif // LL_RELEASE_FOR_DOWNLOAD - - + known_grids[std::string("util.agni.lindenlab.com")], std::string("Secondlife.com (Agni)")); ensure_equals("None exists", known_grids[""], "None"); LLSD grid = LLGridManager::getInstance()->getGridInfo("util.agni.lindenlab.com"); ensure("Grid info for agni is a map", grid.isMap()); ensure_equals("name is correct for agni", grid[GRID_VALUE].asString(), std::string("util.agni.lindenlab.com")); -#ifndef LL_RELEASE_FOR_DOWNLOAD ensure_equals("label is correct for agni", - grid[GRID_LABEL_VALUE].asString(), std::string("Agni")); -#else // LL_RELEASE_FOR_DOWNLOAD - ensure_equals("label is correct for agni", - grid[GRID_LABEL_VALUE].asString(), std::string("Secondlife.com")); -#endif // LL_RELEASE_FOR_DOWNLOAD + grid[GRID_LABEL_VALUE].asString(), std::string("Secondlife.com (Agni)")); ensure("Login URI is an array", grid[GRID_LOGIN_URI_VALUE].isArray()); ensure_equals("Agni login uri is correct", @@ -196,30 +183,17 @@ namespace tut LLGridManager::getInstance()->initialize("grid_test.xml"); std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids(); -#ifndef LL_RELEASE_FOR_DOWNLOAD ensure_equals("adding a grid via a grid file increases known grid size", known_grids.size(), 19); ensure_equals("Agni is still there after we've added a grid via a grid file", - known_grids["util.agni.lindenlab.com"], std::string("Agni")); - -#else - ensure_equals("adding a grid via a grid file increases known grid size", - known_grids.size(), 3); - ensure_equals("Agni is still there after we've added a grid via a grid file", - known_grids["util.agni.lindenlab.com"], std::string("Secondlife.com")); - -#endif + known_grids["util.agni.lindenlab.com"], std::string("Secondlife.com (Agni)")); // assure Agni doesn't get overwritten LLSD grid = LLGridManager::getInstance()->getGridInfo("util.agni.lindenlab.com"); -#ifndef LL_RELEASE_FOR_DOWNLOAD - ensure_equals("Agni grid label was not modified by grid file", - grid[GRID_LABEL_VALUE].asString(), std::string("Agni")); -#else \\ LL_RELEASE_FOR_DOWNLOAD + ensure_equals("Agni grid label was not modified by grid file", - grid[GRID_LABEL_VALUE].asString(), std::string("Secondlife.com")); -#endif \\ LL_RELEASE_FOR_DOWNLOAD + grid[GRID_LABEL_VALUE].asString(), std::string("Secondlife.com (Agni)")); ensure_equals("Agni name wasn't modified by grid file", grid[GRID_VALUE].asString(), std::string("util.agni.lindenlab.com")); @@ -345,12 +319,8 @@ namespace tut LLGridManager::getInstance()->initialize("grid_test.xml"); LLGridManager::getInstance()->addGrid(grid); - LLGridManager::getInstance()->setGridChoice("util.agni.lindenlab.com"); -#ifndef LL_RELEASE_FOR_DOWNLOAD - ensure_equals("getGridLabel", LLGridManager::getInstance()->getGridLabel(), std::string("Agni")); -#else // LL_RELEASE_FOR_DOWNLOAD - ensure_equals("getGridLabel", LLGridManager::getInstance()->getGridLabel(), std::string("Secondlife.com")); -#endif // LL_RELEASE_FOR_DOWNLOAD + LLGridManager::getInstance()->setGridChoice("util.agni.lindenlab.com"); + ensure_equals("getGridLabel", LLGridManager::getInstance()->getGridLabel(), std::string("Secondlife.com (Agni)")); ensure_equals("getGrid", LLGridManager::getInstance()->getGrid(), std::string("util.agni.lindenlab.com")); ensure_equals("getHelperURI", LLGridManager::getInstance()->getHelperURI(), |