本文整理汇总了C++中LLInvFVBridge::performAction方法的典型用法代码示例。如果您正苦于以下问题:C++ LLInvFVBridge::performAction方法的具体用法?C++ LLInvFVBridge::performAction怎么用?C++ LLInvFVBridge::performAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLInvFVBridge
的用法示例。
在下文中一共展示了LLInvFVBridge::performAction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doToSelected
bool doToSelected(LLFolderView* folder, std::string action)
{
LLInventoryModel* model = &gInventory;
if ("rename" == action)
{
folder->startRenamingSelectedItem();
return true;
}
if ("delete" == action)
{
folder->removeSelectedItems();
return true;
}
if ("copy" == action)
{
LLInventoryClipboard::instance().reset();
}
// <edit>
if("save_as" == action)
{
LLInventoryBackup::save(folder);
return true;
}
else if("save_invcache" == action)
{
LLFilePicker& file_picker = LLFilePicker::instance();
if(file_picker.getSaveFile( LLFilePicker::FFSAVE_INVGZ ))
{
std::string file_name = file_picker.getFirstFile();
LLLocalInventory::saveInvCache(file_name, folder);
}
return true;
}
/*
else if("acquire_asset_id" == action)
{
if(LLCheats::cheatCodes["AcquireAssetID"].entered)
{
std::set<LLUUID> selected_items_set;
folder->getSelectionList(selected_items_set);
if(selected_items_set.size() > 0)
{
LLAssetIDAcquirer::acquire(selected_items_set);
}
}
return true;
}
else if("magic_get" == action)
{
std::set<LLUUID> selected_items_set;
folder->getSelectionList(selected_items_set);
if(selected_items_set.size() > 0)
{
LLNotecardMagic::acquire(selected_items_set);
}
}
*/
// </edit>
std::set<LLUUID> selected_items;
folder->getSelectionList(selected_items);
LLMultiPreview* multi_previewp = NULL;
LLMultiProperties* multi_propertiesp = NULL;
if (("task_open" == action || "open" == action) && selected_items.size() > 1)
{
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
multi_previewp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100));
gFloaterView->addChild(multi_previewp);
LLFloater::setFloaterHost(multi_previewp);
}
else if (("task_properties" == action || "properties" == action) && selected_items.size() > 1)
{
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
multi_propertiesp = new LLMultiProperties(LLRect(left, top, left + 100, top - 100));
gFloaterView->addChild(multi_propertiesp);
LLFloater::setFloaterHost(multi_propertiesp);
}
std::set<LLUUID>::iterator set_iter;
for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter)
{
LLFolderViewItem* folder_item = folder->getItemByID(*set_iter);
if(!folder_item) continue;
LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getListener();
if(!bridge) continue;
bridge->performAction(folder, model, action);
//.........这里部分代码省略.........
示例2: doToSelected
bool LLInventoryAction::doToSelected(LLFolderView* folder, std::string action)
{
if (!folder)
return true;
LLInventoryModel* model = &gInventory;
if ("rename" == action)
{
folder->startRenamingSelectedItem();
return true;
}
else if ("delete" == action)
{
folder->removeSelectedItems();
return true;
}
else if ("copy" == action || "cut" == action)
{
LLInventoryClipboard::instance().reset();
}
else if ("save_as" == action)
{
LLInventoryBackup::save(folder);
return true;
}
else if ("save_invcache" == action)
{
//AIFilePicker* filepicker = AIFilePicker::create();
//filepicker->open(FFLOAD_INVGZ, "", "invgz");
LLLocalInventory::saveInvCache(folder);
}
std::set<LLUUID> selected_items = folder->getSelectionList();
LLMultiFloater* multi_floaterp = NULL;
if (("task_open" == action || "open" == action) && selected_items.size() > 1)
{
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
multi_floaterp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100));
gFloaterView->addChild(multi_floaterp);
LLFloater::setFloaterHost(multi_floaterp);
}
else if (("task_properties" == action || "properties" == action) && selected_items.size() > 1)
{
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
multi_floaterp = new LLMultiProperties(LLRect(left, top, left + 100, top - 100));
gFloaterView->addChild(multi_floaterp);
LLFloater::setFloaterHost(multi_floaterp);
}
std::set<LLUUID>::iterator set_iter;
for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter)
{
LLFolderViewItem* folder_item = folder->getItemByID(*set_iter);
if(!folder_item) continue;
LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getListener();
if(!bridge) continue;
bridge->performAction(model, action);
}
LLFloater::setFloaterHost(NULL);
if (multi_floaterp)
{
multi_floaterp->open();
}
return true;
}
示例3: doToSelected
//.........这里部分代码省略.........
LLNotificationsUtil::add("ConfirmListingCutOrDelete", LLSD(), LLSD(), boost::bind(&LLInventoryAction::callback_doToSelected, _1, _2, root, action));
return true;
}
}
}
// Copying to the marketplace needs confirmation if nocopy items are involved
if (("copy_to_marketplace_listings" == action))
{
std::set<LLUUID>::iterator set_iter = selected_items.begin();
if (contains_nocopy_items(*set_iter))
{
LLNotificationsUtil::add("ConfirmCopyToMarketplace", LLSD(), LLSD(), boost::bind(&LLInventoryAction::callback_copySelected, _1, _2, root, action));
return true;
}
}
// Keep track of the marketplace folders that will need update of their status/name after the operation is performed
buildMarketplaceFolders(root);
LLInventoryModel* model = &gInventory;
if ("rename" == action)
{
root->startRenamingSelectedItem();
// Update the marketplace listings that have been affected by the operation
updateMarketplaceFolders();
return true;
}
if ("delete" == action)
{
root->removeSelectedItems();
// Update the marketplace listings that have been affected by the operation
updateMarketplaceFolders();
return true;
}
if ("copy" == action || "cut" == action)
{
LLInventoryClipboard::instance().reset();
}
LLMultiFloater* multi_floaterp = NULL;
if (("task_open" == action || "open" == action) && selected_items.size() > 1)
{
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
multi_floaterp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100));
gFloaterView->addChild(multi_floaterp);
LLFloater::setFloaterHost(multi_floaterp);
}
else if (("task_properties" == action || "properties" == action) && selected_items.size() > 1)
{
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
multi_floaterp = new LLMultiProperties(LLRect(left, top, left + 100, top - 100));
gFloaterView->addChild(multi_floaterp);
LLFloater::setFloaterHost(multi_floaterp);
}
std::set<LLUUID>::iterator set_iter;
// This rather warty piece of code is to allow items to be removed
// from the avatar in a batch, eliminating redundant
// updateAppearanceFromCOF() requests further down the line. (MAINT-4918)
//
// There are probably other cases where similar batching would be
// desirable, but the current item-by-item performAction()
// approach would need to be reworked.
uuid_vec_t object_uuids_to_remove;
if (isRemoveAction(action) && get_selection_object_uuids(root, object_uuids_to_remove))
{
LLAppearanceMgr::instance().removeItemsFromAvatar(object_uuids_to_remove);
}
else
{
for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter)
{
LLFolderViewItem* folder_item = root->getItemByID(*set_iter);
if(!folder_item) continue;
LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getListener();
if(!bridge) continue;
bridge->performAction(model, action);
}
}
LLFloater::setFloaterHost(NULL);
if (multi_floaterp)
{
multi_floaterp->open();
}
return true;
}