summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterscriptlimits.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-03-29 16:55:22 -0700
committerJames Cook <james@lindenlab.com>2010-03-29 16:55:22 -0700
commitecc2c726502448076295254714c0bfa8c0074f25 (patch)
tree6a9434c540f7b5ea7bca326df1a420e4a0a99cc4 /indra/newview/llfloaterscriptlimits.cpp
parentd2f9e34598621f1dabad15025417efd6b81dddf0 (diff)
parentac103403160e87bb6b40ac3e032d077a3381da8e (diff)
Merge latest viewer-hotfix, approximately equal to Viewer 2.0 final
Diffstat (limited to 'indra/newview/llfloaterscriptlimits.cpp')
-rw-r--r--indra/newview/llfloaterscriptlimits.cpp106
1 files changed, 78 insertions, 28 deletions
diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp
index d56bc7b75b..d8d6f2535a 100644
--- a/indra/newview/llfloaterscriptlimits.cpp
+++ b/indra/newview/llfloaterscriptlimits.cpp
@@ -110,7 +110,7 @@ BOOL LLFloaterScriptLimits::postBuild()
if(!mTab)
{
- llinfos << "Error! couldn't get scriptlimits_panels, aborting Script Information setup" << llendl;
+ llwarns << "Error! couldn't get scriptlimits_panels, aborting Script Information setup" << llendl;
return FALSE;
}
@@ -214,7 +214,7 @@ void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
if(!instance)
{
- llinfos << "Failed to get llfloaterscriptlimits instance" << llendl;
+ llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
}
}
@@ -227,7 +227,7 @@ void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
void fetchScriptLimitsRegionInfoResponder::error(U32 status, const std::string& reason)
{
- llinfos << "Error from responder " << reason << llendl;
+ llwarns << "Error from responder " << reason << llendl;
}
void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
@@ -281,26 +281,40 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
OSMessageBox(nice_llsd.str(), "summary response:", 0);
- llinfos << "summary response:" << *content << llendl;
+ llwarns << "summary response:" << *content << llendl;
#endif
LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
if(!instance)
{
- llinfos << "Failed to get llfloaterscriptlimits instance" << llendl;
+ llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
}
else
{
LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ if(tab)
+ {
LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ if(panel_memory)
+ {
+ panel_memory->childSetValue("loading_text", LLSD(std::string("")));
+
+ LLButton* btn = panel_memory->getChild<LLButton>("refresh_list_btn");
+ if(btn)
+ {
+ btn->setEnabled(true);
+ }
+
panel_memory->setRegionSummary(content);
}
}
+ }
+}
void fetchScriptLimitsRegionSummaryResponder::error(U32 status, const std::string& reason)
{
- llinfos << "Error from responder " << reason << llendl;
+ llwarns << "Error from responder " << reason << llendl;
}
void fetchScriptLimitsRegionDetailsResponder::result(const LLSD& content_ref)
@@ -383,7 +397,7 @@ result (map)
if(!instance)
{
- llinfos << "Failed to get llfloaterscriptlimits instance" << llendl;
+ llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
}
else
{
@@ -397,19 +411,19 @@ result (map)
}
else
{
- llinfos << "Failed to get scriptlimits memory panel" << llendl;
+ llwarns << "Failed to get scriptlimits memory panel" << llendl;
}
}
else
{
- llinfos << "Failed to get scriptlimits_panels" << llendl;
+ llwarns << "Failed to get scriptlimits_panels" << llendl;
}
}
}
void fetchScriptLimitsRegionDetailsResponder::error(U32 status, const std::string& reason)
{
- llinfos << "Error from responder " << reason << llendl;
+ llwarns << "Error from responder " << reason << llendl;
}
void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
@@ -471,7 +485,7 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
if(!instance)
{
- llinfos << "Failed to get llfloaterscriptlimits instance" << llendl;
+ llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
}
else
{
@@ -481,29 +495,46 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
LLPanelScriptLimitsAttachment* panel = (LLPanelScriptLimitsAttachment*)tab->getChild<LLPanel>("script_limits_my_avatar_panel");
if(panel)
{
+ panel->childSetValue("loading_text", LLSD(std::string("")));
+
+ LLButton* btn = panel->getChild<LLButton>("refresh_list_btn");
+ if(btn)
+ {
+ btn->setEnabled(true);
+ }
+
panel->setAttachmentDetails(content);
}
else
{
- llinfos << "Failed to get script_limits_my_avatar_panel" << llendl;
+ llwarns << "Failed to get script_limits_my_avatar_panel" << llendl;
}
}
else
{
- llinfos << "Failed to get scriptlimits_panels" << llendl;
+ llwarns << "Failed to get scriptlimits_panels" << llendl;
}
}
}
void fetchScriptLimitsAttachmentInfoResponder::error(U32 status, const std::string& reason)
{
- llinfos << "Error from responder " << reason << llendl;
+ llwarns << "Error from responder " << reason << llendl;
}
///----------------------------------------------------------------------------
// Memory Panel
///----------------------------------------------------------------------------
+LLPanelScriptLimitsRegionMemory::~LLPanelScriptLimitsRegionMemory()
+{
+ if(!mParcelId.isNull())
+ {
+ LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this);
+ mParcelId.setNull();
+ }
+};
+
BOOL LLPanelScriptLimitsRegionMemory::getLandScriptResources()
{
LLSD body;
@@ -544,6 +575,11 @@ void LLPanelScriptLimitsRegionMemory::setParcelID(const LLUUID& parcel_id)
{
if (!parcel_id.isNull())
{
+ if(!mParcelId.isNull())
+ {
+ LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this);
+ mParcelId.setNull();
+ }
LLRemoteParcelInfoProcessor::getInstance()->addObserver(parcel_id, this);
LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(parcel_id);
}
@@ -594,7 +630,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
if(!list)
{
- llinfos << "Error getting the scripts_list control" << llendl;
+ llwarns << "Error getting the scripts_list control" << llendl;
return;
}
@@ -679,7 +715,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
{
names_requested.push_back(owner_id);
gCacheName->get(owner_id, is_group_owned,
- boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache,
+ boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache,
this, _1, _2));
}
}
@@ -742,8 +778,6 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
// save the structure to make object return easier
mContent = content;
-
- childSetValue("loading_text", LLSD(std::string("")));
}
void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content)
@@ -762,7 +796,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content)
}
else
{
- llinfos << "summary doesn't contain memory info" << llendl;
+ llwarns << "summary doesn't contain memory info" << llendl;
return;
}
@@ -780,7 +814,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content)
}
else
{
- llinfos << "summary doesn't contain urls info" << llendl;
+ llwarns << "summary doesn't contain urls info" << llendl;
return;
}
@@ -927,8 +961,6 @@ void LLPanelScriptLimitsRegionMemory::clearList()
// static
void LLPanelScriptLimitsRegionMemory::onClickRefresh(void* userdata)
{
- llinfos << "LLPanelRegionGeneralInfo::onClickRefresh" << llendl;
-
LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
if(instance)
{
@@ -938,6 +970,13 @@ void LLPanelScriptLimitsRegionMemory::onClickRefresh(void* userdata)
LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
if(panel_memory)
{
+ //To stop people from hammering the refesh button and accidentally dosing themselves - enough requests can crash the viewer!
+ //turn the button off, then turn it on when we get a response
+ LLButton* btn = panel_memory->getChild<LLButton>("refresh_list_btn");
+ if(btn)
+ {
+ btn->setEnabled(false);
+ }
panel_memory->clearList();
panel_memory->StartRequestChain();
@@ -977,7 +1016,6 @@ void LLPanelScriptLimitsRegionMemory::showBeacon()
// static
void LLPanelScriptLimitsRegionMemory::onClickHighlight(void* userdata)
{
- llinfos << "LLPanelRegionGeneralInfo::onClickHighlight" << llendl;
LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
if(instance)
{
@@ -1083,7 +1121,6 @@ void LLPanelScriptLimitsRegionMemory::returnObjects()
// static
void LLPanelScriptLimitsRegionMemory::onClickReturn(void* userdata)
{
- llinfos << "LLPanelRegionGeneralInfo::onClickReturn" << llendl;
LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
if(instance)
{
@@ -1186,6 +1223,12 @@ void LLPanelScriptLimitsAttachment::setAttachmentDetails(LLSD content)
setAttachmentSummary(content);
childSetValue("loading_text", LLSD(std::string("")));
+
+ LLButton* btn = getChild<LLButton>("refresh_list_btn");
+ if(btn)
+ {
+ btn->setEnabled(true);
+ }
}
BOOL LLPanelScriptLimitsAttachment::postBuild()
@@ -1226,7 +1269,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content)
}
else
{
- llinfos << "attachment details don't contain memory summary info" << llendl;
+ llwarns << "attachment details don't contain memory summary info" << llendl;
return;
}
@@ -1244,7 +1287,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content)
}
else
{
- llinfos << "attachment details don't contain urls summary info" << llendl;
+ llwarns << "attachment details don't contain urls summary info" << llendl;
return;
}
@@ -1276,15 +1319,22 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content)
// static
void LLPanelScriptLimitsAttachment::onClickRefresh(void* userdata)
{
- llinfos << "Refresh clicked" << llendl;
-
LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
if(instance)
{
LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
LLPanelScriptLimitsAttachment* panel_attachments = (LLPanelScriptLimitsAttachment*)tab->getChild<LLPanel>("script_limits_my_avatar_panel");
+ LLButton* btn = panel_attachments->getChild<LLButton>("refresh_list_btn");
+
+ //To stop people from hammering the refesh button and accidentally dosing themselves - enough requests can crash the viewer!
+ //turn the button off, then turn it on when we get a response
+ if(btn)
+ {
+ btn->setEnabled(false);
+ }
panel_attachments->clearList();
panel_attachments->requestAttachmentDetails();
+
return;
}
else