本文整理汇总了C++中HippoGridInfo::getPlatform方法的典型用法代码示例。如果您正苦于以下问题:C++ HippoGridInfo::getPlatform方法的具体用法?C++ HippoGridInfo::getPlatform怎么用?C++ HippoGridInfo::getPlatform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HippoGridInfo
的用法示例。
在下文中一共展示了HippoGridInfo::getPlatform方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: retrieveGridInfo
void HippoPanelGridsImpl::retrieveGridInfo()
{
std::string loginuri = childGetValue("loginuri");
if ((loginuri == "") || (loginuri == "<required>")) {
LLNotificationsUtil::add("GridInfoNoLoginUri");
return;
}
HippoGridInfo *grid = 0;
bool cleanupGrid = false;
if (mState == NORMAL) {
grid = gHippoGridManager->getGrid(mCurGrid);
} else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
grid = new HippoGridInfo("");
cleanupGrid = true;
} else {
llerrs << "Illegal state " << mState << '.' << llendl;
return;
}
if (!grid) {
llerrs << "Internal error retrieving grid info." << llendl;
return;
}
grid->setLoginUri(loginuri);
try
{
grid->getGridInfo();
if (grid->getPlatform() != HippoGridInfo::PLATFORM_OTHER)
getChild<LLComboBox>("platform")->setCurrentByIndex(grid->getPlatform());
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());
if (grid->getGridMessage() != "") childSetText("gridmessage", grid->getGridMessage());
}
catch(AIAlert::ErrorCode const& error)
{
if (error.getCode() == HTTP_METHOD_NOT_ALLOWED || error.getCode() == HTTP_OK)
{
AIAlert::add("GridInfoError", error);
}
else
{
// Append GridInfoErrorInstruction to error message.
AIAlert::add("GridInfoError", AIAlert::Error(AIAlert::Prefix(), AIAlert::not_modal, error, "GridInfoErrorInstruction"));
}
}
if (cleanupGrid) delete grid;
}
示例2: 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();
gridInfo[i]["inventory_links"] = grid->supportsInvLinks();
}
// write client grid info file
std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg1.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
{
llwarns << "Unable to open grid info file for save: " << fileName << llendl;
}
}
示例3: loadCurGrid
void HippoPanelGridsImpl::loadCurGrid()
{
HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid);
if (gridInfo && (mState != ADD_NEW)) {
LLComboBox *platform = getChild<LLComboBox>("platform");
if (platform) platform->setCurrentByIndex(gridInfo->getPlatform());
childSetText("gridname", gridInfo->getGridName());
childSetText("loginuri", gridInfo->getLoginUri());
childSetText("loginpage", gridInfo->getLoginPage());
childSetText("helperuri", gridInfo->getHelperUri());
childSetText("website", gridInfo->getWebSite());
childSetText("support", gridInfo->getSupportUrl());
childSetText("search", gridInfo->getSearchUrl());
childSetText("register", gridInfo->getRegisterUrl());
childSetText("password", gridInfo->getPasswordUrl());
childSetValue("render_compat", gridInfo->isRenderCompat());
enableEditing(!gridInfo->getLocked());
} else {
std::string empty = "";
LLComboBox *platform = getChild<LLComboBox>("platform");
if (platform) platform->setCurrentByIndex(HippoGridInfo::PLATFORM_OTHER);
childSetText("gridname", empty);
childSetText("loginuri", empty);
childSetText("loginpage", empty);
childSetText("helperuri", empty);
childSetText("website", empty);
childSetText("support", empty);
childSetText("search", empty);
childSetText("register", empty);
childSetText("password", empty);
childSetValue("render_compat", true);
enableEditing(true);
}
if (mState == ADD_NEW) {
std::string required = "<required>";
childSetText("gridname", required);
childSetText("loginuri", required);
} else if (mState == ADD_COPY) {
childSetText("gridname", std::string("<required>"));
enableEditing(true);
} else if (mState != NORMAL) {
llwarns << "Illegal state " << mState << '.' << llendl;
}
refresh();
}
示例4: 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);
//.........这里部分代码省略.........