diff options
| author | Aaron Terrell (Enus) <enus@lindenlab.com> | 2010-08-30 11:56:33 -0700 |
|---|---|---|
| committer | Aaron Terrell (Enus) <enus@lindenlab.com> | 2010-08-30 11:56:33 -0700 |
| commit | d04e8d757575dbb50877ef861adcfde427837bb6 (patch) | |
| tree | b214237a4246e523754b356b003d1d2a163f21ab /indra/newview/llviewernetwork.cpp | |
| parent | 3172b4db1ee4d2059d2605ce616bdb10c840fc03 (diff) | |
| parent | d84c6625c707b5d61b71749b74f3cc4fb8f02048 (diff) | |
merging up from viewer-development
Diffstat (limited to 'indra/newview/llviewernetwork.cpp')
| -rw-r--r-- | indra/newview/llviewernetwork.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index eade16a075..7f7c245717 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -44,6 +44,7 @@ const char* DEFAULT_SLURL_BASE = "https://%s/region/"; const char* DEFAULT_APP_SLURL_BASE = "x-grid-location-info://%s/app"; LLGridManager::LLGridManager() +: mIsInProductionGrid(false) { // by default, we use the 'grids.xml' file in the user settings directory // this file is an LLSD file containing multiple grid definitions. @@ -303,6 +304,10 @@ void LLGridManager::initialize(const std::string& grid_file) addGrid(grid); } + gSavedSettings.getControl("CurrentGrid")->getSignal()->connect(boost::bind(&LLGridManager::updateIsInProductionGrid, this)); + // since above only triggers on changes, trigger the callback manually to initialize state + updateIsInProductionGrid(); + LL_DEBUGS("GridManager") << "Selected grid is " << mGrid << LL_ENDL; setGridChoice(mGrid); if(mGridList[mGrid][GRID_LOGIN_URI_VALUE].isArray()) @@ -554,23 +559,30 @@ std::string LLGridManager::getLoginPage() return mGridList[mGrid][GRID_LOGIN_PAGE_VALUE]; } -bool LLGridManager::isInProductionGrid() +void LLGridManager::updateIsInProductionGrid() { + mIsInProductionGrid = false; + // *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice, // but it seems that loginURI trumps that. std::vector<std::string> uris; getLoginURIs(uris); - if (uris.size() < 1) + if (uris.empty()) { - return 1; + mIsInProductionGrid = true; + return; } LLStringUtil::toLower(uris[0]); if((uris[0].find("agni") != std::string::npos)) { - return true; + mIsInProductionGrid = true; + return; } +} - return false; +bool LLGridManager::isInProductionGrid() +{ + return mIsInProductionGrid; } void LLGridManager::saveFavorites() |
