// static void LLFloaterProperties::onCommitSaleType(LLUICtrl* ctrl, void* data) { //llinfos << "LLFloaterProperties::onCommitSaleType()" << llendl; LLFloaterProperties* self = (LLFloaterProperties*)data; if(!self) return; self->updateSaleInfo(); }
// static void LLFloaterProperties::onClickCopy(void* user_data) { LLFloaterProperties* floaterp = (LLFloaterProperties*)user_data; if(floaterp) { LLViewerInventoryItem* item = (LLViewerInventoryItem*)floaterp->findItem(); if(item) { std::string str(floaterp->childGetValue("item_text").asString()); std::string::size_type pos; while((pos = str.find(" ")) != std::string::npos) { str.replace(pos, 4, "\t"); } std::istringstream strm(str); LLViewerInventoryItem* temp = new LLViewerInventoryItem(); temp->importLegacyStream(strm); std::ostringstream strm2; temp->exportLegacyStream(strm2, TRUE); LLWString wstr(utf8str_to_wstring(strm2.str())); gClipboard.copyFromSubstring(wstr, 0, wstr.length()); //delete temp; } } }
void LLFloaterProperties::closeByID(const LLUUID& item_id, const LLUUID &object_id) { LLFloaterProperties* floaterp = find(item_id, object_id); if (floaterp) { floaterp->close(); } }
// static void LLFloaterProperties::onClickCreator(void* data) { LLFloaterProperties* self = (LLFloaterProperties*)data; if(!self) return; LLInventoryItem* item = self->findItem(); if(!item) return; if(!item->getCreatorUUID().isNull()) { LLFloaterAvatarInfo::showFromObject(item->getCreatorUUID()); } }
void LLFloaterProperties::onClickLess(void* user_data) { LLFloaterProperties* floaterp = (LLFloaterProperties*)user_data; if(floaterp) { LLMultiProperties* host = (LLMultiProperties*)floaterp->getHost(); if(host) host->setExpanded(FALSE); else floaterp->setExpanded(FALSE); } }
//static void LLFloaterProperties::dirtyAll() { LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("properties"); for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) { LLFloaterProperties* floater = dynamic_cast<LLFloaterProperties*>(*iter); llassert(floater); // else cast failed - wrong type D: if (floater) { floater->dirty(); } } }
void LLPropertiesObserver::changed(U32 mask) { // if there's a change we're interested in. if((mask & (LLInventoryObserver::LABEL | LLInventoryObserver::INTERNAL | LLInventoryObserver::REMOVE)) != 0) { mFloater->dirty(); } }
// static void LLFloaterProperties::onClickOwner(void* data) { LLFloaterProperties* self = (LLFloaterProperties*)data; if(!self) return; LLInventoryItem* item = self->findItem(); if(!item) return; if(item->getPermissions().isGroupOwned()) { LLFloaterGroupInfo::showFromUUID(item->getPermissions().getGroup()); } else { if(!item->getPermissions().getOwner().isNull()) { LLFloaterAvatarInfo::showFromObject(item->getPermissions().getOwner()); } } }
// static LLFloaterProperties* LLFloaterProperties::show(const LLUUID& item_id, const LLUUID& object_id) { LLFloaterProperties* instance = find(item_id, object_id); if(instance) { if (LLFloater::getFloaterHost() && LLFloater::getFloaterHost() != instance->getHost()) { // this properties window is being opened in a new context // needs to be rehosted LLFloater::getFloaterHost()->addFloater(instance, TRUE); } instance->refresh(); instance->open(); /* Flawfinder: ignore */ } return instance; }
// static void LLFloaterProperties::onClickUpdate(void* user_data) { LLFloaterProperties* floaterp = (LLFloaterProperties*)user_data; if(floaterp) { LLViewerInventoryItem* item = (LLViewerInventoryItem*)floaterp->findItem(); if(item) { std::string str(floaterp->childGetValue("item_text").asString()); std::string::size_type pos; while((pos = str.find(" ")) != std::string::npos) { str.replace(pos, 4, "\t"); } std::istringstream strm(str); item->importLegacyStream(strm); if(floaterp->mObjectID.isNull()) { // This is in the agent's inventory. item->updateServer(FALSE); gInventory.updateItem(item); gInventory.notifyObservers(); item->setComplete(FALSE); item->fetchFromServer(); } else { // This is in an object's contents. LLViewerObject* object = gObjectList.findObject(floaterp->mObjectID); if(object) { object->updateInventory( item, TASK_INVENTORY_ITEM_KEY, false); object->fetchInventoryFromServer(); } } } } }
// static void LLFloaterProperties::onClickOwner(void* data) { LLFloaterProperties* self = (LLFloaterProperties*)data; if(!self) return; LLInventoryItem* item = self->findItem(); if(!item) return; if(item->getPermissions().isGroupOwned()) { LLFloaterGroupInfo::showFromUUID(item->getPermissions().getGroup()); } else { // if(!item->getPermissions().getOwner().isNull()) // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) if ( (!item->getPermissions().getOwner().isNull()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) // [/RLVa:KB] { LLFloaterAvatarInfo::showFromObject(item->getPermissions().getOwner()); } } }
// static void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data) { //llinfos << "LLFloaterProperties::onCommitName()" << llendl; LLFloaterProperties* self = (LLFloaterProperties*)data; if(!self) { return; } LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem(); if(!item) { return; } LLLineEditor* labelItemName = self->getChild<LLLineEditor>("LabelItemName"); if(labelItemName&& (item->getName() != labelItemName->getText()) && (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE)) ) { LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); new_item->rename(labelItemName->getText()); 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); } } } }
void LLMultiProperties::setExpanded(BOOL expanded) { mExpanded = expanded; LLRect rect = getRect(); LLRect tab_rect = mTabContainer->getRect(); if(expanded) { rect.setOriginAndSize(rect.mLeft, rect.mBottom, 800, rect.getHeight()); tab_rect.setOriginAndSize(tab_rect.mLeft, tab_rect.mBottom, 800, tab_rect.getHeight()); } else { rect.setOriginAndSize(rect.mLeft, rect.mBottom, 350, rect.getHeight()); tab_rect.setOriginAndSize(tab_rect.mLeft, tab_rect.mBottom, 350, tab_rect.getHeight()); } setRect(rect); mTabContainer->setRect(tab_rect); for (S32 i = 0; i < mTabContainer->getTabCount(); i++) { LLFloaterProperties* floaterp = (LLFloaterProperties*)mTabContainer->getPanelByIndex(i); floaterp->setExpanded(expanded); } }
// 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(); } }