本文整理汇总了C++中LLViewerInventoryItem::isComplete方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerInventoryItem::isComplete方法的具体用法?C++ LLViewerInventoryItem::isComplete怎么用?C++ LLViewerInventoryItem::isComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerInventoryItem
的用法示例。
在下文中一共展示了LLViewerInventoryItem::isComplete方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show
// static
LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID& item_id, const LLUUID& object_id, BOOL take_focus)
{
LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(item_id);
if (previewp)
{
previewp->open(); /*Flawfinder: ignore*/
if (take_focus)
{
previewp->setFocus(TRUE);
}
return previewp;
}
LLPreviewGesture* self = new LLPreviewGesture();
// Finish internal construction
self->init(item_id, object_id);
// Builds and adds to gFloaterView
gUICtrlFactory->buildFloater(self, "floater_preview_gesture.xml");
self->setTitle(title);
// Move window to top-left of screen
LLMultiFloater* hostp = self->getHost();
if (hostp == NULL)
{
LLRect r = self->getRect();
LLRect screen = gFloaterView->getRect();
r.setLeftTopAndSize(0, screen.getHeight(), r.getWidth(), r.getHeight());
self->setRect(r);
}
else
{
// re-add to host to update title
hostp->addFloater(self, TRUE);
}
// this will call refresh when we have everything.
LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->getItem();
if(item && !item->isComplete())
{
LLInventoryGestureAvailable* observer;
observer = new LLInventoryGestureAvailable();
observer->watchItem(item_id);
gInventory.addObserver(observer);
item->fetchFromServer();
}
else
{
// not sure this is necessary.
self->refresh();
}
if (take_focus)
{
self->setFocus(TRUE);
}
return self;
}
示例2: changed
void LLInventoryCompletionObserver::changed(U32 mask)
{
// scan through the incomplete items and move or erase them as
// appropriate.
if(!mIncomplete.empty())
{
for(item_ref_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); )
{
LLViewerInventoryItem* item = gInventory.getItem(*it);
if(!item)
{
it = mIncomplete.erase(it);
continue;
}
if(item->isComplete())
{
mComplete.push_back(*it);
it = mIncomplete.erase(it);
continue;
}
++it;
}
if(mIncomplete.empty())
{
done();
}
}
}
示例3: startFetch
void LLInventoryFetchItemsObserver::startFetch()
{
LLUUID owner_id;
LLSD items_llsd;
for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it)
{
LLViewerInventoryItem* item = gInventory.getItem(*it);
if (item)
{
if (item->isComplete())
{
// It's complete, so put it on the complete container.
mComplete.push_back(*it);
continue;
}
else
{
owner_id = item->getPermissions().getOwner();
}
}
else
{
// assume it's agent inventory.
owner_id = gAgent.getID();
}
// Ignore categories since they're not items. We
// could also just add this to mComplete but not sure what the
// side-effects would be, so ignoring to be safe.
LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
if (cat)
{
continue;
}
// It's incomplete, so put it on the incomplete container, and
// pack this on the message.
mIncomplete.push_back(*it);
// Prepare the data to fetch
LLSD item_entry;
item_entry["owner_id"] = owner_id;
item_entry["item_id"] = (*it);
items_llsd.append(item_entry);
}
mFetchingPeriod.reset();
mFetchingPeriod.setTimerExpirySec(FETCH_TIMER_EXPIRY);
fetch_items_from_llsd(items_llsd);
}
示例4: changed
void LLInventoryFetchItemsObserver::changed(U32 mask)
{
lldebugs << this << " remaining incomplete " << mIncomplete.size()
<< " complete " << mComplete.size()
<< " wait period " << mFetchingPeriod.getRemainingTimeF32()
<< llendl;
// scan through the incomplete items and move or erase them as
// appropriate.
if (!mIncomplete.empty())
{
// Have we exceeded max wait time?
bool timeout_expired = mFetchingPeriod.hasExpired();
for (uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); )
{
const LLUUID& item_id = (*it);
LLViewerInventoryItem* item = gInventory.getItem(item_id);
if (item && item->isComplete())
{
mComplete.push_back(item_id);
it = mIncomplete.erase(it);
}
else
{
if (timeout_expired)
{
// Just concede that this item hasn't arrived in reasonable time and continue on.
llwarns << "Fetcher timed out when fetching inventory item UUID: " << item_id << LL_ENDL;
it = mIncomplete.erase(it);
}
else
{
// Keep trying.
++it;
}
}
}
}
if (mIncomplete.empty())
{
lldebugs << this << " done at remaining incomplete "
<< mIncomplete.size() << " complete " << mComplete.size() << llendl;
done();
}
//llinfos << "LLInventoryFetchItemsObserver::changed() mComplete size " << mComplete.size() << llendl;
//llinfos << "LLInventoryFetchItemsObserver::changed() mIncomplete size " << mIncomplete.size() << llendl;
}
示例5: updateInventoryUI
void LLFloaterCustomize::updateInventoryUI()
{
BOOL all_complete = TRUE;
BOOL is_complete = FALSE;
U32 perm_mask = 0x0;
LLPanelEditWearable* panel;
LLViewerInventoryItem* item;
for(S32 i = 0; i < LLWearableType::WT_COUNT; ++i)
{
item = NULL;
panel = mWearablePanelList[i];
if(panel)
{
LLViewerWearable* wearable = panel->getWearable();
if(wearable)
item = gInventory.getItem(wearable->getItemID());
}
if(item)
{
is_complete = item->isComplete();
if(!is_complete)
{
all_complete = FALSE;
}
perm_mask = item->getPermissions().getMaskOwner();
}
else
{
is_complete = false;
perm_mask = 0x0;
}
if(i == mCurrentWearableType)
{
if(panel)
{
panel->setUIPermissions(perm_mask, is_complete);
}
//BOOL is_vis = panel && item && is_complete && (perm_mask & PERM_MODIFY);
//childSetVisible("panel_container", is_vis);
}
}
childSetEnabled("Make Outfit", all_complete);
}
示例6: fetchItems
void LLInventoryFetchObserver::fetchItems(
const LLInventoryFetchObserver::item_ref_t& ids)
{
LLUUID owner_id;
LLSD items_llsd;
for(item_ref_t::const_iterator it = ids.begin(); it < ids.end(); ++it)
{
LLViewerInventoryItem* item = gInventory.getItem(*it);
if(item)
{
if(item->isComplete())
{
// It's complete, so put it on the complete container.
mComplete.push_back(*it);
continue;
}
else
{
owner_id = item->getPermissions().getOwner();
}
}
else
{
// assume it's agent inventory.
owner_id = gAgent.getID();
}
// It's incomplete, so put it on the incomplete container, and
// pack this on the message.
mIncomplete.push_back(*it);
// Prepare the data to fetch
LLSD item_entry;
item_entry["owner_id"] = owner_id;
item_entry["item_id"] = (*it);
items_llsd.append(item_entry);
}
fetch_items_from_llsd(items_llsd);
}
示例7: refresh
void LLPreviewGesture::refresh()
{
// If previewing or item is incomplete, all controls are disabled
LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem();
bool is_complete = (item && item->isComplete()) ? true : false;
if (mPreviewGesture || !is_complete)
{
childSetEnabled("desc", FALSE);
//mDescEditor->setEnabled(FALSE);
mTriggerEditor->setEnabled(FALSE);
mReplaceText->setEnabled(FALSE);
mReplaceEditor->setEnabled(FALSE);
mModifierCombo->setEnabled(FALSE);
mKeyCombo->setEnabled(FALSE);
mLibraryList->setEnabled(FALSE);
mAddBtn->setEnabled(FALSE);
mUpBtn->setEnabled(FALSE);
mDownBtn->setEnabled(FALSE);
mDeleteBtn->setEnabled(FALSE);
mStepList->setEnabled(FALSE);
mOptionsText->setEnabled(FALSE);
mAnimationCombo->setEnabled(FALSE);
mAnimationRadio->setEnabled(FALSE);
mSoundCombo->setEnabled(FALSE);
mChatEditor->setEnabled(FALSE);
mWaitAnimCheck->setEnabled(FALSE);
mWaitTimeCheck->setEnabled(FALSE);
mWaitTimeEditor->setEnabled(FALSE);
mActiveCheck->setEnabled(FALSE);
mSaveBtn->setEnabled(FALSE);
// Make sure preview button is enabled, so we can stop it
mPreviewBtn->setEnabled(TRUE);
return;
}
BOOL modifiable = item->getPermissions().allowModifyBy(gAgent.getID());
childSetEnabled("desc", modifiable);
mTriggerEditor->setEnabled(TRUE);
mLibraryList->setEnabled(modifiable);
mStepList->setEnabled(modifiable);
mOptionsText->setEnabled(modifiable);
mAnimationCombo->setEnabled(modifiable);
mAnimationRadio->setEnabled(modifiable);
mSoundCombo->setEnabled(modifiable);
mChatEditor->setEnabled(modifiable);
mWaitAnimCheck->setEnabled(modifiable);
mWaitTimeCheck->setEnabled(modifiable);
mWaitTimeEditor->setEnabled(modifiable);
mActiveCheck->setEnabled(TRUE);
const std::string& trigger = mTriggerEditor->getText();
BOOL have_trigger = !trigger.empty();
const std::string& replace = mReplaceEditor->getText();
BOOL have_replace = !replace.empty();
LLScrollListItem* library_item = mLibraryList->getFirstSelected();
BOOL have_library = (library_item != NULL);
LLScrollListItem* step_item = mStepList->getFirstSelected();
S32 step_index = mStepList->getFirstSelectedIndex();
S32 step_count = mStepList->getItemCount();
BOOL have_step = (step_item != NULL);
mReplaceText->setEnabled(have_trigger || have_replace);
mReplaceEditor->setEnabled(have_trigger || have_replace);
mModifierCombo->setEnabled(TRUE);
mKeyCombo->setEnabled(TRUE);
mAddBtn->setEnabled(modifiable && have_library);
mUpBtn->setEnabled(modifiable && have_step && step_index > 0);
mDownBtn->setEnabled(modifiable && have_step && step_index < step_count-1);
mDeleteBtn->setEnabled(modifiable && have_step);
// Assume all not visible
mAnimationCombo->setVisible(FALSE);
mAnimationRadio->setVisible(FALSE);
mSoundCombo->setVisible(FALSE);
mChatEditor->setVisible(FALSE);
mWaitAnimCheck->setVisible(FALSE);
mWaitTimeCheck->setVisible(FALSE);
mWaitTimeEditor->setVisible(FALSE);
if (have_step)
{
// figure out the type, show proper options, update text
LLGestureStep* step = (LLGestureStep*)step_item->getUserdata();
EStepType type = step->getType();
switch(type)
{
case STEP_ANIMATION:
{
LLGestureStepAnimation* anim_step = (LLGestureStepAnimation*)step;
mOptionsText->setText("Animation to play:");
mAnimationCombo->setVisible(TRUE);
mAnimationRadio->setVisible(TRUE);
//.........这里部分代码省略.........
示例8: tick
BOOL JCLSLBridge::tick()
{
if(LLStartUp::getStartupState() >= STATE_INVENTORY_SEND)
{
switch(sBridgeStatus)
{
case UNINITIALIZED:
{
/*
We're going to just completely disable this in code, it's shit - CW
if(!gSavedSettings.getBOOL("Meta7BuildBridge"))
{
*/
sBridgeStatus = FAILED;
break;
//}
//cmdline_printchat("initializing");//<< llendl;
LLUUID item_id = findInventoryByName(vBridgeName);
if(gInventory.isEverythingFetched())// || (item_id.notNull() && isworn(item_id)))
{
//cmdline_printchat("inv is fetched");//<< llendl;
if(item_id.notNull())
{
//cmdline_printchat("id="+item_id.asString());
LLViewerInventoryItem* bridge = gInventory.getItem(item_id);
if(bridge)
{
//cmdline_printchat("bridge is ready to attach");//<< llendl;
if(isworn(bridge->getUUID()))
{
//cmdline_printchat("bridge is already worn");//<< llendl;
sBridgeStatus = RECHAN;
}else if(bridge->isComplete())
{
//cmdline_printchat("bridge is complete, attaching");//<< llendl;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addUUIDFast(_PREHASH_ItemID, bridge->getUUID());
msg->addUUIDFast(_PREHASH_OwnerID, bridge->getPermissions().getOwner());
msg->addU8Fast(_PREHASH_AttachmentPt, 128);
pack_permissions_slam(msg, bridge->getFlags(), bridge->getPermissions());
msg->addStringFast(_PREHASH_Name, bridge->getName());
msg->addStringFast(_PREHASH_Description, bridge->getDescription());
msg->sendReliable(gAgent.getRegionHost());
sBridgeStatus = RECHAN;
}
}
}else
{
//cmdline_printchat("no bridge");//<< llendl;
//sBridgeStatus = BUILDING;
std::string directory = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"bridge.xml");
if(!LLFile::isfile(directory.c_str()))
{
//cmdline_printchat("file not there o.o");//<< llendl;
sBridgeStatus = FAILED;
}else
{
//cmdline_printchat("bridge.xml located. importing..");//<< llendl;
gImportTracker.importer(directory,&setBridgeObject);
sBridgeStatus = BUILDING;
}
}
}
}
break;
case RENAMING:
{
////cmdline_printchat("renaming");
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAttach);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addU8Fast(_PREHASH_AttachmentPoint, vCatType);
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, sBridgeObject->getLocalID());
msg->addQuatFast(_PREHASH_Rotation, LLQuaternion(0.0f, 0.0f, 0.0f, 1.0f));
msg->sendReliable(gAgent.getRegion()->getHost());
sBridgeStatus = FOLDERING;
}
break;
case FOLDERING:
{
////cmdline_printchat("foldering");
LLUUID vcatid;
vcatid = gInventory.findCategoryByName(vBridgeOpCat);
if(vcatid.isNull())
{
////cmdline_printchat("creating folder");
vcatid = gInventory.createNewCategory(gAgent.getInventoryRootID(), LLAssetType::AT_NONE, vBridgeOpCat);
//.........这里部分代码省略.........
示例9: writeToAvatar
// Updates the user's avatar's appearance
void LLWearable::writeToAvatar( BOOL set_by_user )
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
ESex old_sex = avatar->getSex();
// Pull params
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
if (((LLViewerVisualParam*)param)->getWearableType() == mType && param->isTweakable())
{
S32 param_id = param->getID();
F32 weight = get_if_there(mVisualParamMap, param_id, param->getDefaultWeight());
// only animate with user-originated changes
if (set_by_user)
{
param->setAnimationTarget(weight, set_by_user);
}
else
{
avatar->setVisualParamWeight( param_id, weight, set_by_user );
}
}
}
// only interpolate with user-originated changes
if (set_by_user)
{
avatar->startAppearanceAnimation(TRUE, TRUE);
}
// Pull texture entries
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType )
{
const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ) );
LLViewerImage* image = gImageList.getImage( image_id );
avatar->setLocTexTE( te, image, set_by_user );
}
}
avatar->updateVisualParams();
if( gFloaterCustomize )
{
LLViewerInventoryItem* item;
item = (LLViewerInventoryItem*)gInventory.getItem(gAgent.getWearableItem(mType));
U32 perm_mask = PERM_NONE;
BOOL is_complete = FALSE;
if(item)
{
perm_mask = item->getPermissions().getMaskOwner();
is_complete = item->isComplete();
if(!is_complete)
{
item->fetchFromServer();
}
}
gFloaterCustomize->setWearable(mType, this, perm_mask, is_complete);
LLFloaterCustomize::setCurrentWearableType( mType );
}
ESex new_sex = avatar->getSex();
if( old_sex != new_sex )
{
avatar->updateSexDependentLayerSets( set_by_user );
}
avatar->updateMeshTextures();
// if( set_by_user )
// {
// gAgent.sendAgentSetAppearance();
// }
}
示例10: updateSaleInfo
void LLFloaterProperties::updateSaleInfo()
{
LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem();
if(!item) return;
LLSaleInfo sale_info(item->getSaleInfo());
if(!gAgent.allowOperation(PERM_TRANSFER, item->getPermissions(), GP_OBJECT_SET_SALE))
{
childSetValue("CheckPurchase",LLSD((BOOL)FALSE));
}
if((BOOL)childGetValue("CheckPurchase"))
{
// turn on sale info
LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY;
LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("RadioSaleType");
if(RadioSaleType)
{
switch (RadioSaleType->getSelectedIndex())
{
case 0:
sale_type = LLSaleInfo::FS_ORIGINAL;
break;
case 1:
sale_type = LLSaleInfo::FS_COPY;
break;
case 2:
sale_type = LLSaleInfo::FS_CONTENTS;
break;
default:
sale_type = LLSaleInfo::FS_COPY;
break;
}
}
if (sale_type == LLSaleInfo::FS_COPY
&& !gAgent.allowOperation(PERM_COPY, item->getPermissions(),
GP_OBJECT_SET_SALE))
{
sale_type = LLSaleInfo::FS_ORIGINAL;
}
LLLineEditor* EditPrice = getChild<LLLineEditor>("EditPrice");
S32 price = -1;
if(EditPrice)
{
price = atoi(EditPrice->getText().c_str());
}
// Invalid data - turn off the sale
if (price < 0)
{
sale_type = LLSaleInfo::FS_NOT;
price = 0;
}
sale_info.setSaleType(sale_type);
sale_info.setSalePrice(price);
}
else
{
sale_info.setSaleType(LLSaleInfo::FS_NOT);
}
if(sale_info != item->getSaleInfo()
&& item->isComplete())
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
// Force an update on the sale price at rez
if (item->getType() == LLAssetType::AT_OBJECT)
{
U32 flags = new_item->getFlags();
flags |= LLInventoryItem::II_FLAGS_OBJECT_SLAM_SALE;
new_item->setFlags(flags);
}
new_item->setSaleInfo(sale_info);
if(mObjectID.isNull())
{
// This is in the agent's inventory.
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
else
{
// This is in an object's contents.
LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
new_item,
TASK_INVENTORY_ITEM_KEY,
false);
}
}
}
else
{
// need to make sure we don't just follow the click
//.........这里部分代码省略.........
示例11: onCommitPermissions
// static
void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
{
//llinfos << "LLFloaterProperties::onCommitPermissions()" << llendl;
LLFloaterProperties* self = (LLFloaterProperties*)data;
if(!self) return;
LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem();
if(!item) return;
LLPermissions perm(item->getPermissions());
LLCheckBoxCtrl* CheckShareWithGroup = self->getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
if(CheckShareWithGroup)
{
perm.setGroupBits(gAgent.getID(), gAgent.getGroupID(),
CheckShareWithGroup->get(),
PERM_MODIFY | PERM_MOVE | PERM_COPY);
}
LLCheckBoxCtrl* CheckEveryoneCopy = self->getChild<LLCheckBoxCtrl>("CheckEveryoneCopy");
if(CheckEveryoneCopy)
{
perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(),
CheckEveryoneCopy->get(), PERM_COPY);
}
LLCheckBoxCtrl* CheckNextOwnerModify = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerModify");
if(CheckNextOwnerModify)
{
perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
CheckNextOwnerModify->get(), PERM_MODIFY);
}
LLCheckBoxCtrl* CheckNextOwnerCopy = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerCopy");
if(CheckNextOwnerCopy)
{
perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
CheckNextOwnerCopy->get(), PERM_COPY);
}
LLCheckBoxCtrl* CheckNextOwnerTransfer = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerTransfer");
if(CheckNextOwnerTransfer)
{
perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
CheckNextOwnerTransfer->get(), PERM_TRANSFER);
}
if(perm != item->getPermissions()
&& item->isComplete())
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setPermissions(perm);
U32 flags = new_item->getFlags();
// If next owner permissions have changed (and this is an object)
// then set the slam permissions flag so that they are applied on rez.
if((perm.getMaskNextOwner()!=item->getPermissions().getMaskNextOwner())
&& (item->getType() == LLAssetType::AT_OBJECT))
{
flags |= LLInventoryItem::II_FLAGS_OBJECT_SLAM_PERM;
}
// If everyone permissions have changed (and this is an object)
// then set the overwrite everyone permissions flag so they
// are applied on rez.
if ((perm.getMaskEveryone()!=item->getPermissions().getMaskEveryone())
&& (item->getType() == LLAssetType::AT_OBJECT))
{
flags |= LLInventoryItem::II_FLAGS_OBJECT_PERM_OVERWRITE_EVERYONE;
}
// If group permissions have changed (and this is an object)
// then set the overwrite group permissions flag so they
// are applied on rez.
if ((perm.getMaskGroup()!=item->getPermissions().getMaskGroup())
&& (item->getType() == LLAssetType::AT_OBJECT))
{
flags |= LLInventoryItem::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP;
}
new_item->setFlags(flags);
if(self->mObjectID.isNull())
{
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
else
{
LLViewerObject* object = gObjectList.findObject(self->mObjectID);
if(object)
{
object->updateInventory(
new_item,
TASK_INVENTORY_ITEM_KEY,
false);
}
}
}
else
{
// need to make sure we don't just follow the click
self->refresh();
}
}
示例12: refreshFromItem
void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
{
// <edit>
childSetText("EditItemID", item->getUUID().asString());
childSetText("EditFolderID", item->getParentUUID().asString());
childSetText("EditGroup", item->getPermissions().getGroup().asString());
childSetText("EditAssetID", item->getAssetUUID().asString());
std::string type_str = LLAssetType::lookup(item->getType());
if(type_str.c_str() == NULL) type_str = llformat("%d", item->getType());
childSetText("EditType", type_str);
std::string invtype_str = LLInventoryType::lookup(item->getInventoryType());
if(invtype_str.c_str() == NULL) invtype_str = llformat("%d", item->getInventoryType());
childSetText("EditInvType", invtype_str);
childSetText("EditFlags", llformat("%d", item->getFlags()));
std::ostringstream strm;
item->exportLegacyStream(strm, TRUE);
std::string str(strm.str());
LLStringUtil::replaceTabsWithSpaces(str, 4);
childSetText("item_text", str);
// </edit>
////////////////////////
// PERMISSIONS LOOKUP //
////////////////////////
// do not enable the UI for incomplete items.
LLViewerInventoryItem* i = (LLViewerInventoryItem*)item;
BOOL is_complete = i->isComplete();
const LLPermissions& perm = item->getPermissions();
BOOL can_agent_manipulate = gAgent.allowOperation(PERM_OWNER, perm,
GP_OBJECT_MANIPULATE);
BOOL can_agent_sell = gAgent.allowOperation(PERM_OWNER, perm,
GP_OBJECT_SET_SALE);
// You need permission to modify the object to modify an inventory
// item in it.
LLViewerObject* object = NULL;
if(!mObjectID.isNull()) object = gObjectList.findObject(mObjectID);
BOOL is_obj_modify = TRUE;
if(object)
{
is_obj_modify = object->permOwnerModify();
}
//////////////////////
// ITEM NAME & DESC //
//////////////////////
BOOL is_modifiable = gAgent.allowOperation(PERM_MODIFY, perm,
GP_OBJECT_MANIPULATE)
&& is_obj_modify && is_complete;
childSetEnabled("LabelItemNameTitle",TRUE);
childSetEnabled("LabelItemName",is_modifiable);
childSetText("LabelItemName",item->getName());
childSetEnabled("LabelItemDescTitle",TRUE);
childSetEnabled("LabelItemDesc",is_modifiable);
childSetVisible("IconLocked",!is_modifiable);
childSetText("LabelItemDesc",item->getDescription());
//////////////////
// CREATOR NAME //
//////////////////
if(!gCacheName) return;
if(!gAgent.getRegion()) return;
if (item->getCreatorUUID().notNull())
{
std::string name;
gCacheName->getFullName(item->getCreatorUUID(), name);
childSetEnabled("BtnCreator",TRUE);
childSetEnabled("LabelCreatorTitle",TRUE);
childSetEnabled("LabelCreatorName",TRUE);
childSetText("LabelCreatorName",name);
}
else
{
childSetEnabled("BtnCreator",FALSE);
childSetEnabled("LabelCreatorTitle",FALSE);
childSetEnabled("LabelCreatorName",FALSE);
childSetText("LabelCreatorName",getString("unknown"));
}
////////////////
// OWNER NAME //
////////////////
if(perm.isOwned())
{
std::string name;
if (perm.isGroupOwned())
{
gCacheName->getGroupName(perm.getGroup(), name);
}
else
{
gCacheName->getFullName(perm.getOwner(), name);
}
//.........这里部分代码省略.........
示例13: fetch
void LLInventoryFetchComboObserver::fetch(
const folder_ref_t& folder_ids,
const item_ref_t& item_ids)
{
lldebugs << "LLInventoryFetchComboObserver::fetch()" << llendl;
for(folder_ref_t::const_iterator fit = folder_ids.begin(); fit != folder_ids.end(); ++fit)
{
LLViewerInventoryCategory* cat = gInventory.getCategory(*fit);
if(!cat) continue;
if(!gInventory.isCategoryComplete(*fit))
{
cat->fetchDescendents();
lldebugs << "fetching folder " << *fit <<llendl;
mIncompleteFolders.push_back(*fit);
}
else
{
mCompleteFolders.push_back(*fit);
lldebugs << "completing folder " << *fit <<llendl;
}
}
// Now for the items - we fetch everything which is not a direct
// descendent of an incomplete folder because the item will show
// up in an inventory descendents message soon enough so we do not
// have to fetch it individually.
LLSD items_llsd;
LLUUID owner_id;
for(item_ref_t::const_iterator iit = item_ids.begin(); iit != item_ids.end(); ++iit)
{
LLViewerInventoryItem* item = gInventory.getItem(*iit);
if(!item)
{
lldebugs << "uanble to find item " << *iit << llendl;
continue;
}
if(item->isComplete())
{
// It's complete, so put it on the complete container.
mCompleteItems.push_back(*iit);
lldebugs << "completing item " << *iit << llendl;
continue;
}
else
{
mIncompleteItems.push_back(*iit);
owner_id = item->getPermissions().getOwner();
}
if(std::find(mIncompleteFolders.begin(), mIncompleteFolders.end(), item->getParentUUID()) == mIncompleteFolders.end())
{
LLSD item_entry;
item_entry["owner_id"] = owner_id;
item_entry["item_id"] = (*iit);
items_llsd.append(item_entry);
}
else
{
lldebugs << "not worrying about " << *iit << llendl;
}
}
fetch_items_from_llsd(items_llsd);
}