本文整理汇总了C++中LLPanelFriends类的典型用法代码示例。如果您正苦于以下问题:C++ LLPanelFriends类的具体用法?C++ LLPanelFriends怎么用?C++ LLPanelFriends使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLPanelFriends类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onClickRemove
// static
void LLPanelFriends::onClickRemove(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickRemove()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
LLStringUtil::format_map_t args;
if(ids.size() > 0)
{
std::string msgType = "RemoveFromFriends";
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
std::string first, last;
if(gCacheName->getName(agent_id, first, last))
{
args["[FIRST_NAME]"] = first;
args["[LAST_NAME]"] = last;
}
}
else
{
msgType = "RemoveMultipleFromFriends";
}
gViewerWindow->alertXml(msgType,
args,
&handleRemove,
(void*)new LLDynamicArray<LLUUID>(ids));
}
}
示例2: modifyRightsConfirmation
// static
void LLPanelFriends::modifyRightsConfirmation(S32 option, void* user_data)
{
std::pair<LLPanelFriends*, rights_map_t*>* data = (std::pair<LLPanelFriends*, rights_map_t*>*)user_data;
LLPanelFriends* panelp = data->first;
if(panelp)
{
if(0 == option)
{
panelp->sendRightsGrant(*(data->second));
}
else
{
// need to resync view with model, since user cancelled operation
rights_map_t* rights = data->second;
rights_map_t::iterator rights_it;
for (rights_it = rights->begin(); rights_it != rights->end(); ++rights_it)
{
const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(rights_it->first);
panelp->updateFriendItem(rights_it->first, info);
// Might have changed the column the user is sorted on.
panelp->mFriendsList->sortItems();
}
}
panelp->refreshUI();
}
delete data->second;
delete data;
}
示例3: onClickIM
// static
void LLPanelFriends::onClickIM(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickIM()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() > 0)
{
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(agent_id);
std::string fullname;
if(info && gCacheName->getFullName(agent_id, fullname))
{
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession(fullname, IM_NOTHING_SPECIAL, agent_id);
}
}
else
{
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession("Friends Conference", IM_SESSION_CONFERENCE_START, ids[0], ids);
}
make_ui_sound("UISndStartIM");
}
}
示例4: updateColumns
void LLPanelFriends::updateColumns(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
if (panelp)
{
LLButton* expand_button = panelp->getChild<LLButton>("expand_collapse_btn");
LLScrollListCtrl* list = panelp->getChild<LLScrollListCtrl>("friend_list");
//llinfos << "Refreshing UI" << llendl;
S32 width = 22;
std::string button = ">";
if (gSavedSettings.getBOOL("ContactListCollapsed"))
{
width = 0;
button = "<";
}
expand_button->setLabel(button);
LLScrollListColumn* column = list->getColumn(5);
list->updateStaticColumnWidth(column, width);
column->setWidth(width);
column = list->getColumn(6);
list->updateStaticColumnWidth(column, width);
column->setWidth(width);
column = list->getColumn(7);
list->updateStaticColumnWidth(column, width);
column->setWidth(width);
list->updateLayout();
if (!gSavedSettings.getBOOL("ContactListCollapsed"))
{
panelp->updateFriends(LLFriendObserver::ADD);
}
}
}
示例5: onContactSearchKeystroke
void LLPanelFriends::onContactSearchKeystroke(const std::string& search_string, void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
if (panelp)
{
panelp->filterContacts(search_string);
}
}
示例6: onClickRemove
// static
void LLPanelFriends::onClickRemove(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickRemove()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
LLSD args;
if(ids.size() > 0)
{
std::string msgType = "RemoveFromFriends";
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
std::string first, last;
if(gCacheName->getName(agent_id, first, last))
{
if (LLAvatarNameCache::useDisplayNames() && !gSavedSettings.getBOOL("LegacyNamesForFriends"))
{
LLAvatarName avatar_name;
if (LLAvatarNameCache::get(agent_id, &avatar_name))
{
// Always show "Display Name [Legacy Name]" for security reasons
first = avatar_name.getNames();
size_t i = first.find(" ");
if (i != std::string::npos)
{
last = first.substr(i + 1);
first = first.substr(0, i);
}
else
{
last = "";
}
}
}
args["FIRST_NAME"] = first;
args["LAST_NAME"] = last;
}
}
else
{
msgType = "RemoveMultipleFromFriends";
}
LLSD payload;
for (LLDynamicArray<LLUUID>::iterator it = ids.begin();
it != ids.end();
++it)
{
payload["ids"].append(*it);
}
LLNotifications::instance().add(msgType,
args,
payload,
&handleRemove);
}
}
示例7: onClickRemove
// static
void LLPanelFriends::onClickRemove(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickRemove()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
LLSD args;
if(ids.size() > 0)
{
std::string msgType = "RemoveFromFriends";
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
// [Ansariel: Display name support]
//std::string first, last;
//if(gCacheName->getName(agent_id, first, last))
//{
// args["FIRST_NAME"] = first;
// args["LAST_NAME"] = last;
//}
LLAvatarName avatar_name;
if (LLAvatarNameCache::get(agent_id, &avatar_name))
{
std::string fullname;
static const LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
switch (phoenix_name_system)
{
case 0 : fullname = avatar_name.getLegacyName(); break;
case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
case 2 : fullname = avatar_name.mDisplayName; break;
default : fullname = avatar_name.getCompleteName(); break;
}
args["NAME"] = fullname;
}
// [/Ansariel: Display name support]
}
else
{
msgType = "RemoveMultipleFromFriends";
}
LLSD payload;
for (LLDynamicArray<LLUUID>::iterator it = ids.begin();
it != ids.end();
++it)
{
payload["ids"].append(*it);
}
LLNotifications::instance().add(msgType,
args,
payload,
&handleRemove);
}
}
示例8: onClickAssign
// static
void LLPanelFriends::onClickAssign(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
if (panelp)
{
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
ASFloaterContactGroups::show(ids);
}
}
示例9: onChangeContactGroup
void LLPanelFriends::onChangeContactGroup(LLUICtrl* ctrl, void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
if(panelp)
{
LLComboBox* combo = panelp->getChild<LLComboBox>("buddy_group_combobox");
panelp->setContactGroup(combo->getValue().asString());
}
}
示例10: onClickPay
// static
void LLPanelFriends::onClickPay(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
std::vector<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() == 1)
{
LLAvatarActions::pay(ids[0]);
}
}
示例11: onClickPay
// static
void LLPanelFriends::onClickPay(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() == 1)
{
handle_pay_by_id(ids[0]);
}
}
示例12: onClickOfferTeleport
// static
void LLPanelFriends::onClickOfferTeleport(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() > 0)
{
handle_lure(ids);
}
}
示例13: onClickProfile
// static
void LLPanelFriends::onClickProfile(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
std::vector<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() > 0)
{
LLUUID agent_id = ids[0];
LLAvatarActions::showProfile(agent_id);
}
}
示例14: onSelectName
// static
void LLPanelFriends::onSelectName(LLUICtrl* ctrl, void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
if(panelp)
{
panelp->refreshUI();
// check to see if rights have changed
panelp->applyRightsToFriends();
}
}
示例15: onContactSearchKeystroke
void LLPanelFriends::onContactSearchKeystroke(LLLineEditor* caller, void* user_data)
{
if (caller)
{
LLPanelFriends* panelp = (LLPanelFriends*)caller->getParent();
if (panelp)
{
panelp->filterContacts();
}
}
}