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