From f7df6f323e4746abae0a0858cb7ef56bedbb94ca Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 15 Apr 2011 21:07:29 -0700 Subject: Updated the grid manager to save names and passwords along with grid info. This commit includes the following: * Fixed missing GPL headers from hippo grid manager * Fixed grids named or "" being saved in the list * Fixed grid manager list only showing grid nicks, not grid names * Fixed grid names not settable in the grid manager * Grid manager now remembers avatar names and passwords * Usernames can now be set in the grid manager for SL (needs work) * Fixed grid manager being stuck in an updating state * Some general code cleanup --- linden/indra/newview/floatergriddefault.cpp | 57 +- linden/indra/newview/floatergriddefault.h | 3 + linden/indra/newview/floatergridmanager.cpp | 864 ++++++++++----------- linden/indra/newview/floatergridmanager.h | 96 +-- linden/indra/newview/hippogridmanager.cpp | 387 ++++----- linden/indra/newview/hippogridmanager.h | 171 ++-- linden/indra/newview/llappviewer.cpp | 4 +- linden/indra/newview/llpaneldirfind.cpp | 12 +- linden/indra/newview/llpanellogin.cpp | 75 +- linden/indra/newview/llstartup.cpp | 96 ++- linden/indra/newview/llviewernetwork.cpp | 6 +- linden/indra/newview/llxmlrpctransaction.cpp | 10 +- .../xui/en-us/floater_grid_default_selector.xml | 5 +- .../default/xui/en-us/floater_grid_manager.xml | 229 +++--- .../skins/default/xui/en-us/notifications.xml | 25 +- 15 files changed, 989 insertions(+), 1051 deletions(-) diff --git a/linden/indra/newview/floatergriddefault.cpp b/linden/indra/newview/floatergriddefault.cpp index 6a2526d..b89674f 100644 --- a/linden/indra/newview/floatergriddefault.cpp +++ b/linden/indra/newview/floatergriddefault.cpp @@ -49,26 +49,7 @@ FloaterGridDefault::~FloaterGridDefault() BOOL FloaterGridDefault::postBuild() { // populate the grid chooser - LLScrollListCtrl* grid_list = getChild("grid_list"); - grid_list->deleteAllItems(); - - LLSD element; - - for (HippoGridManager::GridIterator it = gHippoGridManager->beginGrid(); it != gHippoGridManager->endGrid(); ++it) - { - std::string grid_nick = it->second->getGridNick(); - // There's no reason why empty grids nicks should be in this list, ugh - if (!grid_nick.empty()) - { - element["id"] = grid_nick; - element["columns"][0]["column"] = "grid"; - element["columns"][0]["type"] = "text"; - element["columns"][0]["value"] = grid_nick; - grid_list->addElement(element, ADD_BOTTOM); - } - } - - grid_list->setFocus(TRUE); + refreshGridList(); childSetAction("btn_ok", onClickOK, this); childSetAction("btn_cancel", onClickCancel, this); @@ -99,3 +80,39 @@ void FloaterGridDefault::onClickCancel(void* userdata) FloaterGridDefault* self = (FloaterGridDefault*)userdata; self->close(); } + +// static +void FloaterGridDefault::refreshGridList() +{ + LLScrollListCtrl* grid_list = FloaterGridDefault::getInstance()->getChild("grid_list"); + if (grid_list) + { + grid_list->deleteAllItems(); + + LLSD element; + + for (HippoGridManager::GridIterator it = gHippoGridManager->beginGrid(); + it != gHippoGridManager->endGrid(); ++it) + { + std::string grid_nick = it->second->getGridNick(); + // There's no reason why empty grids nicks should be in this list... + if (grid_nick.empty()) + { + continue; + } + else + { + element["id"] = grid_nick; + element["columns"][0]["column"] = "grid_nick"; + element["columns"][0]["type"] = "text"; + element["columns"][0]["value"] = grid_nick; + element["columns"][1]["column"] = "grid_name"; + element["columns"][1]["type"] = "text"; + element["columns"][1]["value"] = it->second->getGridName(); + grid_list->addElement(element, ADD_BOTTOM); + } + } + + grid_list->setFocus(TRUE); + } +} diff --git a/linden/indra/newview/floatergriddefault.h b/linden/indra/newview/floatergriddefault.h index 009e23f..5c07efe 100644 --- a/linden/indra/newview/floatergriddefault.h +++ b/linden/indra/newview/floatergriddefault.h @@ -41,6 +41,9 @@ public: /*virtual*/ BOOL postBuild(); + // refresh the default grid list selection. Steals focus + void refreshGridList(); + private: static void onClickOK(void* userdata); static void onClickCancel(void* userdata); diff --git a/linden/indra/newview/floatergridmanager.cpp b/linden/indra/newview/floatergridmanager.cpp index 298fe35..ad6ea05 100644 --- a/linden/indra/newview/floatergridmanager.cpp +++ b/linden/indra/newview/floatergridmanager.cpp @@ -1,54 +1,68 @@ -/* - * floatergridmanager.cpp - * This is Meerkats grid manager. - * -Patrick Sapinski (Monday, August 17, 2009) - * - * Modified by McCabe Maxsted for Imprudence - */ +/** +* @file floatergridmanager.cpp +* @brief UI for managing grid information +* +* $LicenseInfo:firstyear=2011&license=viewergpl$ +* +* Copyright (c) 2011, McCabe Maxsted +* based on Meerkat's grid manager by Patrick Sapinski +* +* Imprudence Viewer Source Code +* The source code in this file ("Source Code") is provided to you +* under the terms of the GNU General Public License, version 2.0 +* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in +* this distribution, or online at +* http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ #include "llviewerprecompiledheaders.h" #include "floatergridmanager.h" #include +#include "floatergriddefault.h" #include "llviewercontrol.h" #include "llcombobox.h" #include "llscrolllistctrl.h" #include "llmd5.h" +#include "llnotifications.h" #include "llurlsimstring.h" #include "lluictrlfactory.h" #include "hippogridmanager.h" #include "llviewernetwork.h" #include "llpanellogin.h" -#define PASSWORD_FILLER "123456789!123456" - -LoginController* FloaterGridManager::sController = NULL; -bool FloaterGridManager::sIsInitialLogin; -std::string FloaterGridManager::sGrid; +const std::string PASSWORD_FILLER = "123456789!123456"; +//bool FloaterGridManager::sIsInitialLogin; FloaterGridManager::FloaterGridManager(const LLSD& key) -: mState(NORMAL), - mCurGrid(gHippoGridManager->getCurrentGridNick()), - mIncomingPassword(""), + : + mState(GRID_STATE_NORMAL), + mCurGrid(""), mMungedPassword("") { llinfos << "Opening grid manager" << llendl; LLUICtrlFactory::getInstance()->buildFloater(this, "floater_grid_manager.xml"); center(); - - LLLineEditor* edit = getChild("avatar_password_edit"); - if (edit) - { - edit->setDrawAsterixes(TRUE); - } } - FloaterGridManager::~FloaterGridManager() { - FloaterGridManager::sController = NULL; } BOOL FloaterGridManager::postBuild() @@ -64,105 +78,117 @@ BOOL FloaterGridManager::postBuild() childSetAction("btn_copy", onClickCopy, this); childSetAction("btn_ok", onClickOk, this); childSetAction("btn_apply", onClickApply, this); - // childSetAction("set_default", onClickDefault, this); // We use the last selected grid as the default childSetAction("btn_cancel", onClickCancel, this); childSetAction("btn_clear", onClickClear, this); childSetAction("btn_gridinfo", onClickGridInfo, this); - // childSetAction("btn_help_render_compat", onClickHelpRenderCompat, this); // Ugly ugly ugly childSetCommitCallback("grid_selector", onSelectGrid, this); LLScrollListCtrl* combo = getChild("grid_selector"); combo->setFocus(TRUE); + clearGridInfo(true); + refreshGrids(); - return TRUE; -} + // We use the last selected grid as the default + HippoGridInfo* first_selected = gHippoGridManager->getGrid(mCurGrid); + if (first_selected) + { + getChild("first_name")->setVisible(!first_selected->isUsernameCompat()); + getChild("last_name")->setVisible(!first_selected->isUsernameCompat()); + getChild("username")->setVisible(first_selected->isUsernameCompat()); + } + getChild("gridnick")->setEnabled(false); -void FloaterGridManager::clearInfo() -{ - //getChild("grid_selector")->clear(); - //getChild("gridnick")->clear(); - //getChild("gridname")->clear(); - //getChild("loginuri")->clear(); - getChild("loginpage")->clear(); - getChild("helperuri")->clear(); - getChild("website")->clear(); - getChild("support")->clear(); - getChild("register")->clear(); - getChild("password")->clear(); - //getChild("first_name")->clear(); - //getChild("last_name")->clear(); - //getChild("avatar_password")->clear(); - getChild("search")->clear(); - //getChild("btn_delete"); - //getChild("btn_add") - //getChild("btn_copy"); - //getChild("set_default")->setEnabled(FALSE); - getChild("btn_gridinfo")->setEnabled(TRUE); - //getChild("btn_clear"); - //getChild("btn_help_render_compat")->setEnabled(FALSE); + return TRUE; } void FloaterGridManager::draw() { refresh(); - LLFloater::draw(); } void FloaterGridManager::refresh() { - //TODO: these should just be set in a prompt - bool can_edit = (!getChild("gridnick")->getText().empty() && - !getChild("loginuri")->getText().empty() && - getChild("gridnick")->getText() != "" && - getChild("loginuri")->getText() != ""); + //TODO: new grid creation should just be set in a popup + bool can_edit = (!(getChild("gridnick")->getText().empty()) && + !(getChild("gridname")->getText().empty()) && + !(getChild("loginuri")->getText().empty())); - //getChild("gridname"); getChild("loginpage")->setEnabled(can_edit); getChild("helperuri")->setEnabled(can_edit); getChild("website")->setEnabled(can_edit); getChild("support")->setEnabled(can_edit); getChild("register")->setEnabled(can_edit); getChild("password")->setEnabled(can_edit); - //getChild("first_name")->setEnabled(can_edit); - //getChild("last_name")->setEnabled(can_edit); - //getChild("avatar_password")->setEnabled(can_edit); + getChild("first_name")->setEnabled(can_edit); + getChild("last_name")->setEnabled(can_edit); + getChild("username")->setEnabled(can_edit); + getChild("avatar_password")->setEnabled(can_edit); getChild("search")->setEnabled(can_edit); getChild("btn_delete")->setEnabled(can_edit); - //getChild("btn_add") //getChild("btn_copy")->setEnabled(can_edit); - //getChild("set_default")->setEnabled(can_dit); getChild("btn_gridinfo")->setEnabled(can_edit); getChild("btn_clear")->setEnabled(can_edit); - //getChild("btn_help_render_compat")->setEnabled(can_edit); + + getChild("loginpage_text")->setEnabled(can_edit); + getChild("helperuri_text")->setEnabled(can_edit); + getChild("website_text")->setEnabled(can_edit); + getChild("support_text")->setEnabled(can_edit); + getChild("register_text")->setEnabled(can_edit); + getChild("password_text")->setEnabled(can_edit); + getChild("first_name_text")->setEnabled(can_edit); + getChild("last_name_text")->setEnabled(can_edit); + getChild("username_text")->setEnabled(can_edit); + getChild("avatar_password_text")->setEnabled(can_edit); + getChild("search_text")->setEnabled(can_edit); } void FloaterGridManager::refreshGrids() { - LLScrollListCtrl *grids = FloaterGridManager::getInstance()->getChild("grid_selector"); + // no need to update the list while editing + if (FloaterGridManager::getInstance()->getGridState() >= GRID_STATE_NEW) + { + return; + } + + LLScrollListCtrl* grid_list = FloaterGridManager::getInstance()->getChild("grid_selector"); std::string lastSelectedItem; LLSD element; - if (grids->getFirstSelected()) + if (grid_list->getFirstSelected()) { - lastSelectedItem = grids->getFirstSelected()->getValue().asString(); + // grid NICK + lastSelectedItem = grid_list->getFirstSelected()->getColumn(0)->getValue().asString(); } - grids->deleteAllItems(); + grid_list->deleteAllItems(); - for (HippoGridManager::GridIterator it = gHippoGridManager->beginGrid(); it != gHippoGridManager->endGrid(); ++it) + // Grids should really have UUIDs, but we'll use their nicks to keep track of 'em instead + for (HippoGridManager::GridIterator it = gHippoGridManager->beginGrid(); + it != gHippoGridManager->endGrid(); ++it) { std::string grid_nick = it->second->getGridNick(); - // There's no reason why empty grids nicks should be in this list, ugh - if (!grid_nick.empty() && grid_nick != gHippoGridManager->getCurrentGridNick()) + + if (grid_nick.empty()) + { + // shouldn't ever happen + continue; + } + + // Note: default sorted by grid NAME in the XUI + if (grid_nick != gHippoGridManager->getCurrentGridNick()) { element["id"] = grid_nick; - element["columns"][0]["column"] = "grid"; + element["columns"][0]["column"] = "grid_nick"; element["columns"][0]["type"] = "text"; element["columns"][0]["value"] = grid_nick; - grids->addElement(element, ADD_BOTTOM); + element["columns"][1]["column"] = "grid_name"; + element["columns"][1]["type"] = "text"; + element["columns"][1]["value"] = it->second->getGridName(); + + grid_list->addElement(element, ADD_BOTTOM); } } @@ -172,368 +198,359 @@ void FloaterGridManager::refreshGrids() if (!gHippoGridManager->getCurrentGridNick().empty()) { element["id"] = gHippoGridManager->getCurrentGridNick(); - element["columns"][0]["column"] = "grid"; + element["columns"][0]["column"] = "grid_nick"; element["columns"][0]["type"] = "text"; element["columns"][0]["font-style"] = "BOLD"; element["columns"][0]["value"] = gHippoGridManager->getCurrentGridNick(); - grids->addElement(element, ADD_TOP); + element["columns"][1]["column"] = "grid_name"; + element["columns"][1]["type"] = "text"; + element["columns"][1]["value"] = gHippoGridManager->getCurrentGrid()->getGridName(); + + grid_list->addElement(element, ADD_TOP); } // Reselect the item if we had one selected if (lastSelectedItem.empty()) { - grids->selectItemByLabel(gHippoGridManager->getCurrentGridNick()); + grid_list->selectItemByLabel(gHippoGridManager->getCurrentGridNick()); + FloaterGridManager::getInstance()->setCurGrid(gHippoGridManager->getCurrentGridNick()); } else { - grids->selectItemByLabel(lastSelectedItem); - } - - // TODO: get rid of all this state junk - if ((FloaterGridManager::getInstance()->getState() == ADD_NEW) || (FloaterGridManager::getInstance()->getState() == ADD_COPY)) - { - grids->addElement("", ADD_BOTTOM); + grid_list->selectItemByLabel(lastSelectedItem); + FloaterGridManager::getInstance()->setCurGrid(lastSelectedItem); } //if (selectIndex >= 0) //{ - // grids->setCurrentByIndex(selectIndex); + // grid_list->setCurrentByIndex(selectIndex); //} //else //{ - // grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label + // grid_list->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label //} - - // FloaterGridManager::getInstance()->childSetTextArg("default_grid", "[DEFAULT]", (defaultGrid != "")? defaultGrid: " "); - FloaterGridManager::getInstance()->childSetEnabled("btn_delete", grids->getItemCount() > 0); + FloaterGridManager::getInstance()->childSetEnabled("btn_delete", grid_list->getItemCount() > 0); + FloaterGridManager::getInstance()->childSetEnabled("btn_copy", grid_list->getItemCount() > 0); - FloaterGridManager::getInstance()->childSetEnabled("btn_copy", (FloaterGridManager::getInstance()->getState() == NORMAL) && (grids->getItemCount() > 0)); - // FloaterGridManager::getInstance()->childSetEnabled("set_default", (FloaterGridManager::getInstance()->getState() == NORMAL) && (grids->getItemCount() > 0)); - FloaterGridManager::getInstance()->childSetEnabled("gridnick", (FloaterGridManager::getInstance()->getState() == ADD_NEW) || (FloaterGridManager::getInstance()->getState() == ADD_COPY)); - - if (FloaterGridManager::getInstance()->getState() == NORMAL) + HippoGridInfo *gridInfo = gHippoGridManager->getGrid(FloaterGridManager::getInstance()->mCurGrid); + if (gridInfo) { - HippoGridInfo *gridInfo = gHippoGridManager->getGrid(FloaterGridManager::getInstance()->getCurGrid()); - if (gridInfo) + // Remember: NEVER let users change an existing grid's nick. Bad juju awaits if you do + FloaterGridManager::getInstance()->getChild("gridnick")->setText(gridInfo->getGridNick()); + FloaterGridManager::getInstance()->getChild("gridname")->setText(gridInfo->getGridName()); + + FloaterGridManager::getInstance()->getChild("loginuri")->setText(gridInfo->getLoginURI()); + FloaterGridManager::getInstance()->getChild("loginpage")->setText(gridInfo->getLoginPage()); + FloaterGridManager::getInstance()->getChild("helperuri")->setText(gridInfo->getHelperURI()); + FloaterGridManager::getInstance()->getChild("website")->setText(gridInfo->getWebSite()); + FloaterGridManager::getInstance()->getChild("support")->setText(gridInfo->getSupportURL()); + FloaterGridManager::getInstance()->getChild("register")->setText(gridInfo->getRegisterURL()); + FloaterGridManager::getInstance()->getChild("password")->setText(gridInfo->getPasswordURL()); + FloaterGridManager::getInstance()->getChild("first_name")->setText(gridInfo->getFirstName()); + FloaterGridManager::getInstance()->getChild("last_name")->setText(gridInfo->getLastName()); + FloaterGridManager::getInstance()->getChild("username")->setText(gridInfo->getUsername()); + FloaterGridManager::getInstance()->getChild("avatar_password")->setText(gridInfo->getAvatarPassword()); + + FloaterGridManager::getInstance()->getChild("first_name")->setVisible(!gridInfo->isUsernameCompat()); + FloaterGridManager::getInstance()->getChild("first_name_text")->setVisible(!gridInfo->isUsernameCompat()); + FloaterGridManager::getInstance()->getChild("last_name")->setVisible(!gridInfo->isUsernameCompat()); + FloaterGridManager::getInstance()->getChild("last_name_text")->setVisible(!gridInfo->isUsernameCompat()); + FloaterGridManager::getInstance()->getChild("username")->setVisible(gridInfo->isUsernameCompat()); + FloaterGridManager::getInstance()->getChild("username_text")->setVisible(gridInfo->isUsernameCompat()); + + if (gridInfo->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) { - FloaterGridManager::getInstance()->childSetText("gridnick", gridInfo->getGridNick()); - //FloaterGridManager::getInstance()->childSetText("grid_name", gridInfo->getGridName()); - FloaterGridManager::getInstance()->childSetText("loginuri", gridInfo->getLoginUri()); - FloaterGridManager::getInstance()->childSetText("loginpage", gridInfo->getLoginPage()); - FloaterGridManager::getInstance()->childSetText("helperuri", gridInfo->getHelperUri()); - FloaterGridManager::getInstance()->childSetText("website", gridInfo->getWebSite()); - FloaterGridManager::getInstance()->childSetText("support", gridInfo->getSupportUrl()); - FloaterGridManager::getInstance()->childSetText("register", gridInfo->getRegisterUrl()); - FloaterGridManager::getInstance()->childSetText("password", gridInfo->getPasswordUrl()); - - // FloaterGridManager::getInstance()->childSetText("first_name", gridInfo->getFirstName()); - // FloaterGridManager::getInstance()->childSetText("last_name", gridInfo->getLastName()); - // if(gridInfo->getAvatarPassword().length() == 32) - // FloaterGridManager::getInstance()->childSetText("avatar_password", std::string(PASSWORD_FILLER)); - // else if(gridInfo->getPasswordUrl().empty()) - // FloaterGridManager::getInstance()->childSetText("avatar_password", std::string("")); - - if (gridInfo->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) - { - FloaterGridManager::getInstance()->childSetEnabled("search", false); - FloaterGridManager::getInstance()->childSetText("search", LLStringUtil::null); - //childSetEnabled("render_compat", false); - //childSetValue("render_compat", false); - } - else - { - FloaterGridManager::getInstance()->childSetEnabled("search", true); - FloaterGridManager::getInstance()->childSetText("search", gridInfo->getSearchUrl()); - //childSetEnabled("render_compat", true); - //childSetValue("render_compat", gridInfo->isRenderCompat()); - } - - } + FloaterGridManager::getInstance()->childSetEnabled("search", false); + FloaterGridManager::getInstance()->getChild("search")->setText(LLStringExplicit("")); + } else { - FloaterGridManager::getInstance()->childSetText("gridnick", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("gridname", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("loginuri", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("loginpage", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("helperuri", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("website", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("support", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("register", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("password", LLStringUtil::null); - // FloaterGridManager::getInstance()->childSetText("first_name", LLStringUtil::null); - // FloaterGridManager::getInstance()->childSetText("last_name", LLStringUtil::null); - // FloaterGridManager::getInstance()->childSetText("avatar_password", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("search", LLStringUtil::null); - } - } - else if (FloaterGridManager::getInstance()->getState() == ADD_NEW) - { - llinfos << "mState == ADD_NEW" << llendl; - std::string required = ""; - FloaterGridManager::getInstance()->childSetText("gridnick", required); - FloaterGridManager::getInstance()->childSetText("gridname", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("loginuri", required); - FloaterGridManager::getInstance()->childSetText("loginpage", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("helperuri", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("website", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("support", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("register", LLStringUtil::null); - FloaterGridManager::getInstance()->childSetText("password", LLStringUtil::null); - // FloaterGridManager::getInstance()->childSetText("first_name", LLStringUtil::null); - // FloaterGridManager::getInstance()->childSetText("last_name", LLStringUtil::null); - // FloaterGridManager::getInstance()->childSetText("avatar_password", LLStringUtil::null); - //childSetEnabled("search", true); - FloaterGridManager::getInstance()->childSetText("search", LLStringUtil::null); - } - else if (FloaterGridManager::getInstance()->getState() == ADD_COPY) - { - llinfos << "mState == ADD_COPY" << llendl; - FloaterGridManager::getInstance()->childSetText("gridnick", LLStringExplicit("")); - } + FloaterGridManager::getInstance()->childSetEnabled("search", true); + FloaterGridManager::getInstance()->getChild("search")->setText(gridInfo->getSearchURL()); + } + } else { - llwarns << "Illegal state " << FloaterGridManager::getInstance()->getState() << llendl; + // should never happen, but if so default to creating a new entry + FloaterGridManager::getInstance()->setupNewGridEntry(); } - return; -} +} void FloaterGridManager::update() { - setState(NORMAL); - setCurGrid(gHippoGridManager->getCurrentGridNick()); + // no need to update the list until we need to + if (getGridState() >= GRID_STATE_NEW) + { + return; + } refreshGrids(); - //KOW gHippoLimits->setLimits(); } void FloaterGridManager::applyChanges() -{ - HippoGridInfo* gridInfo = gHippoGridManager->getGrid(mCurGrid); - if (gridInfo) +{ + // When we apply changes, we update based on the state + // of the UI. This is ugly and could really be improved + + // Note: nick and loginuri are required + std::string grid_nick = childGetValue("gridnick").asString(); + if (grid_nick.empty()) + { + LLNotifications::instance().add("GridsNoNick"); + return; + } + + if (childGetValue("loginuri").asString().empty()) + { + LLSD args; + args["[NAME]"] = grid_nick; + LLNotifications::instance().add("GridsNoLoginURI", args); + return ; + } + + HippoGridInfo* grid = NULL; + + // Note: we disable the scroll list during grid creation to prevent conflicts + if (getGridState() == GRID_STATE_NEW || getGridState() == GRID_STATE_COPY) { - if (gridInfo->getGridNick() == childGetValue("gridnick").asString()) + if (gHippoGridManager->hasGridNick(grid_nick)) { - gridInfo->setGridName(childGetValue("gridname")); - gridInfo->setLoginUri(childGetValue("loginuri")); - gridInfo->setLoginPage(childGetValue("loginpage")); - gridInfo->setHelperUri(childGetValue("helperuri")); - gridInfo->setWebSite(childGetValue("website")); - gridInfo->setSupportUrl(childGetValue("support")); - gridInfo->setRegisterUrl(childGetValue("register")); - gridInfo->setPasswordUrl(childGetValue("password")); - gridInfo->setSearchUrl(childGetValue("search")); - gridInfo->setRenderCompat(childGetValue("render_compat")); - - // gridInfo->setFirstName(childGetValue("first_name")); - // gridInfo->setLastName(childGetValue("last_name")); - // if(childGetValue("avatar_password").asString().empty()) - // gridInfo->setAvatarPassword(std::string("")); - // else if(childGetValue("avatar_password").asString() != std::string(PASSWORD_FILLER)) - // { - // // store account authentication data - // std::string auth_password = childGetValue("avatar_password"); - // std::string hashed_password; - // hashPassword(auth_password, hashed_password); - // gridInfo->setAvatarPassword(hashed_password); - // } - - //this bug was a feature -Patrick Sapinski (Friday, August 21, 2009) - //LLPanelLogin::setFields(gridInfo->getFirstName(), gridInfo->getLastName(), - // gridInfo->getAvatarPassword(), true); - } - else + LLSD args; + args["[NAME]"] = grid_nick; + LLNotifications::instance().add("GridExists", args); + return; + } + else { - llwarns << "Grid nickname mismatch, ignoring changes." << llendl; + grid = new HippoGridInfo(grid_nick); + } + } + else // updating grid + { + if (!gHippoGridManager->hasGridNick(grid_nick)) + { + llwarns << "Can't update info for a grid we don't know, ignoring changes." << llendl; + return; + } + else + { + grid = gHippoGridManager->getGrid(grid_nick); } } -} + grid->setGridName(childGetValue("gridname")); + grid->setLoginURI(childGetValue("loginuri")); + grid->setLoginPage(childGetValue("loginpage")); + grid->setHelperURI(childGetValue("helperuri")); + grid->setWebSite(childGetValue("website")); + grid->setSupportURL(childGetValue("support")); + grid->setRegisterURL(childGetValue("register")); + grid->setPasswordURL(childGetValue("password")); + grid->setSearchURL(childGetValue("search")); + grid->setFirstName(childGetValue("first_name")); + grid->setLastName(childGetValue("last_name")); + grid->setUsername(childGetValue("username")); + + // don't allow users to set their password as PASSWORD_FILLER + // would be nice to get grid-specific rules on password formatting, too + // passwords are remembered by default + std::string password_new = childGetValue("avatar_password").asString(); + std::string password_old = grid->getAvatarPassword(); // initialized to "" + if (!password_new.empty() && password_new != PASSWORD_FILLER && password_new != password_old) + { + // store account authentication data + std::string hashed_password; + hashPassword(password_new, hashed_password); + grid->setAvatarPassword(hashed_password); + } -bool FloaterGridManager::createNewGrid() -{ - // check nickname - std::string gridnick = childGetValue("gridnick"); - if (gridnick == "") + FloaterGridManager::getInstance()->getChild("grid_selector")->setEnabled(true); + FloaterGridManager::getInstance()->getChild("gridnick")->setEnabled(false); + + if (getGridState() == GRID_STATE_NEW || getGridState() == GRID_STATE_COPY) { - gridnick = ""; + gHippoGridManager->addGrid(grid); + refreshGrids(); + FloaterGridManager::getInstance()->getChild("grid_selector")->selectByValue(LLSD(grid_nick)); } - if (gridnick.empty()) + // just in case + gHippoGridManager->setCurrentGrid(grid_nick); + + // should this be settable? + if (grid->isUsernameCompat()) { - LLNotifications::instance().add("GridsNoNick"); - return false; + LLPanelLogin::setFields(grid->getUsername(), grid->getAvatarPassword()); } - - if (gHippoGridManager->getGrid(gridnick)) + else { - LLSD args; - args["[NAME]"] = gridnick; - LLNotifications::instance().add("GridExists", args); - return false; + LLPanelLogin::setFields(grid->getFirstName(), grid->getLastName(), grid->getAvatarPassword()); } - // check login URI - std::string loginuri = childGetValue("loginuri"); - if ((loginuri.empty()) || (loginuri == "")) + if (FloaterGridDefault::instanceVisible()) { - LLSD args; - args["[NAME]"] = gridnick; - LLNotifications::instance().add("GridsNoLoginUri", args); - return false; + FloaterGridDefault::getInstance()->refreshGridList(); } - // create new grid - HippoGridInfo* grid = new HippoGridInfo(gridnick); - grid->setGridName(childGetValue("gridname")); - grid->setLoginUri(loginuri); - grid->setLoginPage(childGetValue("loginpage")); - grid->setHelperUri(childGetValue("helperuri")); - grid->setWebSite(childGetValue("website")); - grid->setSupportUrl(childGetValue("support")); - grid->setRegisterUrl(childGetValue("register")); - grid->setPasswordUrl(childGetValue("password")); - grid->setSearchUrl(childGetValue("search")); - grid->setRenderCompat(childGetValue("render_compat")); - gHippoGridManager->addGrid(grid); - - // grid->setFirstName(childGetValue("first_name")); - // grid->setLastName(childGetValue("last_name")); - // if(childGetValue("avatar_password").asString().empty()) - // grid->setAvatarPassword(std::string("")); - // else - // { - // std::string hashed_password; - // hashPassword(childGetValue("avatar_password"), hashed_password); - // grid->setAvatarPassword(hashed_password); - // } - - setCurGrid(gridnick); - return true; + setGridState(GRID_STATE_NORMAL); } -void FloaterGridManager::retrieveGridInfo() +void FloaterGridManager::clearGridInfo(bool clear_all) { - std::string loginuri = childGetValue("loginuri"); - if ((loginuri == "") || (loginuri == "")) - { - LLNotifications::instance().add("GridInfoNoLoginUri"); - return; + if (clear_all) + { + getChild("gridnick")->clear(); + getChild("gridname")->clear(); + getChild("loginuri")->clear(); + getChild("password")->clear(); + getChild("first_name")->clear(); + getChild("last_name")->clear(); + getChild("username")->clear(); + getChild("avatar_password")->clear(); } - HippoGridInfo* grid = 0; - bool cleanupGrid = false; + getChild("loginpage")->clear(); + getChild("helperuri")->clear(); + getChild("website")->clear(); + getChild("support")->clear(); + getChild("register")->clear(); + getChild("search")->clear(); + + getChild("btn_gridinfo")->setEnabled(TRUE); +} - if (mState == NORMAL) +void FloaterGridManager::createNewGrid() +{ + // warn us if anything's dirty + if (getChild("gridnick")->isDirty() || + getChild("gridname")->isDirty() || + getChild("loginuri")->isDirty() || + getChild("loginpage")->isDirty() || + getChild("helperuri")->isDirty() || + getChild("website")->isDirty() || + getChild("support")->isDirty() || + getChild("register")->isDirty() || + getChild("password")->isDirty() || + getChild("first_name")->isDirty() || + getChild("last_name")->isDirty() || + getChild("username")->isDirty() || + getChild("avatar_password")->isDirty() || + getChild("search")->isDirty()) + { + LLNotifications::instance().add("GridInfoDirty", LLSD(), LLSD(), newGridCreationCallback); + } + else { - grid = gHippoGridManager->getGrid(mCurGrid); - } - else if ((mState == ADD_NEW) || (mState == ADD_COPY)) + // This clears the form. Until an entry is entered, we keep the UI open and blank + // This is clearly undesirable if you want to cancel, but redoing this window is + // a WIP -- MC + setupNewGridEntry(); + } +} + +void FloaterGridManager::setupNewGridEntry() +{ + // disable scroll list until we can use it again + getChild("grid_selector")->setEnabled(false); + + getChild("gridnick")->setEnabled(true); + clearGridInfo(true); + + setGridState(GRID_STATE_NEW); +} + +bool FloaterGridManager::newGridCreationCallback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + if (option == 0) { - grid = new HippoGridInfo(""); - cleanupGrid = true; - } - else + FloaterGridManager::getInstance()->setupNewGridEntry(); + } + return false; +} + +void FloaterGridManager::setupCopyGridEntry() +{ + // disable scroll list until we can use it again + getChild("grid_selector")->setEnabled(false); + + getChild("gridnick")->setEnabled(true); + getChild("gridnick")->clear(); + getChild("gridname")->clear(); + getChild("loginuri")->clear(); + + setGridState(GRID_STATE_COPY); +} + +void FloaterGridManager::retrieveGridInfo() +{ + std::string loginuri = childGetValue("loginuri"); + if (loginuri.empty()) { - llerrs << "Illegal state " << mState << '.' << llendl; + LLNotifications::instance().add("GridInfoNoLoginURI"); return; } + + // this can be clicked even for grids we haven't saved yet + HippoGridInfo* grid = gHippoGridManager->getGrid(childGetValue("gridnick")); + bool del_temp_grid = false; if (!grid) { - llerrs << "Internal error retrieving grid info." << llendl; - return; + // easier than fixing the hippo grid manager + HippoGridInfo* temp = new HippoGridInfo(""); + if (temp) + { + del_temp_grid = true; + grid = temp; + } } - grid->setLoginUri(loginuri); + grid->setLoginURI(loginuri); if (grid->retrieveGridInfo()) { - if (grid->getGridNick() != "") childSetText("gridnick", grid->getGridNick()); - if (grid->getGridName() != "") childSetText("gridname", grid->getGridName()); - if (grid->getLoginUri() != "") childSetText("loginuri", grid->getLoginUri()); - if (grid->getLoginPage() != "") childSetText("loginpage", grid->getLoginPage()); - if (grid->getHelperUri() != "") childSetText("helperuri", grid->getHelperUri()); - if (grid->getWebSite() != "") childSetText("website", grid->getWebSite()); - if (grid->getSupportUrl() != "") childSetText("support", grid->getSupportUrl()); - if (grid->getRegisterUrl() != "") childSetText("register", grid->getRegisterUrl()); - if (grid->getPasswordUrl() != "") childSetText("password", grid->getPasswordUrl()); - if (grid->getSearchUrl() != "") childSetText("search", grid->getSearchUrl()); - } - else + // just in case + if (!(grid->getGridNick().empty())) + getChild("gridnick")->setText(grid->getGridNick()); + if (!(grid->getLoginURI().empty())) + getChild("loginuri")->setText(grid->getLoginURI()); + getChild("gridname")->setText(grid->getGridName()); + getChild("loginpage")->setText(grid->getLoginPage()); + getChild("helperuri")->setText(grid->getHelperURI()); + getChild("website")->setText(grid->getWebSite()); + getChild("support")->setText(grid->getSupportURL()); + getChild("register")->setText(grid->getRegisterURL()); + getChild("password")->setText(grid->getPasswordURL()); + getChild("search")->setText(grid->getSearchURL()); + } + else { LLNotifications::instance().add("GridInfoError"); } - - if (cleanupGrid) delete grid; + + if (del_temp_grid) + { + delete grid; + } } void FloaterGridManager::apply() { - if (mState == NORMAL) - { - applyChanges(); - } - else if ((mState == ADD_NEW) || (mState == ADD_COPY)) - { - if (!createNewGrid()) return; - } - else - { - llwarns << "Illegal state " << mState << '.' << llendl; - return; - } - //gHippoGridManager->setCurrentGrid(mCurGrid); - //gHippoGridManager->setDefaultGrid(mCurGrid); + // where all the magic happens! + applyChanges(); + gHippoGridManager->saveFile(); LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel()); } -//void FloaterGridManager::setDefault() -//{ -// if (mState == NORMAL) -// { -// applyChanges(); -// } -// else if ((mState == ADD_NEW) || (mState == ADD_COPY)) -// { -// if (!createNewGrid()) return; -// } -// else -// { -// llwarns << "Illegal state " << mState << '.' << llendl; -// return; -// } -// gHippoGridManager->setCurrentGrid(mCurGrid); -// gHippoGridManager->setDefaultGrid(mCurGrid); -// gHippoGridManager->saveFile(); -// LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel()); -//} - +// static void FloaterGridManager::onSelectGrid(LLUICtrl* ctrl, void* data) { FloaterGridManager* self = (FloaterGridManager*)data; - if (self->getState() == NORMAL) - { - self->applyChanges(); - } - else if ((self->getState() == ADD_NEW) || (self->getState() == ADD_COPY)) - { - if (self->createNewGrid()) - { - self->setState(NORMAL); - } - else - { - //LLScrollListCtrl *grids = self->getChild("grid_selector"); - //grids->setCurrentByIndex(grids->getItemCount() - 1); - return; - } - } - else + if (self) { - llwarns << "Illegal state " << self->getState() << llendl; - return; + self->setCurGrid(ctrl->getValue().asString()); + self->refreshGrids(); } - self->setCurGrid(ctrl->getValue().asString()); - self->refreshGrids(); } //static @@ -541,7 +558,7 @@ void FloaterGridManager::onClickDelete(void* data) { //llinfos << "onClickDelete" << llendl; FloaterGridManager* self = (FloaterGridManager*)data; - if (self->getState() == NORMAL) + if (self) { gHippoGridManager->deleteGrid(self->getCurGrid()); } @@ -553,71 +570,80 @@ void FloaterGridManager::onClickAdd(void* data) { //llinfos << "onClickAdd" << llendl; FloaterGridManager* self = (FloaterGridManager*)data; - self->setState(ADD_NEW); - self->refreshGrids(); + if (self) + { + self->createNewGrid(); + } } //static void FloaterGridManager::onClickCopy(void* data) { - //llinfos << "onClickCopy" << llendl; FloaterGridManager* self = (FloaterGridManager*)data; - self->setState(ADD_COPY); - self->refreshGrids(); + if (self) + { + self->setupCopyGridEntry(); + } } // static void FloaterGridManager::onClickOk(void* data) { - FloaterGridManager::getInstance()->apply(); - FloaterGridManager::getInstance()->close(); + FloaterGridManager* self = (FloaterGridManager*)data; + if (self) + { + self->apply(); + self->close(); + } } //static void FloaterGridManager::onClickApply(void* data) { - FloaterGridManager::getInstance()->apply(); + FloaterGridManager* self = (FloaterGridManager*)data; + if (self) + { + self->apply(); + } refreshGrids(); } // static void FloaterGridManager::onClickClear(void* data) { - FloaterGridManager::getInstance()->clearInfo(); + FloaterGridManager* self = (FloaterGridManager*)data; + if (self) + { + self->clearGridInfo(false); + } } //static -//void FloaterGridManager::onClickDefault(void* data) -//{ -// FloaterGridManager::getInstance()->setDefault(); -// FloaterGridManager::getInstance()->refreshGrids(); -//} - -//static void FloaterGridManager::onClickGridInfo(void* data) { - //HippoPanelGrids* self = (HippoPanelGrids*)data; - FloaterGridManager::getInstance()->retrieveGridInfo(); + FloaterGridManager* self = (FloaterGridManager*)data; + if (self) + { + self->retrieveGridInfo(); + } } //static void FloaterGridManager::onClickCancel(void* data) { - FloaterGridManager::getInstance()->close(); + FloaterGridManager* self = (FloaterGridManager*)data; + if (self) + { + self->close(); + } } -//void FloaterGridManager::setAlwaysRefresh(bool refresh) -//{ -// // wargames 2: dead code, LLPanelLogin compatibility -// return; -//} - -//void FloaterGridManager::refreshLocation( bool force_visible ) +//void FloaterGridManager::refreshLocation(bool force_visible) //{ // llinfos << "refreshLocation called" << llendl; // -// if (!FloaterGridManager::getInstance()) +// if (!FloaterGridManager::instanceVisible()) // { // return; // } @@ -645,41 +671,10 @@ void FloaterGridManager::onClickCancel(void* data) //FloaterGridManager::getInstance()->childSetVisible("server_combo", TRUE); //} -//void FloaterGridManager::setFocus(BOOL b) -//{ -// if(b != hasFocus()) -// { -// if(b) -// { -// FloaterGridManager::giveFocus(); -// } -// else -// { -// LLPanel::setFocus(b); -// } -// } -//} -// -//void FloaterGridManager::giveFocus() -//{ -// LLScrollListCtrl *combo = NULL; -// -// if (!FloaterGridManager::getInstance()) -// { -// llinfos << "giveFocus has no FloaterGridManager instance. FloaterGridManager::getInstance()=" << FloaterGridManager::getInstance() << llendl; -// return; -// } -// -// // for our combo box approach, selecting the combo box is almost always -// // the right thing to do on the floater receiving focus -// combo = FloaterGridManager::getInstance()->getChild("grid_selector"); -// combo->setFocus(TRUE); -//} - BOOL FloaterGridManager::isGridComboDirty() { BOOL user_picked = FALSE; - if (!FloaterGridManager::getInstance()) + if (!FloaterGridManager::instanceVisible()) { llwarns << "Attempted getServer with no login view shown" << llendl; } @@ -691,17 +686,17 @@ BOOL FloaterGridManager::isGridComboDirty() return user_picked; } -void FloaterGridManager::getLocation(std::string &location) -{ - if (!FloaterGridManager::getInstance()) - { - llwarns << "Attempted getLocation with no login view shown" << llendl; - return; - } - - LLComboBox* combo = FloaterGridManager::getInstance()->getChild("start_location_combo"); - location = combo->getValue().asString(); -} +//void FloaterGridManager::getLocation(std::string& location) +//{ +// if (!FloaterGridManager::instanceVisible()) +// { +// llwarns << "Attempted getLocation with no login view shown" << llendl; +// return; +// } +// +// LLComboBox* combo = FloaterGridManager::getInstance()->getChild("start_location_combo"); +// location = combo->getValue().asString(); +//} std::string& FloaterGridManager::getPassword() { @@ -718,37 +713,6 @@ bool FloaterGridManager::isSamePassword(std::string &password) return mMungedPassword == password; } -//void FloaterGridManager::addServer(const std::string& server, S32 domain_name) -//{ -// if (!FloaterGridManager::getInstance()) -// { -// llwarns << "Attempted addServer with no login view shown" << llendl; -// return; -// } -// -// /*LLComboBox* combo = FloaterGridManager::getInstance()->getChild("server_combo"); -// combo->add(server, LLSD(domain_name) ); -// combo->setCurrentByIndex(0);*/ -//} - -//void FloaterGridManager::cancel_old() -//{ -// if (!FloaterGridManager::getInstance()) -// { -// return; -// } -// -// if (FloaterGridManager::getInstance()->sIsInitialLogin) -// { -// // send a callback that indicates we're quitting or closing -// if (FloaterGridManager::getInstance()->mCallback) -// FloaterGridManager::getInstance()->mCallback(LOGIN_OPTION_QUIT, FloaterGridManager::getInstance()->mCallbackData); -// return; -// } -// -// FloaterGridManager::getInstance()->close(); -//} - void FloaterGridManager::hashPassword(const std::string& password, std::string& hashedPassword) { // Max "actual" password length is 16 characters. diff --git a/linden/indra/newview/floatergridmanager.h b/linden/indra/newview/floatergridmanager.h index 55517f5..b93a430 100644 --- a/linden/indra/newview/floatergridmanager.h +++ b/linden/indra/newview/floatergridmanager.h @@ -1,22 +1,39 @@ -/* - * floatergridmanager.h - * This is Meerkats grid manager. - * -Patrick Sapinski (Monday, August 17, 2009) - * - * Modified by McCabe Maxsted for Imprudence - */ +/** +* @file floatergridmanager.h +* @brief UI for managing grid information +* +* $LicenseInfo:firstyear=2011&license=viewergpl$ +* +* Copyright (c) 2011, McCabe Maxsted +* based on Meerkat's grid manager by Patrick Sapinski +* +* Imprudence Viewer Source Code +* The source code in this file ("Source Code") is provided to you +* under the terms of the GNU General Public License, version 2.0 +* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in +* this distribution, or online at +* http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ #ifndef PL_floaterlogin_H #define PL_floaterlogin_H -#define LOGIN_OPTION_CONNECT 0 -#define LOGIN_OPTION_QUIT 1 - #include "llfloater.h" -class LoginController; -class AuthenticationModel; - class FloaterGridManager : public LLFloater, public LLFloaterSingleton { public: @@ -27,11 +44,8 @@ public: static void refreshGrids(); void apply(); - //void setDefault(); void cancel(); - void clearInfo(); - virtual void draw(); void refresh(); @@ -40,44 +54,38 @@ public: virtual std::string& getPassword(); virtual void setPassword(std::string &password); virtual bool isSamePassword(std::string &password); - static void getFields(std::string &loginname, std::string &password, - BOOL &remember); - static void setFields(const std::string &loginname, const std::string &password, - BOOL remember); + + // clears either the loginuri fetched info or all the info in the grid manager + void clearGridInfo(bool clear_all); - // LLLoginPanel compatibility - /*static void setAlwaysRefresh(bool refresh); - static void refreshLocation(bool force_visible); - virtual void setFocus(BOOL b); - static void giveFocus();*/ - static void getLocation(std::string &location); + //static void getLocation(std::string &location); + //void refreshLocation(bool force_visible) static BOOL isGridComboDirty(); //static void addServer(const std::string& server, S32 domain_name); static void hashPassword(const std::string& password, std::string& hashedPassword); -protected: - static bool sIsInitialLogin; - static std::string sGrid; + private: - enum State + + enum EGridState { - NORMAL, - ADD_NEW, - ADD_COPY + GRID_STATE_NORMAL, + GRID_STATE_NEW, + GRID_STATE_COPY }; - State mState; - void setState(const State& state) { mState = state; } - State getState() { return mState; } - + void setGridState(EGridState state) { mState = state; } + EGridState getGridState() { return mState; } + std::string mMungedPassword; + EGridState mState; std::string mCurGrid; - void setCurGrid(const std::string& grid) { mCurGrid = grid; } - std::string getCurGrid() { return mCurGrid; } - std::string mIncomingPassword; - std::string mMungedPassword; + void setCurGrid(std::string grid) { mCurGrid = grid; } + std::string getCurGrid() { return mCurGrid; } void applyChanges(); - bool createNewGrid(); + void createNewGrid(); + void setupNewGridEntry(); + void setupCopyGridEntry(); void update(); void retrieveGridInfo(); @@ -87,13 +95,11 @@ private: static void onClickCopy(void* data); static void onClickOk(void* data); static void onClickApply(void* data); - static void onClickDefault(void* data); static void onClickGridInfo(void* data); static void onClickCancel(void* data); static void onClickClear(void* data); - static LoginController* sController; - static AuthenticationModel* sModel; + static bool newGridCreationCallback(const LLSD& notification, const LLSD& response); }; #endif // PL_floaterlogin_H diff --git a/linden/indra/newview/hippogridmanager.cpp b/linden/indra/newview/hippogridmanager.cpp index 6bf6e63..8277361 100644 --- a/linden/indra/newview/hippogridmanager.cpp +++ b/linden/indra/newview/hippogridmanager.cpp @@ -1,4 +1,33 @@ -// Ported to Imprudence from the Hippo OpenSim Viewer by Jacek Antonelli +/** +* @file hippogridmanager.cpp +* @brief stores grid information +* +* $LicenseInfo:firstyear=2011&license=viewergpl$ +* +* Copyright (c) 2011 +* Ported to Imprudence from the Hippo OpenSim Viewer by Jacek Antonelli +* +* Imprudence Viewer Source Code +* The source code in this file ("Source Code") is provided to you +* under the terms of the GNU General Public License, version 2.0 +* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in +* this distribution, or online at +* http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ #include "llviewerprecompiledheaders.h" @@ -43,14 +72,14 @@ HippoGridInfo::HippoGridInfo(const std::string& gridNick) : mPlatform(PLATFORM_OPENSIM), mGridNick(gridNick), mGridName(LLStringUtil::null), - mLoginUri(LLStringUtil::null), + mLoginURI(LLStringUtil::null), mLoginPage(LLStringUtil::null), - mHelperUri(LLStringUtil::null), + mHelperURI(LLStringUtil::null), mWebSite(LLStringUtil::null), - mSupportUrl(LLStringUtil::null), - mRegisterUrl(LLStringUtil::null), - mPasswordUrl(LLStringUtil::null), - mSearchUrl(LLStringUtil::null), + mSupportURL(LLStringUtil::null), + mRegisterURL(LLStringUtil::null), + mPasswordURL(LLStringUtil::null), + mSearchURL(LLStringUtil::null), mFirstName(LLStringUtil::null), mLastName(LLStringUtil::null), mAvatarPassword(LLStringUtil::null), @@ -60,133 +89,24 @@ HippoGridInfo::HippoGridInfo(const std::string& gridNick) : mMaxAgentGroups(-1), mCurrencySymbol("OS$"), mRealCurrencySymbol("US$"), - mDirectoryFee(30) + mDirectoryFee(30), + mUsername(LLStringUtil::null), + mUsernameCompat(false) { std::string nick = gridNick; - mGridNick = sanitizeGridNick( nick ); + mGridNick = sanitizeGridNick(nick); } - -// ******************************************************************** -// Getters - -HippoGridInfo::Platform HippoGridInfo::getPlatform() -{ - return mPlatform; -} - -bool HippoGridInfo::isOpenSimulator() const -{ - return (mPlatform == HippoGridInfo::PLATFORM_OPENSIM); -} - -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; -} - -const std::string& HippoGridInfo::getLoginUri() const -{ - return mLoginUri; -} - -const std::string& HippoGridInfo::getLoginPage() const -{ - return mLoginPage; -} - -const std::string& HippoGridInfo::getHelperUri() const -{ - return mHelperUri; -} - -const std::string& HippoGridInfo::getWebSite() const -{ - return mWebSite; -} - -const std::string& HippoGridInfo::getSupportUrl() const -{ - return mSupportUrl; -} - -const std::string& HippoGridInfo::getRegisterUrl() const -{ - return mRegisterUrl; -} - -const std::string& HippoGridInfo::getPasswordUrl() const -{ - return mPasswordUrl; -} - -const std::string& HippoGridInfo::getSearchUrl() const -{ - return mSearchUrl; -} - -const std::string& HippoGridInfo::getFirstName() const -{ - return mFirstName; -} - -const std::string& HippoGridInfo::getLastName() const -{ - return mLastName; -} - -const std::string& HippoGridInfo::getAvatarPassword() const -{ - return mAvatarPassword; -} - -bool HippoGridInfo::isRenderCompat() const -{ - return mRenderCompat; -} - -const std::string& HippoGridInfo::getCurrencySymbol() const -{ - return mCurrencySymbol; -} - -const std::string& HippoGridInfo::getRealCurrencySymbol() const -{ - return mRealCurrencySymbol; -} - -bool HippoGridInfo::isUsernameCompat() const -{ - // currently only SecondLife grids support username-style logins - // but Aurora is working on implementing it -- MC - return (mPlatform == HippoGridInfo::PLATFORM_SECONDLIFE); -} - - - -// ******************************************************************** -// Setters - void HippoGridInfo::setPlatform(Platform platform) { mPlatform = platform; if (mPlatform == PLATFORM_SECONDLIFE) { mCurrencySymbol = "L$"; + mUsernameCompat = true; } } - void HippoGridInfo::setPlatform(const std::string& platform) { std::string tmp = platform; @@ -208,96 +128,25 @@ void HippoGridInfo::setPlatform(const std::string& platform) } } -void HippoGridInfo::setGridName(const std::string& gridName) +void HippoGridInfo::setLoginURI(const std::string& loginURI) { - mGridName = gridName; + std::string uri = loginURI; + mLoginURI = sanitizeURI(uri); } -void HippoGridInfo::setLoginUri(const std::string& loginUri) +void HippoGridInfo::setHelperURI(const std::string& helperURI) { - std::string uri = loginUri; - mLoginUri = sanitizeUri(uri); + std::string uri = helperURI; + mHelperURI = sanitizeURI(uri); } -void HippoGridInfo::setLoginPage(const std::string& loginPage) -{ - mLoginPage = loginPage; -} - -void HippoGridInfo::setHelperUri(const std::string& helperUri) -{ - std::string uri = helperUri; - mHelperUri = sanitizeUri(uri); -} - -void HippoGridInfo::setWebSite(const std::string& website) -{ - mWebSite = website; -} - -void HippoGridInfo::setSupportUrl(const std::string& url) -{ - mSupportUrl = url; -} - -void HippoGridInfo::setRegisterUrl(const std::string& url) -{ - mRegisterUrl = url; -} - -void HippoGridInfo::setPasswordUrl(const std::string& url) -{ - mPasswordUrl = url; -} - -void HippoGridInfo::setSearchUrl(const std::string& url) -{ - mSearchUrl = url; -} - -void HippoGridInfo::setFirstName(const std::string& firstName) -{ - mFirstName = firstName; -} - -void HippoGridInfo::setLastName(const std::string& lastName) -{ - mLastName = lastName; -} - -void HippoGridInfo::setAvatarPassword(const std::string& avatarPassword) -{ - mAvatarPassword = avatarPassword; -} - -void HippoGridInfo::setRenderCompat(bool compat) -{ - mRenderCompat = compat; -} - -void HippoGridInfo::setCurrencySymbol(const std::string& sym) -{ - mCurrencySymbol = sym.substr(0, 3); -} - -void HippoGridInfo::setRealCurrencySymbol(const std::string& sym) -{ - mRealCurrencySymbol = sym.substr(0, 3); -} - -void HippoGridInfo::setDirectoryFee(int fee) -{ - mDirectoryFee = fee; -} - - // ******************************************************************** // Grid Info -std::string HippoGridInfo::getSearchUrl(SearchType ty, bool is_web) const +std::string HippoGridInfo::getSearchURL(SearchType ty, bool is_web) const { - // Don't worry about whether or not mSearchUrl is empty here anymore -- MC + // Don't worry about whether or not mSearchURL is empty here anymore -- MC if (is_web) { if (mPlatform == PLATFORM_SECONDLIFE) @@ -321,16 +170,16 @@ std::string HippoGridInfo::getSearchUrl(SearchType ty, bool is_web) const return ""; } } - else if (!mSearchUrl.empty()) + else if (!mSearchURL.empty()) { // Search url sent to us in the login response if (ty == SEARCH_ALL_EMPTY) { - return (mSearchUrl); + return (mSearchURL); } else if (ty == SEARCH_ALL_QUERY) { - return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&"); + return (mSearchURL + "q=[QUERY]&s=[COLLECTION]&"); } else if (ty == SEARCH_ALL_TEMPLATE) { @@ -369,11 +218,11 @@ std::string HippoGridInfo::getSearchUrl(SearchType ty, bool is_web) const // Use the old search all if (ty == SEARCH_ALL_EMPTY) { - return (mSearchUrl + "panel=All&"); + return (mSearchURL + "panel=All&"); } else if (ty == SEARCH_ALL_QUERY) { - return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&"); + return (mSearchURL + "q=[QUERY]&s=[COLLECTION]&"); } else if (ty == SEARCH_ALL_TEMPLATE) { @@ -424,7 +273,7 @@ void HippoGridInfo::onXmlElementEnd(void* userData, const XML_Char* name) } //static -void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int len) +void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, S32 len) { HippoGridInfo* self = (HippoGridInfo*)userData; switch (self->mXmlState) @@ -446,30 +295,30 @@ void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int le case XML_LOGINURI: { std::string loginuri(s, len); - self->mLoginUri = sanitizeUri( loginuri ); + self->mLoginURI = sanitizeURI( loginuri ); break; } case XML_HELPERURI: { std::string helperuri(s, len); - self->mHelperUri = sanitizeUri( helperuri ); + self->mHelperURI = sanitizeURI( helperuri ); break; } case XML_SEARCH: { - self->mSearchUrl.assign(s, len); - //sanitizeQueryUrl(mSearchUrl); + self->mSearchURL.assign(s, len); + //sanitizeQueryURL(mSearchURL); break; } case XML_GRIDNAME: self->mGridName.assign(s, len); break; case XML_LOGINPAGE: self->mLoginPage.assign(s, len); break; case XML_WEBSITE: self->mWebSite.assign(s, len); break; - case XML_SUPPORT: self->mSupportUrl.assign(s, len); break; - case XML_REGISTER: self->mRegisterUrl.assign(s, len); break; - case XML_PASSWORD: self->mPasswordUrl.assign(s, len); break; + case XML_SUPPORT: self->mSupportURL.assign(s, len); break; + case XML_REGISTER: self->mRegisterURL.assign(s, len); break; + case XML_PASSWORD: self->mPasswordURL.assign(s, len); break; case XML_VOID: break; } @@ -478,16 +327,16 @@ void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int le bool HippoGridInfo::retrieveGridInfo() { - if (mLoginUri == "") return false; + if (mLoginURI == "") return false; // If last character in uri is not "/" - std::string uri = mLoginUri; + std::string uri = mLoginURI; if (uri.compare(uri.length()-1, 1, "/") != 0) { uri += '/'; } std::string reply; - int result = HippoRestRequest::getBlocking(uri + "get_grid_info", &reply); + S32 result = HippoRestRequest::getBlocking(uri + "get_grid_info", &reply); if (result != 200) return false; llinfos << "Received: " << reply << llendl; @@ -508,6 +357,14 @@ bool HippoGridInfo::retrieveGridInfo() return success; } +const std::string& HippoGridInfo::getGridName() const +{ + if (mGridName.empty()) + { + return mGridNick; + } + return mGridName; +} std::string HippoGridInfo::getUploadFee() const { @@ -531,7 +388,7 @@ std::string HippoGridInfo::getDirectoryFee() const return fee; } -void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const +void HippoGridInfo::formatFee(std::string &fee, S32 cost, bool showFree) const { if (showFree && (cost == 0)) { @@ -556,7 +413,9 @@ const char* HippoGridInfo::getPlatformString(Platform platform) }; if ((platform < PLATFORM_OTHER) || (platform >= PLATFORM_LAST)) + { platform = PLATFORM_OTHER; + } return platformStrings[platform]; } @@ -565,8 +424,8 @@ const char* HippoGridInfo::getPlatformString(Platform platform) std::string HippoGridInfo::sanitizeGridNick(std::string &gridnick) { std::string tmp; - int size = gridnick.size(); - for (int i=0; isecond->getGridNick()) + { + return true; + } + } + return false; +} + // ******************************************************************** // Persistent Store @@ -810,7 +680,7 @@ void HippoGridManager::loadFromFile() std::string update_list = gSavedSettings.getString("GridUpdateList"); if (!update_list.empty()) { - parseUrl(update_list, !mGridInfo.empty()); + parseURL(update_list, !mGridInfo.empty()); } else { @@ -825,7 +695,7 @@ void HippoGridManager::loadFromFile() } -void HippoGridManager::parseUrl(const std::string url, bool mergeIfNewer) +void HippoGridManager::parseURL(const std::string url, bool mergeIfNewer) { llinfos << "Loading grid info from '" << url << "'." << llendl; @@ -879,7 +749,7 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer) LLSD gridMap = *it; if (gridMap.has("default_grids_version")) { - int version = gridMap["default_grids_version"]; + S32 version = gridMap["default_grids_version"]; if (version <= mDefaultGridsVersion) return; else break; } @@ -917,20 +787,22 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer) // update existing grid info grid = it->second; } - grid->setLoginUri(gridMap["loginuri"]); + grid->setLoginURI(gridMap["loginuri"]); if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]); if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]); if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]); - if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]); + if (gridMap.has("helperuri")) grid->setHelperURI(gridMap["helperuri"]); if (gridMap.has("website")) grid->setWebSite(gridMap["website"]); - if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]); - if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]); - if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]); - if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]); + if (gridMap.has("support")) grid->setSupportURL(gridMap["support"]); + if (gridMap.has("register")) grid->setRegisterURL(gridMap["register"]); + if (gridMap.has("password")) grid->setPasswordURL(gridMap["password"]); + if (gridMap.has("search")) grid->setSearchURL(gridMap["search"]); if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]); - // if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]); - // if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]); - // if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]); + if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]); + if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]); + if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]); + if (gridMap.has("username")) grid->setUsername(gridMap["username"]); + if (gridMap.has("username_compat")) grid->setUsernameCompat(gridMap["username_compat"]); if (newGrid) addGrid(grid); } } @@ -955,19 +827,22 @@ void HippoGridManager::saveFile() gridInfo[i]["gridnick"] = grid->getGridNick(); gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform()); gridInfo[i]["gridname"] = grid->getGridName(); - gridInfo[i]["loginuri"] = grid->getLoginUri(); + gridInfo[i]["loginuri"] = grid->getLoginURI(); gridInfo[i]["loginpage"] = grid->getLoginPage(); - gridInfo[i]["helperuri"] = grid->getHelperUri(); + gridInfo[i]["helperuri"] = grid->getHelperURI(); gridInfo[i]["website"] = grid->getWebSite(); - gridInfo[i]["support"] = grid->getSupportUrl(); - gridInfo[i]["register"] = grid->getRegisterUrl(); - gridInfo[i]["password"] = grid->getPasswordUrl(); - // gridInfo[i]["firstname"] = grid->getFirstName(); - // gridInfo[i]["lastname"] = grid->getLastName(); - // gridInfo[i]["avatarpassword"] = grid->getAvatarPassword(); + gridInfo[i]["support"] = grid->getSupportURL(); + gridInfo[i]["register"] = grid->getRegisterURL(); + gridInfo[i]["password"] = grid->getPasswordURL(); + gridInfo[i]["firstname"] = grid->getFirstName(); + gridInfo[i]["lastname"] = grid->getLastName(); + gridInfo[i]["avatarpassword"] = grid->getAvatarPassword(); - gridInfo[i]["search"] = grid->getSearchUrl(); + gridInfo[i]["search"] = grid->getSearchURL(); gridInfo[i]["render_compat"] = grid->isRenderCompat(); + + gridInfo[i]["username"] = grid->getUsername(); + gridInfo[i]["username_compat"] = grid->isUsernameCompat(); } // write client grid info file diff --git a/linden/indra/newview/hippogridmanager.h b/linden/indra/newview/hippogridmanager.h index 1b6fbc5..f1b0a8e 100644 --- a/linden/indra/newview/hippogridmanager.h +++ b/linden/indra/newview/hippogridmanager.h @@ -1,3 +1,34 @@ +/** +* @file hippogridmanager.h +* @brief stores grid information +* +* $LicenseInfo:firstyear=2011&license=viewergpl$ +* +* Copyright (c) 2011 +* Ported to Imprudence from the Hippo OpenSim Viewer by Jacek Antonelli +* +* Imprudence Viewer Source Code +* The source code in this file ("Source Code") is provided to you +* under the terms of the GNU General Public License, version 2.0 +* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in +* this distribution, or online at +* http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ + #ifndef __HIPPO_GRID_MANAGER_H__ #define __HIPPO_GRID_MANAGER_H__ @@ -35,57 +66,61 @@ public: explicit HippoGridInfo(const std::string& gridNick); - Platform getPlatform(); - bool isOpenSimulator() const; - bool isSecondLife() const; - const std::string& getGridNick() const; - const std::string& getGridName() const; - const std::string& getLoginUri() const; - const std::string& getLoginPage() const; - const std::string& getHelperUri() const; - const std::string& getWebSite() const; - const std::string& getSupportUrl() const; - const std::string& getRegisterUrl() const; - const std::string& getPasswordUrl() const; + Platform getPlatform() { return mPlatform; } + bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM); } + bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); } + bool isRenderCompat() const { return mRenderCompat; } + // currently only SecondLife grids support username-style logins but Aurora is working on implementing it + bool isUsernameCompat() const { return mUsernameCompat; } + + const std::string& getGridNick() const { return mGridNick; } + // returns grid nick if no grid name is available + const std::string& getGridName() const; + const std::string& getLoginURI() const { return mLoginURI; } + const std::string& getLoginPage() const { return mLoginPage; } + const std::string& getHelperURI() const { return mHelperURI; } + const std::string& getWebSite() const { return mWebSite; } + const std::string& getSupportURL() const { return mSupportURL; } + const std::string& getRegisterURL() const { return mRegisterURL; } + const std::string& getPasswordURL() const { return mPasswordURL; } // Returns the url base used for the Web Search tab - const std::string& getSearchUrl() const; - const std::string& getFirstName() const; - const std::string& getLastName() const; - const std::string& getAvatarPassword() const; - const std::string& getVoiceConnector() const { return mVoiceConnector; } - std::string getSearchUrl(SearchType ty, bool is_web) const; - bool isRenderCompat() const; - bool isUsernameCompat() const; - int getMaxAgentGroups() const { return mMaxAgentGroups; } - - const std::string& getCurrencySymbol() const; - const std::string& getRealCurrencySymbol() const; - std::string getUploadFee() const; - std::string getGroupCreationFee() const; - std::string getDirectoryFee() const; + const std::string& getSearchURL() const { return mSearchURL; } + const std::string& getFirstName() const { return mFirstName; } + const std::string& getLastName() const { return mLastName; } + const std::string& getUsername() const { return mUsername; } + const std::string& getAvatarPassword() const { return mAvatarPassword; } + const std::string& getVoiceConnector() const { return mVoiceConnector; } + S32 getMaxAgentGroups() const { return mMaxAgentGroups; } + const std::string& getCurrencySymbol() const { return mCurrencySymbol; } + const std::string& getRealCurrencySymbol() const { return mRealCurrencySymbol; } + std::string getUploadFee() const; + std::string getGroupCreationFee() const; + std::string getDirectoryFee() const; + std::string getSearchURL(SearchType ty, bool is_web) const; void setPlatform (const std::string& platform); void setPlatform (Platform platform); - void setGridName (const std::string& gridName); - void setLoginUri (const std::string& loginUri); - void setLoginPage(const std::string& loginPage); - void setHelperUri(const std::string& helperUri); - void setWebSite (const std::string& website); - void setSupportUrl(const std::string& url); - void setRegisterUrl(const std::string& url); - void setPasswordUrl(const std::string& url); + void setGridName (const std::string& gridName) { mGridName = gridName; } + void setLoginURI (const std::string& loginURI); + void setLoginPage(const std::string& loginPage) { mLoginPage = loginPage; } + void setHelperURI(const std::string& helperURI); + void setWebSite (const std::string& website) { mWebSite = website; } + void setSupportURL(const std::string& url) { mSupportURL = url; } + void setRegisterURL(const std::string& url) { mRegisterURL = url; } + void setPasswordURL(const std::string& url) { mPasswordURL = url; } // sets the url base used for the Web Search tab - void setSearchUrl(const std::string& url); - void setRenderCompat(bool compat); - void setMaxAgentGroups(int max) { mMaxAgentGroups = max; } - void setFirstName(const std::string& firstName); - void setLastName(const std::string& lastName); - void setAvatarPassword(const std::string& avatarPassword); - void setVoiceConnector(const std::string& vc) { mVoiceConnector = vc; } - - void setCurrencySymbol(const std::string& sym); - void setRealCurrencySymbol(const std::string& sym); - void setDirectoryFee(int fee); + void setSearchURL(const std::string& url) { mSearchURL = url; } + void setRenderCompat(bool compat) { mRenderCompat = compat; } + void setMaxAgentGroups(S32 max) { mMaxAgentGroups = max; } + void setFirstName(const std::string& firstName) { mFirstName = firstName; } + void setLastName(const std::string& lastName) { mLastName = lastName; } + void setAvatarPassword(const std::string& avatarPassword) { mAvatarPassword = avatarPassword; } + void setVoiceConnector(const std::string& vc) { mVoiceConnector = vc; } + void setCurrencySymbol(const std::string& sym) { mCurrencySymbol = sym.substr(0, 3); } + void setRealCurrencySymbol(const std::string& sym) { mRealCurrencySymbol = sym.substr(0, 3); } + void setDirectoryFee(U32 fee) { mDirectoryFee = fee; } + void setUsername(const std::string& username) { mUsername = username; } + void setUsernameCompat(bool compat) { mUsernameCompat = compat; } bool retrieveGridInfo(); @@ -96,27 +131,30 @@ public: static void initFallback(); private: - Platform mPlatform; + Platform mPlatform; std::string mGridNick; std::string mGridName; - std::string mLoginUri; + std::string mLoginURI; std::string mLoginPage; - std::string mHelperUri; + std::string mHelperURI; std::string mWebSite; - std::string mSupportUrl; - std::string mRegisterUrl; - std::string mPasswordUrl; - std::string mSearchUrl; + std::string mSupportURL; + std::string mRegisterURL; + std::string mPasswordURL; + std::string mSearchURL; std::string mVoiceConnector; std::string mFirstName; std::string mLastName; std::string mAvatarPassword; - bool mRenderCompat; - int mMaxAgentGroups; + bool mRenderCompat; + S32 mMaxAgentGroups; + + std::string mUsername; + bool mUsernameCompat; std::string mCurrencySymbol; std::string mRealCurrencySymbol; - int mDirectoryFee; + U32 mDirectoryFee; // for parsing grid info XML enum XmlState @@ -127,12 +165,12 @@ private: }; XmlState mXmlState; - static std::string sanitizeUri(std::string &uri); - void formatFee(std::string &fee, int cost, bool showFree) const; + static std::string sanitizeURI(std::string &uri); + void formatFee(std::string &fee, S32 cost, bool showFree) const; static void onXmlElementStart(void* userData, const XML_Char* name, const XML_Char** atts); static void onXmlElementEnd(void* userData, const XML_Char* name); - static void onXmlCharacterData(void* userData, const XML_Char* s, int len); + static void onXmlCharacterData(void* userData, const XML_Char* s, S32 len); }; @@ -149,31 +187,34 @@ public: HippoGridInfo* getGrid(const std::string& grid) const; HippoGridInfo* getConnectedGrid() const; HippoGridInfo* getCurrentGrid() const; - const std::string& getDefaultGridNick() const; + const std::string& getDefaultGridNick() const { return mDefaultGrid; } const std::string& getCurrentGridNick() const; void setDefaultGrid(const std::string& grid); void setCurrentGrid(const std::string& grid); - void setCurrentGridAsConnected(); + void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); } void addGrid(HippoGridInfo* grid); void deleteGrid(const std::string& grid); typedef std::map::iterator GridIterator; - GridIterator beginGrid() { return mGridInfo.begin(); } - GridIterator endGrid() { return mGridInfo.end(); } + GridIterator beginGrid() { return mGridInfo.begin(); } + GridIterator endGrid() { return mGridInfo.end(); } + + // returns true if the grid manager knows of a nickname + bool hasGridNick(const std::string& grid_nick); private: std::map mGridInfo; std::string mDefaultGrid; std::string mCurrentGrid; HippoGridInfo* mConnectedGrid; - int mDefaultGridsVersion; + S32 mDefaultGridsVersion; void cleanup(); void loadFromFile(); void parseFile(const std::string& fileName, bool mergeIfNewer); - void parseUrl(const std::string url, bool mergeIfNewer); + void parseURL(const std::string url, bool mergeIfNewer); void parseData(LLSD &gridInfo, bool mergeIfNewer); }; diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 0eaecb1..cbec717 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -3262,10 +3262,10 @@ void LLAppViewer::badNetworkHandler() LLAppViewer::handleViewerCrash(); std::string grid_support_msg = ""; - if (!gHippoGridManager->getCurrentGrid()->getSupportUrl().empty()) + if (!gHippoGridManager->getCurrentGrid()->getSupportURL().empty()) { grid_support_msg = "\n\nOr visit the gird support page at: \n " - + gHippoGridManager->getCurrentGrid()->getSupportUrl(); + + gHippoGridManager->getCurrentGrid()->getSupportURL(); } std::ostringstream message; message << diff --git a/linden/indra/newview/llpaneldirfind.cpp b/linden/indra/newview/llpaneldirfind.cpp index 719a7a0..9fdaf2e 100644 --- a/linden/indra/newview/llpaneldirfind.cpp +++ b/linden/indra/newview/llpaneldirfind.cpp @@ -270,7 +270,7 @@ void LLPanelDirFind::navigateToDefaultPage() { std::string start_url = ""; // Note: we use the web panel in OpenSim as well as Second Life -- MC - if (gHippoGridManager->getConnectedGrid()->getSearchUrl().empty() && + if (gHippoGridManager->getConnectedGrid()->getSearchURL().empty() && !gHippoGridManager->getConnectedGrid()->isSecondLife()) { // OS-based but doesn't have its own web search url -- MC @@ -293,7 +293,7 @@ void LLPanelDirFind::navigateToDefaultPage() else { // OS-based but has its own web search url -- MC - start_url = gHippoGridManager->getConnectedGrid()->getSearchUrl(); + start_url = gHippoGridManager->getConnectedGrid()->getSearchURL(); } BOOL inc_pg = childGetValue("incpg").asBoolean(); @@ -323,7 +323,7 @@ std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const std::string url; if (search_text.empty()) { - url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_EMPTY, is_web); + url = gHippoGridManager->getConnectedGrid()->getSearchURL(HippoGridInfo::SEARCH_ALL_EMPTY, is_web); } else { @@ -348,7 +348,7 @@ std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const "-._~$+!*'()"; std::string query = LLURI::escape(search_text_with_plus, allowed); - url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_QUERY, is_web); + url = gHippoGridManager->getConnectedGrid()->getSearchURL(HippoGridInfo::SEARCH_ALL_QUERY, is_web); std::string substring = "[QUERY]"; std::string::size_type where = url.find(substring); if (where != std::string::npos) @@ -373,13 +373,13 @@ std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const // static std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) { - std::string url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_TEMPLATE, is_web); + std::string url = gHippoGridManager->getConnectedGrid()->getSearchURL(HippoGridInfo::SEARCH_ALL_TEMPLATE, is_web); if (!url.empty()) { // Note: opensim's default template (SearchURLSuffixOpenSim) is currently empty -- MC if (gHippoGridManager->getConnectedGrid()->isSecondLife() || - !gHippoGridManager->getConnectedGrid()->getSearchUrl().empty()) + !gHippoGridManager->getConnectedGrid()->getSearchURL().empty()) { // if the mature checkbox is unchecked, modify query to remove // terms with given phrase from the result set diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 3f748d4..1dff0cc 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp @@ -829,9 +829,9 @@ void LLPanelLogin::refreshLoginPage() if (!sInstance) return; sInstance->childSetVisible("create_new_account_text", - !gHippoGridManager->getCurrentGrid()->getRegisterUrl().empty()); + !gHippoGridManager->getCurrentGrid()->getRegisterURL().empty()); sInstance->childSetVisible("forgot_password_text", - !gHippoGridManager->getCurrentGrid()->getPasswordUrl().empty()); + !gHippoGridManager->getCurrentGrid()->getPasswordURL().empty()); // kick off a request to grab the url manually gResponsePtr = LLIamHereLogin::build(sInstance); @@ -853,44 +853,43 @@ void LLPanelLogin::loadLoginForm() if (!sInstance) return; // toggle between username/first+last login based on grid -- MC - LLTextBox* firstnamet = sInstance->getChild("first_name_text"); - LLTextBox* lastnamet = sInstance->getChild("last_name_text"); - LLTextBox* usernamet = sInstance->getChild("username_text"); + LLTextBox* firstname_t = sInstance->getChild("first_name_text"); + LLTextBox* lastname_t = sInstance->getChild("last_name_text"); + LLTextBox* username_t = sInstance->getChild("username_text"); - LLLineEditor* firstnamel = sInstance->getChild("first_name_edit"); - LLLineEditor* lastnamel = sInstance->getChild("last_name_edit"); - LLLineEditor* usernamel = sInstance->getChild("username_edit"); + LLLineEditor* firstname_l = sInstance->getChild("first_name_edit"); + LLLineEditor* lastname_l = sInstance->getChild("last_name_edit"); + LLLineEditor* username_l = sInstance->getChild("username_edit"); - firstnamet->setVisible(!gHippoGridManager->getCurrentGrid()->isUsernameCompat()); - lastnamet->setVisible(!gHippoGridManager->getCurrentGrid()->isUsernameCompat()); - usernamet->setVisible(gHippoGridManager->getCurrentGrid()->isUsernameCompat()); + firstname_t->setVisible(!gHippoGridManager->getCurrentGrid()->isUsernameCompat()); + lastname_t->setVisible(!gHippoGridManager->getCurrentGrid()->isUsernameCompat()); + username_t->setVisible(gHippoGridManager->getCurrentGrid()->isUsernameCompat()); - firstnamel->setVisible(!gHippoGridManager->getCurrentGrid()->isUsernameCompat()); - lastnamel->setVisible(!gHippoGridManager->getCurrentGrid()->isUsernameCompat()); - usernamel->setVisible(gHippoGridManager->getCurrentGrid()->isUsernameCompat()); + firstname_l->setVisible(!gHippoGridManager->getCurrentGrid()->isUsernameCompat()); + lastname_l->setVisible(!gHippoGridManager->getCurrentGrid()->isUsernameCompat()); + username_l->setVisible(gHippoGridManager->getCurrentGrid()->isUsernameCompat()); - // these should really REALLY be stored in the grid info -- MC - std::string firstnames = gSavedSettings.getString("FirstName"); - std::string lastnames = gSavedSettings.getString("LastName"); - if (!firstnames.empty() && !lastnames.empty()) + // get name info if we've got it + std::string firstname_s = gHippoGridManager->getCurrentGrid()->getFirstName(); + std::string lastname_s = gHippoGridManager->getCurrentGrid()->getLastName(); + if (gHippoGridManager->getCurrentGrid()->isUsernameCompat()) { - if (gHippoGridManager->getCurrentGrid()->isUsernameCompat()) + if (lastname_s == "resident" || lastname_s == "Resident") { - if (lastnames == "resident" || lastnames == "Resident") - { - usernamel->setText(firstnames); - } - else - { - usernamel->setText(firstnames+"."+lastnames); - } + username_l->setText(firstname_s); } else { - firstnamel->setText(firstnames); - lastnamel->setText(lastnames); + username_l->setText(firstname_s+"."+lastname_s); } } + else + { + firstname_l->setText(firstname_s); + lastname_l->setText(lastname_s); + } + + setPassword(gHippoGridManager->getCurrentGrid()->getAvatarPassword()); } @@ -1208,11 +1207,14 @@ bool LLPanelLogin::newAccountAlertCallback(const LLSD& notification, const LLSD& // static void LLPanelLogin::onClickNewAccount(void*) { - const std::string &url = gHippoGridManager->getConnectedGrid()->getRegisterUrl(); - if (!url.empty()) { + const std::string &url = gHippoGridManager->getConnectedGrid()->getRegisterURL(); + if (!url.empty()) + { llinfos << "Going to account creation URL." << llendl; LLWeb::loadURLExternal(url); - } else { + } + else + { llinfos << "Account creation URL is empty." << llendl; sInstance->setFocus(TRUE); } @@ -1246,10 +1248,13 @@ void LLPanelLogin::onClickForgotPassword(void*) { if (sInstance ) { - const std::string &url = gHippoGridManager->getConnectedGrid()->getPasswordUrl(); - if (!url.empty()) { + const std::string &url = gHippoGridManager->getConnectedGrid()->getPasswordURL(); + if (!url.empty()) + { LLWeb::loadURLExternal(url); - } else { + } + else + { llwarns << "Link for 'forgotton password' not set." << llendl; } } diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 88445c3..4028cad 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -802,7 +802,7 @@ bool idle_startup() timeout_count = 0; - if(LLStartUp::shouldAutoLogin()) + if (LLStartUp::shouldAutoLogin()) { show_connect_box = false; } @@ -823,23 +823,33 @@ bool idle_startup() // Show the login dialog login_show(); - // connect dialog is already shown, so fill in the names + + // connect dialog is already shown, so fill in the names associated with the grid + // note how we always remember avatar names, but don't necessarily have to // icky how usernames get bolted on here as a kind of hack -- MC - if (gHippoGridManager && gHippoGridManager->getCurrentGrid()->isUsernameCompat()) + if (gHippoGridManager) { - if (lastname == "resident" || lastname == "Resident") + firstname = gHippoGridManager->getCurrentGrid()->getFirstName(); + lastname = gHippoGridManager->getCurrentGrid()->getLastName(); + // RememberPassword toggles this being saved + password = gHippoGridManager->getCurrentGrid()->getAvatarPassword(); + + if (gHippoGridManager->getCurrentGrid()->isUsernameCompat()) { - LLPanelLogin::setFields(firstname, password); + if (lastname == "resident" || lastname == "Resident") + { + LLPanelLogin::setFields(firstname, password); + } + else + { + LLPanelLogin::setFields(firstname+"."+lastname, password); + } } else { - LLPanelLogin::setFields(firstname+"."+lastname, password); + LLPanelLogin::setFields(firstname, lastname, password); } } - else - { - LLPanelLogin::setFields(firstname, lastname, password); - } LLPanelLogin::giveFocus(); @@ -972,21 +982,8 @@ bool idle_startup() lastname = gLoginHandler.getLastName(); web_login_key = gLoginHandler.getWebLoginKey(); } - - /* Jacek - Grid manager stuff that's changed with 1.23 - if(!gLoginHandler.mPassword.empty()) - { - firstname = gLoginHandler.mFirstName; - lastname = gLoginHandler.mLastName; - password = gLoginHandler.mPassword; - - gLoginHandler.mFirstName = ""; - gLoginHandler.mLastName = ""; - gLoginHandler.mPassword = ""; - LLStartUp::setShouldAutoLogin(false); - }*/ - - if (show_connect_box) + // note: the grid manager overrides defaults, always -- MC + else if (show_connect_box) { // TODO if not use viewer auth // Load all the name information out of the login view @@ -995,6 +992,8 @@ bool idle_startup() // HACK: Try to make not jump on login gKeyboard->resetKeys(); + + LLStartUp::setShouldAutoLogin(false); } if (!firstname.empty() && !lastname.empty()) @@ -1003,16 +1002,17 @@ bool idle_startup() gSavedSettings.setString("LastName", lastname); //LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL; - gDebugInfo["LoginName"] = firstname + " " + lastname; - } - + gDebugInfo["LoginName"] = firstname + " " + lastname; - - - // create necessary directories - // *FIX: these mkdir's should error check - gDirUtilp->setLindenUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname); - LLFile::mkdir(gDirUtilp->getLindenUserDir()); + // create necessary directories + gDirUtilp->setLindenUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname); + LLFile::mkdir(gDirUtilp->getLindenUserDir()); + } + else + { + // we don't do anything from here on out -- MC + llerrs << "No first or last name given! Cannot proceed!" << llendl; + } // Set PerAccountSettingsFile to the default value. gSavedSettings.setString("PerAccountSettingsFile", @@ -1547,7 +1547,7 @@ bool idle_startup() default: if (sAuthUriNum >= (int) sAuthUris.size() - 1) { - emsg << "Unable to connect to " << gHippoGridManager->getCurrentGrid()->getGridNick() << ".\n"; + emsg << "Unable to connect to " << gHippoGridManager->getCurrentGrid()->getGridName() << ".\n"; emsg << LLUserAuth::getInstance()->errorMessage(); } else { sAuthUriNum++; @@ -1826,31 +1826,31 @@ bool idle_startup() std::string tmp = LLUserAuth::getInstance()->getResponse("gridname"); if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp); tmp = LLUserAuth::getInstance()->getResponse("loginuri"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginURI(tmp); tmp = LLUserAuth::getInstance()->getResponse("welcome"); if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp); tmp = LLUserAuth::getInstance()->getResponse("loginpage"); if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp); tmp = LLUserAuth::getInstance()->getResponse("economy"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperURI(tmp); tmp = LLUserAuth::getInstance()->getResponse("helperuri"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperURI(tmp); tmp = LLUserAuth::getInstance()->getResponse("about"); if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp); tmp = LLUserAuth::getInstance()->getResponse("website"); if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp); tmp = LLUserAuth::getInstance()->getResponse("help"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportURL(tmp); tmp = LLUserAuth::getInstance()->getResponse("support"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportURL(tmp); tmp = LLUserAuth::getInstance()->getResponse("register"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterURL(tmp); tmp = LLUserAuth::getInstance()->getResponse("account"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterURL(tmp); tmp = LLUserAuth::getInstance()->getResponse("password"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordURL(tmp); tmp = LLUserAuth::getInstance()->getResponse("search"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchURL(tmp); tmp = LLUserAuth::getInstance()->getResponse("currency"); if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp); tmp = LLUserAuth::getInstance()->getResponse("real_currency"); @@ -2375,9 +2375,7 @@ bool idle_startup() LLStringUtil::format_map_t args; args["[FIRST_NAME]"] = firstname; args["[LAST_NAME]"] = lastname; - args["[GRID_NAME]"] = (gHippoGridManager->getConnectedGrid()->getGridName().empty()) ? - gHippoGridManager->getConnectedGrid()->getGridNick() : - gHippoGridManager->getConnectedGrid()->getGridName(); + args["[GRID_NAME]"] = gHippoGridManager->getConnectedGrid()->getGridName(); std::string title_text = LLTrans::getString("TitleBarMultiple", args); gWindowTitle = gSecondLife + " - " + title_text; LLStringUtil::truncate(gWindowTitle, 255); @@ -3271,7 +3269,7 @@ bool first_run_dialog_callback(const LLSD& notification, const LLSD& response) if (0 == option) { LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL; - const std::string &url = gHippoGridManager->getConnectedGrid()->getRegisterUrl(); + const std::string &url = gHippoGridManager->getConnectedGrid()->getRegisterURL(); if (!url.empty()) { LLWeb::loadURL(url); } else { @@ -3323,7 +3321,7 @@ bool login_alert_status(const LLSD& notification, const LLSD& response) case 0: // OK break; case 1: { // Help - const std::string &url = gHippoGridManager->getConnectedGrid()->getSupportUrl(); + const std::string &url = gHippoGridManager->getConnectedGrid()->getSupportURL(); if (!url.empty()) LLWeb::loadURLInternal(url); break; } diff --git a/linden/indra/newview/llviewernetwork.cpp b/linden/indra/newview/llviewernetwork.cpp index 1cfe665..0c39e15 100644 --- a/linden/indra/newview/llviewernetwork.cpp +++ b/linden/indra/newview/llviewernetwork.cpp @@ -75,7 +75,7 @@ void LLViewerLogin::getLoginURIs(std::vector& uris) const // If there was no command line uri... if(uris.empty()) { - uris.push_back(gHippoGridManager->getConnectedGrid()->getLoginUri()); + uris.push_back(gHippoGridManager->getConnectedGrid()->getLoginURI()); /* // If its a known grid choice, get the uri from the table, // else try the grid name. @@ -92,7 +92,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 @@ -102,7 +102,7 @@ const std::string &LLViewerLogin::getLoginPage() const const std::string &LLViewerLogin::getHelperURI() const { - return gHippoGridManager->getConnectedGrid()->getHelperUri(); + return gHippoGridManager->getConnectedGrid()->getHelperURI(); } bool LLViewerLogin::isOpenSimulator() diff --git a/linden/indra/newview/llxmlrpctransaction.cpp b/linden/indra/newview/llxmlrpctransaction.cpp index 30b0249..e0805ee 100644 --- a/linden/indra/newview/llxmlrpctransaction.cpp +++ b/linden/indra/newview/llxmlrpctransaction.cpp @@ -438,7 +438,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,14 +449,14 @@ void LLXMLRPCTransaction::Impl::setStatus(Status status, void LLXMLRPCTransaction::Impl::setCurlStatus(CURLcode code) { std::string message; - std::string uri = gHippoGridManager->getCurrentGrid()->getSupportUrl(); + std::string uri = gHippoGridManager->getCurrentGrid()->getSupportURL(); switch (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; @@ -465,7 +465,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; @@ -477,7 +477,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/linden/indra/newview/skins/default/xui/en-us/floater_grid_default_selector.xml b/linden/indra/newview/skins/default/xui/en-us/floater_grid_default_selector.xml index 3c26d30..157588d 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_grid_default_selector.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_grid_default_selector.xml @@ -7,10 +7,11 @@ Or use the Grid Manager to add a new one - + +