diff options
Diffstat (limited to 'indra/newview/llfloatertopobjects.cpp')
-rw-r--r--[-rwxr-xr-x] | indra/newview/llfloatertopobjects.cpp | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index d604b8619a..e20360066e 100755..100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -118,25 +118,32 @@ void LLFloaterTopObjects::setMode(U32 mode) // static void LLFloaterTopObjects::handle_land_reply(LLMessageSystem* msg, void** data) { - LLFloaterTopObjects* instance = LLFloaterReg::getTypedInstance<LLFloaterTopObjects>("top_objects"); - if(!instance) return; - // Make sure dialog is on screen - LLFloaterReg::showInstance("top_objects"); - instance->handleReply(msg, data); - - //HACK: for some reason sometimes top scripts originally comes back - //with no results even though they're there - if (!instance->mObjectListIDs.size() && !instance->mInitialized) + LLFloaterTopObjects* instance = LLFloaterReg::getTypedInstance<LLFloaterTopObjects>("top_objects"); + if(instance && instance->isInVisibleChain()) + { + instance->handleReply(msg, data); + //HACK: for some reason sometimes top scripts originally comes back + //with no results even though they're there + if (!instance->mObjectListIDs.size() && !instance->mInitialized) + { + instance->onRefresh(); + instance->mInitialized = TRUE; + } + } + else { - instance->onRefresh(); - instance->mInitialized = TRUE; + LLFloaterRegionInfo* region_info_floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info"); + if(region_info_floater) + { + region_info_floater->enableTopButtons(); + } } } void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) { - U32 request_flags; + U32 request_flags; U32 total_count; msg->getU32Fast(_PREHASH_RequestData, _PREHASH_RequestFlags, request_flags); @@ -176,10 +183,15 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) msg->getU32("DataExtended", "TimeStamp", time_stamp, block); msg->getF32("DataExtended", "MonoScore", mono_score, block); msg->getS32("DataExtended", "PublicURLs", public_urls, block); - if (msg->getSize("DataExtended", "ParcelName") > 0) + + std::string parcel_name; + F32 script_size = 0.f; + msg->getString("DataExtended", "ParcelName", parcel_name, block); + msg->getF32("DataExtended", "Size", script_size, block); + if (parcel_name.size() > 0 || script_size > 0) { - msg->getString("DataExtended", "ParcelName", parcel_buf, block); - msg->getF32("DataExtended", "Size", script_memory, block); + parcel_buf = parcel_name; + script_memory = script_size; } } |