本文整理汇总了C++中HippoGridInfo::getFirstName方法的典型用法代码示例。如果您正苦于以下问题:C++ HippoGridInfo::getFirstName方法的具体用法?C++ HippoGridInfo::getFirstName怎么用?C++ HippoGridInfo::getFirstName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HippoGridInfo
的用法示例。
在下文中一共展示了HippoGridInfo::getFirstName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveFile
void HippoGridManager::saveFile()
{
// save default grid to client settings
gSavedSettings.setString("DefaultGrid", mDefaultGrid);
// build LLSD
LLSD gridInfo;
gridInfo[0]["default_grids_version"] = mDefaultGridsVersion;
// add grids
S32 i = 1;
GridIterator it, end = mGridInfo.end();
for (it = mGridInfo.begin(); it != end; ++it, i++) {
HippoGridInfo *grid = it->second;
gridInfo[i]["gridnick"] = grid->getGridNick();
gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform());
gridInfo[i]["gridname"] = grid->getGridName();
gridInfo[i]["loginuri"] = grid->getLoginUri();
gridInfo[i]["loginpage"] = grid->getLoginPage();
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]["search"] = grid->getSearchUrl();
gridInfo[i]["render_compat"] = grid->isRenderCompat();
}
// write client grid info file
std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml");
llofstream file;
file.open(fileName.c_str());
if (file.is_open()) {
LLSDSerialize::toPrettyXML(gridInfo, file);
file.close();
llinfos << "Saved grids to " << fileName << llendl;
} else {
llerrs << "Unable to open grid info file: " << fileName << llendl;
}
}
示例2: updateGridCombo
// static
void LLPanelLogin::updateGridCombo(std::string grid_nick)
{
LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
if (grid_nick.empty())
{
// The user twiddled with the grid choice ui.
// apply the selection to the grid setting.
//std::string grid_label;
//S32 grid_index;
grid_nick = combo->getValue().asString();
HippoGridInfo *gridInfo = gHippoGridManager->getGrid(grid_nick);
if (gridInfo) {
//childSetText("gridnick", gridInfo->getGridNick());
//platform->setCurrentByIndex(gridInfo->getPlatform());
//childSetText("gridname", gridInfo->getGridName());
LLPanelLogin::setFields( gridInfo->getFirstName(), gridInfo->getLastName(), gridInfo->getAvatarPassword());
}
}
else
{
combo->setSimple(grid_nick);
}
gHippoGridManager->setCurrentGrid(grid_nick);
llinfos << "current grid set to " << grid_nick << llendl;
// grid changed so show new splash screen (possibly)
loadLoginPage();
// save grid choice to settings
gSavedSettings.setString("LastSelectedGrid", grid_nick);
}
示例3: refreshGrids
void FloaterGridManager::refreshGrids()
{
LLScrollListCtrl *grids = FloaterGridManager::getInstance()->getChild<LLScrollListCtrl>("grid_selector");
std::string lastSelectedItem;
LLSD element;
if (grids->getFirstSelected())
{
lastSelectedItem = grids->getFirstSelected()->getValue().asString();
}
grids->deleteAllItems();
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())
{
element["id"] = grid_nick;
element["columns"][0]["column"] = "grid";
element["columns"][0]["type"] = "text";
element["columns"][0]["value"] = grid_nick;
grids->addElement(element, ADD_BOTTOM);
}
}
// Setting the default needs to be rethought.
// Right now, we just use the last-selected grid,
// but leaving this as the current behavior for now
if (!gHippoGridManager->getCurrentGridNick().empty())
{
element["id"] = gHippoGridManager->getCurrentGridNick();
element["columns"][0]["column"] = "grid";
element["columns"][0]["type"] = "text";
element["columns"][0]["font-style"] = "BOLD";
element["columns"][0]["value"] = gHippoGridManager->getCurrentGridNick();
grids->addElement(element, ADD_TOP);
}
// Reselect the item if we had one selected
if (lastSelectedItem.empty())
{
grids->selectItemByLabel(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("<new>", ADD_BOTTOM);
}
//if (selectIndex >= 0)
//{
// grids->setCurrentByIndex(selectIndex);
//}
//else
//{
// grids->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_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()->getCurGrid());
if (gridInfo)
{
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);
//.........这里部分代码省略.........