本文整理汇总了C++中LLViewerInventoryItem::regenerateLink方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerInventoryItem::regenerateLink方法的具体用法?C++ LLViewerInventoryItem::regenerateLink怎么用?C++ LLViewerInventoryItem::regenerateLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerInventoryItem
的用法示例。
在下文中一共展示了LLViewerInventoryItem::regenerateLink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onCustomAction
void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
{
if (!isActionEnabled(userdata))
return;
const std::string command_name = userdata.asString();
if (command_name == "new_window")
{
newWindow();
}
if (command_name == "sort_by_name")
{
const LLSD arg = "name";
setSortBy(arg);
}
if (command_name == "sort_by_recent")
{
const LLSD arg = "date";
setSortBy(arg);
}
if (command_name == "show_filters")
{
toggleFindOptions();
}
if (command_name == "reset_filters")
{
resetFilters();
}
if (command_name == "close_folders")
{
closeAllFolders();
}
if (command_name == "empty_trash")
{
const std::string notification = "ConfirmEmptyTrash";
gInventory.emptyFolderType(notification, LLFolderType::FT_TRASH);
}
if (command_name == "empty_lostnfound")
{
const std::string notification = "ConfirmEmptyLostAndFound";
gInventory.emptyFolderType(notification, LLFolderType::FT_LOST_AND_FOUND);
}
if (command_name == "save_texture")
{
saveTexture(userdata);
}
// This doesn't currently work, since the viewer can't change an assetID an item.
if (command_name == "regenerate_link")
{
LLInventoryPanel *active_panel = getActivePanel();
LLFolderViewItem* current_item = active_panel->getRootFolder()->getCurSelectedItem();
if (!current_item)
{
return;
}
const LLUUID item_id = current_item->getListener()->getUUID();
LLViewerInventoryItem *item = gInventory.getItem(item_id);
if (item)
{
item->regenerateLink();
}
active_panel->setSelection(item_id, TAKE_FOCUS_NO);
}
if (command_name == "find_original")
{
LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
if (!current_item)
{
return;
}
current_item->getListener()->performAction(getActivePanel()->getModel(), "goto");
}
if (command_name == "find_links")
{
LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
if (!current_item)
{
return;
}
const LLUUID& item_id = current_item->getListener()->getUUID();
const std::string &item_name = current_item->getListener()->getName();
mFilterSubString = item_name;
LLInventoryFilter *filter = mActivePanel->getFilter();
filter->setFilterSubString(item_name);
mFilterEditor->setText(item_name);
mFilterEditor->setFocus(TRUE);
filter->setFilterUUID(item_id);
filter->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
filter->setFilterLinks(LLInventoryFilter::FILTERLINK_ONLY_LINKS);
}
}