// 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; } } }
// 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()); } }
// 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 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); } } } }
// 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(); } }