From 1ea2fe7f803496fcb4d03d1cda3e14021a6bda59 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Mon, 11 Apr 2011 21:59:58 -0700 Subject: Ported changes to the inspect window from Ascent by Hazim: added last owner, faces, verticies, script and inventory count --- linden/indra/newview/llfloaterinspect.cpp | 89 +++++++++++++++++++--- linden/indra/newview/llfloaterinspect.h | 9 ++- .../skins/default/xui/en-us/floater_inspect.xml | 7 +- 3 files changed, 93 insertions(+), 12 deletions(-) diff --git a/linden/indra/newview/llfloaterinspect.cpp b/linden/indra/newview/llfloaterinspect.cpp index 51c7835..6701fdb 100644 --- a/linden/indra/newview/llfloaterinspect.cpp +++ b/linden/indra/newview/llfloaterinspect.cpp @@ -226,7 +226,7 @@ void LLFloaterInspect::refresh() LLSelectNode* obj = *iter; LLSD row; char time[MAX_STRING]; - std::string owner_name, creator_name; + std::string owner_name, creator_name, last_owner_name; if (obj->mCreationDate == 0) { // Don't have valid information from the server, so skip this one @@ -245,6 +245,7 @@ void LLFloaterInspect::refresh() } // [/RLVa:KB] gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name); + gCacheName->getFullName(obj->mPermissions->getLastOwner(), last_owner_name); row["id"] = obj->getObject()->getID(); row["columns"][0]["column"] = "object_name"; row["columns"][0]["type"] = "text"; @@ -258,15 +259,57 @@ void LLFloaterInspect::refresh() { row["columns"][0]["value"] = obj->mName; } - row["columns"][1]["column"] = "owner_name"; - row["columns"][1]["type"] = "text"; - row["columns"][1]["value"] = owner_name; - row["columns"][2]["column"] = "creator_name"; - row["columns"][2]["type"] = "text"; - row["columns"][2]["value"] = creator_name; - row["columns"][3]["column"] = "creation_date"; - row["columns"][3]["type"] = "text"; - row["columns"][3]["value"] = time; + int i = 1; + row["columns"][i]["column"] = "owner_name"; + row["columns"][i]["type"] = "text"; + row["columns"][i]["value"] = owner_name; + ++i; + row["columns"][i]["column"] = "last_owner_name"; + row["columns"][i]["type"] = "text"; + row["columns"][i]["value"] = last_owner_name; + ++i; + row["columns"][i]["column"] = "creator_name"; + row["columns"][i]["type"] = "text"; + row["columns"][i]["value"] = creator_name; + ++i; + row["columns"][i]["column"] = "face_num"; + row["columns"][i]["type"] = "text"; + row["columns"][i]["value"] = llformat("%d", obj->getObject()->getNumFaces()); + ++i; + row["columns"][i]["column"] = "vertex_num"; + row["columns"][i]["type"] = "text"; + row["columns"][i]["value"] = llformat("%d", obj->getObject()->getNumVertices()); + ++i; + // inventory silliness + S32 scripts,total_inv; + std::map >::iterator itr = mInventoryNums.find(obj->getObject()->getID()); + if (itr != mInventoryNums.end()) + { + scripts = itr->second.first; + total_inv = itr->second.second; + } + else + { + scripts = 0; + total_inv = 0; + if (std::find(mQueue.begin(), mQueue.end(), obj->getObject()->getID()) == mQueue.end()) + { + mQueue.push_back(obj->getObject()->getID()); + registerVOInventoryListener(obj->getObject(), NULL); + requestVOInventory(); + } + } + row["columns"][i]["column"] = "script_num"; + row["columns"][i]["type"] = "text"; + row["columns"][i]["value"] = llformat("%d", scripts); + ++i; + row["columns"][i]["column"] = "inv_num"; + row["columns"][i]["type"] = "text"; + row["columns"][i]["value"] = llformat("%d", total_inv); + ++i; + row["columns"][i]["column"] = "creation_date"; + row["columns"][i]["type"] = "text"; + row["columns"][i]["value"] = time; mObjectList->addElement(row, ADD_TOP); } if(selected_index > -1 && mObjectList->getItemIndex(selected_uuid) == selected_index) @@ -281,6 +324,30 @@ void LLFloaterInspect::refresh() mObjectList->setScrollPos(pos); } +void LLFloaterInspect::inventoryChanged(LLViewerObject* viewer_object, + InventoryObjectList* inv, + S32, + void* q_id) +{ + S32 scripts = 0; + std::vector::iterator iter = std::find(mQueue.begin(), mQueue.end(), viewer_object->getID()); + if (viewer_object && inv && iter != mQueue.end() ) + { + InventoryObjectList::const_iterator it = inv->begin(); + InventoryObjectList::const_iterator end = inv->end(); + for ( ; it != end; ++it) + { + if ((*it)->getType() == LLAssetType::AT_LSL_TEXT) + { + scripts++; + } + } + mInventoryNums[viewer_object->getID()] = std::make_pair(scripts, inv->size()); + mQueue.erase(iter); + mDirty = TRUE; + } +} + void LLFloaterInspect::onFocusReceived() { LLToolMgr::getInstance()->setTransientTool(LLToolCompInspect::getInstance()); @@ -291,6 +358,8 @@ void LLFloaterInspect::dirty() { if(sInstance) { + sInstance->mInventoryNums.clear(); + sInstance->mQueue.clear(); sInstance->setDirty(); } } diff --git a/linden/indra/newview/llfloaterinspect.h b/linden/indra/newview/llfloaterinspect.h index 57bba68..5d05f48 100644 --- a/linden/indra/newview/llfloaterinspect.h +++ b/linden/indra/newview/llfloaterinspect.h @@ -36,13 +36,14 @@ #define LL_LLFLOATERINSPECT_H #include "llfloater.h" +#include "llvoinventorylistener.h" //class LLTool; class LLObjectSelection; class LLScrollListCtrl; class LLUICtrl; -class LLFloaterInspect : public LLFloater +class LLFloaterInspect : public LLFloater, public LLVOInventoryListener { public: virtual ~LLFloaterInspect(void); @@ -63,12 +64,18 @@ protected: LLFloaterInspect(); void setDirty() { mDirty = TRUE; } bool mDirty; + /*virtual*/ void inventoryChanged(LLViewerObject* obj, + InventoryObjectList* inv, + S32 serial_num, + void* queue); private: // static data static LLFloaterInspect* sInstance; LLSafeHandle mObjectSelection; + std::map > mInventoryNums; // + std::vector mQueue; }; #endif //LL_LLFLOATERINSPECT_H diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_inspect.xml b/linden/indra/newview/skins/default/xui/en-us/floater_inspect.xml index fbb1133..b28174b 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_inspect.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_inspect.xml @@ -1,6 +1,6 @@ + + + + +