diff --git a/indra/newview/hippogridmanager.cpp b/indra/newview/hippogridmanager.cpp index 1622c6604..22989cb43 100644 --- a/indra/newview/hippogridmanager.cpp +++ b/indra/newview/hippogridmanager.cpp @@ -39,10 +39,9 @@ HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO(""); // ******************************************************************** // Initialize -HippoGridInfo::HippoGridInfo(const std::string& gridNick) : - mPlatform(PLATFORM_OPENSIM), - mGridNick(gridNick), - mGridName(LLStringUtil::null), +HippoGridInfo::HippoGridInfo(const std::string& gridName) : + mPlatform(PLATFORM_AURORA), + mGridName(gridName), mLoginUri(LLStringUtil::null), mLoginPage(LLStringUtil::null), mHelperUri(LLStringUtil::null), @@ -64,8 +63,6 @@ HippoGridInfo::HippoGridInfo(const std::string& gridNick) : mRealCurrencySymbol("US$"), mDirectoryFee(30) { - std::string nick = gridNick; - mGridNick = sanitizeGridNick( nick ); } @@ -87,11 +84,6 @@ bool HippoGridInfo::isSecondLife() const return (mPlatform == HippoGridInfo::PLATFORM_SECONDLIFE); } -const std::string& HippoGridInfo::getGridNick() const -{ - return mGridNick; -} - const std::string& HippoGridInfo::getGridName() const { return mGridName; @@ -270,7 +262,7 @@ void HippoGridInfo::setSearchUrl(const std::string& url) void HippoGridInfo::setGridMessage(const std::string& message) { - mGridMessage = url; + mGridMessage = message; } void HippoGridInfo::setFirstName(const std::string& firstName) @@ -410,9 +402,7 @@ std::string HippoGridInfo::getSearchUrl(SearchType ty, bool is_web) const void HippoGridInfo::onXmlElementStart(void* userData, const XML_Char* name, const XML_Char** atts) { HippoGridInfo* self = (HippoGridInfo*)userData; - if (strcasecmp(name, "gridnick") == 0) - self->mXmlState = XML_GRIDNICK; - else if (strcasecmp(name, "gridname") == 0) + if (strcasecmp(name, "gridname") == 0) self->mXmlState = XML_GRIDNAME; else if (strcasecmp(name, "platform") == 0) self->mXmlState = XML_PLATFORM; @@ -449,13 +439,6 @@ void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int le HippoGridInfo* self = (HippoGridInfo*)userData; switch (self->mXmlState) { - case XML_GRIDNICK: - { - if (self->mGridNick == "") self->mGridNick.assign(s, len); - self->mGridNick = sanitizeGridNick(self->mGridNick); - break; - } - case XML_PLATFORM: { std::string platform(s, len); @@ -581,27 +564,6 @@ const char* HippoGridInfo::getPlatformString(Platform platform) return platformStrings[platform]; } - -// static -std::string HippoGridInfo::sanitizeGridNick(std::string &gridnick) -{ - std::string tmp; - int size = gridnick.size(); - for (int i=0; igetGridNick(); + const std::string& nick = grid->getGridName(); if (nick == "") { llwarns << "Ignoring to try adding grid with empty nick." << llendl; @@ -925,16 +886,16 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer) { mDefaultGridsVersion = gridMap["default_grids_version"]; } - else if (gridMap.has("gridnick") && gridMap.has("loginuri")) + else if (gridMap.has("gridname") && gridMap.has("loginuri")) { - std::string gridnick = gridMap["gridnick"]; + std::string gridname = gridMap["gridname"]; HippoGridInfo* grid; - GridIterator it = mGridInfo.find(gridnick); + GridIterator it = mGridInfo.find(gridname); bool newGrid = (it == mGridInfo.end()); if (newGrid) { // create new grid info - grid = new HippoGridInfo(gridnick); + grid = new HippoGridInfo(gridname); } else { @@ -977,7 +938,6 @@ void HippoGridManager::saveFile() for (it = mGridInfo.begin(); it != end; ++it, i++) { HippoGridInfo* grid = it->second; - gridInfo[i]["gridnick"] = grid->getGridNick(); gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform()); gridInfo[i]["gridname"] = grid->getGridName(); gridInfo[i]["loginuri"] = grid->getLoginUri(); diff --git a/indra/newview/hippogridmanager.h b/indra/newview/hippogridmanager.h index aa919d039..a5b26415d 100644 --- a/indra/newview/hippogridmanager.h +++ b/indra/newview/hippogridmanager.h @@ -34,12 +34,11 @@ public: SEARCH_ALL_TEMPLATE }; - explicit HippoGridInfo(const std::string& gridNick); + explicit HippoGridInfo(const std::string& gridName); Platform getPlatform(); bool isOpenSimulator() const; bool isSecondLife() const; - const std::string& getGridNick() const; const std::string& getGridName() const; const std::string& getGridOwner() const; const std::string& getLoginUri() const; @@ -95,14 +94,12 @@ public: bool retrieveGridInfo(); static const char* getPlatformString(Platform platform); - static std::string sanitizeGridNick(std::string &gridnick); static HippoGridInfo FALLBACK_GRIDINFO; static void initFallback(); private: Platform mPlatform; - std::string mGridNick; std::string mGridName; std::string mLoginUri; std::string mLoginPage; @@ -128,7 +125,7 @@ private: // for parsing grid info XML enum XmlState { - XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME, + XML_VOID, XML_PLATFORM, XML_GRIDNAME, XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI, XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH, XML_MESSAGE }; diff --git a/indra/newview/hippopanelgrids.cpp b/indra/newview/hippopanelgrids.cpp index b647c0d8e..e6c363a66 100644 --- a/indra/newview/hippopanelgrids.cpp +++ b/indra/newview/hippopanelgrids.cpp @@ -119,7 +119,6 @@ HippoPanelGridsImpl::~HippoPanelGridsImpl() BOOL HippoPanelGridsImpl::postBuild() { requires("grid_selector"); - requires("gridnick"); requires("platform"); requires("gridname"); requires("loginuri"); @@ -176,7 +175,7 @@ void HippoPanelGridsImpl::refresh() } HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid(); for (it = gHippoGridManager->beginGrid(); it != end; ++it) { - const std::string &grid = it->second->getGridNick(); + const std::string &grid = it->second->getGridName(); if (grid != defaultGrid) { grids->add(grid); if (grid == mCurGrid) selectIndex = i; @@ -198,13 +197,13 @@ void HippoPanelGridsImpl::refresh() childSetEnabled("btn_delete", (selectIndex >= 0)); childSetEnabled("btn_copy", (mState == NORMAL) && (selectIndex >= 0)); childSetEnabled("btn_default", (mState == NORMAL) && (selectIndex > 0)); - childSetEnabled("gridnick", (mState == ADD_NEW) || (mState == ADD_COPY)); + childSetEnabled("gridname", (mState == ADD_NEW) || (mState == ADD_COPY)); if (childGetValue("platform").asString() == "SecondLife") { // disable platform selector, if logged into the grid edited and it is SL // so object export restrictions cannot be circumvented by changing the platform bool enablePlatform = (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) || - (mCurGrid != gHippoGridManager->getConnectedGrid()->getGridNick()); + (mCurGrid != gHippoGridManager->getConnectedGrid()->getGridName()); childSetEnabled("platform", enablePlatform); childSetEnabled("search", false); childSetText("search", LLStringExplicit("")); @@ -232,7 +231,7 @@ void HippoPanelGridsImpl::apply() gHippoGridManager->saveFile(); refresh(); // update render compatibility - if (mCurGrid == gHippoGridManager->getConnectedGrid()->getGridNick()) + if (mCurGrid == gHippoGridManager->getConnectedGrid()->getGridName()) gHippoLimits->setLimits(); } @@ -250,7 +249,6 @@ void HippoPanelGridsImpl::loadCurGrid() { HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid); if (gridInfo && (mState != ADD_NEW)) { - childSetText("gridnick", gridInfo->getGridNick()); LLComboBox *platform = getChild("platform"); if (platform) platform->setCurrentByIndex(gridInfo->getPlatform()); childSetText("gridname", gridInfo->getGridName()); @@ -264,7 +262,6 @@ void HippoPanelGridsImpl::loadCurGrid() childSetValue("render_compat", gridInfo->isRenderCompat()); } else { std::string empty = ""; - childSetText("gridnick", empty); LLComboBox *platform = getChild("platform"); if (platform) platform->setCurrentByIndex(HippoGridInfo::PLATFORM_OTHER); childSetText("gridname", empty); @@ -281,10 +278,10 @@ void HippoPanelGridsImpl::loadCurGrid() if (mState == ADD_NEW) { std::string required = ""; - childSetText("gridnick", required); + childSetText("gridname", required); childSetText("loginuri", required); } else if (mState == ADD_COPY) { - childSetText("gridnick", std::string("")); + childSetText("gridname", std::string("")); } else if (mState != NORMAL) { llwarns << "Illegal state " << mState << '.' << llendl; } @@ -300,21 +297,21 @@ bool HippoPanelGridsImpl::saveCurGrid() if (mState == NORMAL) { gridInfo = gHippoGridManager->getGrid(mCurGrid); - + gridInfo->retrieveGridInfo(); + refresh(); } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) { // check nickname - std::string gridnick = childGetValue("gridnick"); - if (gridnick == "") gridnick = ""; - HippoGridInfo::sanitizeGridNick(gridnick); - childSetValue("gridnick", (gridnick != "")? gridnick: ""); - if (gridnick == "") { + std::string gridname = childGetValue("gridname"); + if (gridname == "") gridname = ""; + childSetValue("gridname", (gridname != "")? gridname: ""); + if (gridname == "") { LLNotifications::instance().add("GridsNoNick"); return false; } - if (gHippoGridManager->getGrid(gridnick)) { + if (gHippoGridManager->getGrid(gridname)) { LLSD args; - args["NAME"] = gridnick; + args["NAME"] = gridname; LLNotifications::instance().add("GridExists", args); return false; } @@ -323,18 +320,16 @@ bool HippoPanelGridsImpl::saveCurGrid() std::string loginuri = childGetValue("loginuri"); if ((loginuri == "") || (loginuri == "")) { LLSD args; - args["NAME"] = gridnick; + args["NAME"] = gridname; LLNotifications::instance().add("GridsNoLoginUri", args); return false; } mState = NORMAL; - mCurGrid = gridnick; - gridInfo = new HippoGridInfo(gridnick); + mCurGrid = gridname; + gridInfo = new HippoGridInfo(gridname); gHippoGridManager->addGrid(gridInfo); gridInfo->retrieveGridInfo(); - refresh(); - return true; } else { llwarns << "Illegal state " << mState << '.' << llendl; @@ -346,12 +341,7 @@ bool HippoPanelGridsImpl::saveCurGrid() llwarns << "Grid not found, ignoring changes." << llendl; return true; } - - if (gridInfo->getGridNick() != childGetValue("gridnick").asString()) { - llwarns << "Grid nickname mismatch, ignoring changes." << llendl; - return true; - } - + gridInfo->setPlatform(childGetValue("platform")); gridInfo->setGridName(childGetValue("gridname")); gridInfo->setLoginUri(childGetValue("loginuri")); @@ -406,7 +396,6 @@ void HippoPanelGridsImpl::retrieveGridInfo() grid->setLoginUri(loginuri); if (grid->retrieveGridInfo()) { - if (grid->getGridNick() != "") childSetText("gridnick", grid->getGridNick()); if (grid->getPlatform() != HippoGridInfo::PLATFORM_OTHER) getChild("platform")->setCurrentByIndex(grid->getPlatform()); if (grid->getGridName() != "") childSetText("gridname", grid->getGridName()); @@ -418,6 +407,7 @@ void HippoPanelGridsImpl::retrieveGridInfo() if (grid->getRegisterUrl() != "") childSetText("register", grid->getRegisterUrl()); if (grid->getPasswordUrl() != "") childSetText("password", grid->getPasswordUrl()); if (grid->getSearchUrl() != "") childSetText("search", grid->getSearchUrl()); + if (grid->getGridMessage() != "") childSetText("gridmessage", grid->getGridMessage()); } else { LLNotifications::instance().add("GridInfoError"); } diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 952b5d168..0bd2ba83d 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -145,8 +145,7 @@ LLFloaterAbout::LLFloaterAbout() std::string support; support.append("\n\n"); - support.append("Grid: " + gHippoGridManager->getConnectedGrid()->getGridName() - + " (" + gHippoGridManager->getConnectedGrid()->getGridNick() + ")\n\n"); + support.append("Grid: " + gHippoGridManager->getConnectedGrid()->getGridName() + "\n\n"); #if LL_MSVC support.append(llformat("Built with MSVC version %d\n\n", _MSC_VER)); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 29a73f8cd..c0251cac7 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -860,7 +860,7 @@ void LLPanelLogin::updateGridCombo() } HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid(); for (it = gHippoGridManager->beginGrid(); it != end; ++it) { - const std::string &grid = it->second->getGridNick(); + const std::string &grid = it->second->getGridName(); if (grid != defaultGrid) { grids->add(grid); if (grid == currentGrid) selectIndex = i; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a89b333ed..cc9f7adfe 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1588,7 +1588,7 @@ bool idle_startup() std::string history_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg2.xml"); LLSavedLogins history_data = LLSavedLogins::loadFile(history_file); - std::string grid_nick = gHippoGridManager->getConnectedGrid()->getGridNick(); + std::string grid_nick = gHippoGridManager->getConnectedGrid()->getGridName(); history_data.deleteEntry(firstname, lastname, grid_nick); if (gSavedSettings.getBOOL("RememberLogin")) { diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 2ef8f6973..a2625495c 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -52,7 +52,7 @@ void LLViewerLogin::getLoginURIs(std::vector& uris) const const std::string &LLViewerLogin::getGridLabel() const { - return gHippoGridManager->getConnectedGrid()->getGridNick(); + return gHippoGridManager->getConnectedGrid()->getGridName(); } const std::string &LLViewerLogin::getLoginPage() const diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 7249a8689..6d18fbc66 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -431,7 +431,7 @@ void LLXMLRPCTransaction::Impl::setStatus(Status status, mStatusMessage = "Despite our best efforts, something unexpected has gone wrong. \n" " \n" - "Please check " + gHippoGridManager->getCurrentGrid()->getGridNick() + "'s status \n" + "Please check " + gHippoGridManager->getCurrentGrid()->getGridName() + "'s status \n" "to see if there is a known problem with the service."; //mStatusURI = "http://secondlife.com/status/"; @@ -449,7 +449,7 @@ void LLXMLRPCTransaction::Impl::setCurlStatus(CURLcode code) case CURLE_COULDNT_RESOLVE_HOST: message = "DNS could not resolve the host name.\n" - "Please verify that you can connect to " + gHippoGridManager->getCurrentGrid()->getGridNick() + "'s\n" + "Please verify that you can connect to " + gHippoGridManager->getCurrentGrid()->getGridName() + "'s\n" "web site. If you can, but continue to receive this error,\n" "please go to the support section and report this problem."; break; @@ -458,7 +458,7 @@ void LLXMLRPCTransaction::Impl::setCurlStatus(CURLcode code) message = "The login server couldn't verify itself via SSL.\n" "If you continue to receive this error, please go\n" - "to the Support section of " + gHippoGridManager->getCurrentGrid()->getGridNick() + "'s web site\n" + "to the Support section of " + gHippoGridManager->getCurrentGrid()->getGridName() + "'s web site\n" "and report the problem."; break; @@ -470,7 +470,7 @@ void LLXMLRPCTransaction::Impl::setCurlStatus(CURLcode code) "are set correctly.\n" "\n" "If you continue to receive this error, please go\n" - "to the Support section of " + gHippoGridManager->getCurrentGrid()->getGridNick() + "'s web site\n" + "to the Support section of " + gHippoGridManager->getCurrentGrid()->getGridName() + "'s web site\n" "and report the problem."; break; diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_grids.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_grids.xml index 3f71b34be..f3195e5e7 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_grids.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_grids.xml @@ -82,22 +82,6 @@ - - - Grid Nickname: - -