本文整理汇总了C++中LLFolderView::getSelectionList方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFolderView::getSelectionList方法的具体用法?C++ LLFolderView::getSelectionList怎么用?C++ LLFolderView::getSelectionList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLFolderView
的用法示例。
在下文中一共展示了LLFolderView::getSelectionList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hasItemsSelected
bool LLPanelOutfitsInventory::hasItemsSelected()
{
bool has_items_selected = false;
LLFolderView *folder = getActivePanel()->getRootFolder();
if (folder)
{
std::set<LLUUID> selection_set;
folder->getSelectionList(selection_set);
has_items_selected = (selection_set.size() > 0);
}
return has_items_selected;
}
示例2: handleEvent
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryPanel *panel = mPtr;
LLFolderView* folder = panel->getRootFolder();
if(!folder) return true;
std::set<LLUUID> selected_items = folder->getSelectionList();
LLUUID id = *selected_items.begin();
std::string joint_name = userdata.asString();
LLViewerJointAttachment* attachmentp = NULL;
for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin();
iter != gAgentAvatarp->mAttachmentPoints.end(); )
{
LLVOAvatar::attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if (attachment->getName() == joint_name)
{
attachmentp = attachment;
break;
}
}
if (!attachmentp)
{
return true;
}
if (LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getLinkedItem(id))
{
if(gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID()))
{
rez_attachment(item, attachmentp); // don't replace if called from an "Attach To..." menu
}
else if(item->isFinished())
{
// must be in library. copy it to our inventory and put it on.
// LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(&rez_attachment_cb, _1, attachmentp));
// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2013-02-04 (Catznip-3.4)
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(&rez_attachment_cb, _1, attachmentp, false));
// [/SL;KB]
copy_inventory_item(
gAgentID,
item->getPermissions().getOwner(),
item->getUUID(),
LLUUID::null,
std::string(),
cb);
}
}
gFocusMgr.setKeyboardFocus(NULL);
return true;
}
示例3: handleEvent
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryPanel *panel = mPtr;
LLFolderView* folder = panel->getRootFolder();
if(!folder) return true;
std::set<LLUUID> selected_items;
folder->getSelectionList(selected_items);
LLUUID id = *selected_items.begin();
std::string joint_name = userdata.asString();
LLVOAvatar *avatarp = gAgent.getAvatarObject();
LLViewerJointAttachment* attachmentp = NULL;
for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin();
iter != avatarp->mAttachmentPoints.end(); )
{
LLVOAvatar::attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if (attachment->getName() == joint_name)
{
attachmentp = attachment;
break;
}
}
if (attachmentp == NULL)
{
return true;
}
LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(id);
if(item && gInventory.isObjectDescendentOf(id, gAgent.getInventoryRootID()))
{
rez_attachment(item, attachmentp);
}
else if(item && item->isComplete())
{
// must be in library. copy it to our inventory and put it on.
LLPointer<LLInventoryCallback> cb = new RezAttachmentCallback(attachmentp);
copy_inventory_item(
gAgent.getID(),
item->getPermissions().getOwner(),
item->getUUID(),
LLUUID::null,
std::string(),
cb);
}
gFocusMgr.setKeyboardFocus(NULL);
return true;
}
示例4: isActionEnabled
BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
{
const std::string command_name = userdata.asString();
if (command_name == "delete")
{
BOOL can_delete = FALSE;
LLFolderView* root = getActivePanel()->getRootFolder();
if (root)
{
can_delete = TRUE;
std::set<LLUUID> selection_set = root->getSelectionList();
if (selection_set.empty()) return FALSE;
for (std::set<LLUUID>::iterator iter = selection_set.begin();
iter != selection_set.end();
++iter)
{
const LLUUID &item_id = (*iter);
LLFolderViewItem *item = root->getItemByID(item_id);
const LLFolderViewEventListener *listener = item->getListener();
llassert(listener);
if (!listener) return FALSE;
can_delete &= listener->isItemRemovable();
can_delete &= !listener->isItemInTrash();
}
return can_delete;
}
return FALSE;
}
if (command_name == "save_texture")
{
return isSaveTextureEnabled(userdata);
}
if (command_name == "find_original")
{
LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
if (!current_item) return FALSE;
const LLUUID& item_id = current_item->getListener()->getUUID();
const LLViewerInventoryItem *item = gInventory.getItem(item_id);
if (item && item->getIsLinkType() && !item->getIsBrokenLink())
{
return TRUE;
}
return FALSE;
}
if (command_name == "find_links")
{
LLFolderView* root = getActivePanel()->getRootFolder();
std::set<LLUUID> selection_set = root->getSelectionList();
if (selection_set.size() != 1) return FALSE;
LLFolderViewItem* current_item = root->getCurSelectedItem();
if (!current_item) return FALSE;
const LLUUID& item_id = current_item->getListener()->getUUID();
const LLInventoryObject *obj = gInventory.getObject(item_id);
if (obj && !obj->getIsLinkType() && LLAssetType::lookupCanLink(obj->getType()))
{
return TRUE;
}
return FALSE;
}
// This doesn't currently work, since the viewer can't change an assetID an item.
if (command_name == "regenerate_link")
{
LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
if (!current_item) return FALSE;
const LLUUID& item_id = current_item->getListener()->getUUID();
const LLViewerInventoryItem *item = gInventory.getItem(item_id);
if (item && item->getIsBrokenLink())
{
return TRUE;
}
return FALSE;
}
if (command_name == "share")
{
LLSidepanelInventory* parent = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
return parent ? parent->canShare() : FALSE;
}
return TRUE;
}
示例5: isActionEnabled
BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
{
const std::string command_name = userdata.asString();
if (command_name == "delete" || command_name == "remove")
{
BOOL can_delete = FALSE;
LLFolderView *folder = getActivePanel()->getRootFolder();
if (folder)
{
std::set<LLUUID> selection_set;
folder->getSelectionList(selection_set);
can_delete = (selection_set.size() > 0);
for (std::set<LLUUID>::iterator iter = selection_set.begin();
iter != selection_set.end();
++iter)
{
const LLUUID &item_id = (*iter);
LLFolderViewItem *item = folder->getItemByID(item_id);
can_delete &= item->getListener()->isItemRemovable();
}
return can_delete;
}
return FALSE;
}
if (command_name == "remove_link")
{
BOOL can_delete = FALSE;
LLFolderView *folder = getActivePanel()->getRootFolder();
if (folder)
{
std::set<LLUUID> selection_set;
folder->getSelectionList(selection_set);
can_delete = (selection_set.size() > 0);
for (std::set<LLUUID>::iterator iter = selection_set.begin();
iter != selection_set.end();
++iter)
{
const LLUUID &item_id = (*iter);
LLViewerInventoryItem *item = gInventory.getItem(item_id);
if (!item || !item->getIsLinkType())
return FALSE;
}
return can_delete;
}
return FALSE;
}
if (command_name == "rename" ||
command_name == "delete_outfit")
{
return (getCorrectListenerForAction() != NULL) && hasItemsSelected();
}
if (command_name == "wear")
{
if (isCOFPanelActive())
{
return FALSE;
}
}
if (command_name == "make_outfit")
{
return TRUE;
}
if (command_name == "edit" ||
command_name == "add"
)
{
return (getCorrectListenerForAction() != NULL);
}
return TRUE;
}