From b3e25e1fbd9cfccc0363cb436ad4302ead974859 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 28 Jan 2010 12:27:17 +0000 Subject: EXT-4693: More robust remote object inspector. Disable buttons when we don't have enough information to perform their function, and don't display a SLurl if we don't know the object's location. --- indra/newview/llinspectremoteobject.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinspectremoteobject.cpp') diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp index e4d2eec242..898f1cd9ac 100644 --- a/indra/newview/llinspectremoteobject.cpp +++ b/indra/newview/llinspectremoteobject.cpp @@ -31,17 +31,16 @@ #include "llviewerprecompiledheaders.h" +#include "llfloaterreg.h" #include "llinspectremoteobject.h" #include "llinspect.h" -#include "llslurl.h" #include "llmutelist.h" -#include "llurlaction.h" #include "llpanelblockedlist.h" -#include "llfloaterreg.h" +#include "llslurl.h" +#include "lltrans.h" #include "llui.h" #include "lluictrl.h" - -class LLViewerObject; +#include "llurlaction.h" ////////////////////////////////////////////////////////////////////////////// // LLInspectRemoteObject @@ -183,11 +182,25 @@ void LLInspectRemoteObject::update() owner = LLSLURL::buildCommand("agent", mOwnerID, "about"); } } + else + { + owner = LLTrans::getString("Unknown"); + } getChild("object_owner")->setValue(owner); // display the object's SLurl - click it to teleport - std::string url = "secondlife:///app/teleport/" + mSLurl; + std::string url; + if (! mSLurl.empty()) + { + std::string url = "secondlife:///app/teleport/" + mSLurl; + } getChild("object_slurl")->setValue(url); + + // disable the Map button if we don't have a SLurl + getChild("map_btn")->setEnabled(! mSLurl.empty()); + + // disable the Block button if we don't have the owner ID + getChild("block_btn")->setEnabled(! mOwnerID.isNull()); } ////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From e563a07659b74b2dca850834a44c3b92ff993b44 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 2 Feb 2010 17:19:14 +0000 Subject: DEV-32540: Lots of object IM and SLurl improvements - Don't let object names that are URLs override links to display the remote object inspector - Don't hyperlink the object name in the remote object inspector - Made the ... regex more robust and made it support non-URLs between the tags, so that we don't get random tags when trying to disable URLs in user-typed text. - Improved the llurlentry unit test and added some more test cases. - Hooked up another LLViewerMessage code path to objectim SLapps to pass down the owner and slurl information. - Made a few LLUrlEntryBase methods be const methods, because they are - Fixed a bug in the remote object inspector where it would never show the teleport URL. --- indra/newview/llinspectremoteobject.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinspectremoteobject.cpp') diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp index 898f1cd9ac..66e4a1bf66 100644 --- a/indra/newview/llinspectremoteobject.cpp +++ b/indra/newview/llinspectremoteobject.cpp @@ -167,7 +167,8 @@ void LLInspectRemoteObject::nameCallback(const LLUUID& id, const std::string& fi void LLInspectRemoteObject::update() { // show the object name as the inspector's title - getChild("object_name")->setValue(mName); + // (don't hyperlink URLs in object names) + getChild("object_name")->setValue("" + mName + ""); // show the object's owner - click it to show profile std::string owner = mOwner; @@ -192,7 +193,7 @@ void LLInspectRemoteObject::update() std::string url; if (! mSLurl.empty()) { - std::string url = "secondlife:///app/teleport/" + mSLurl; + url = "secondlife:///app/teleport/" + mSLurl; } getChild("object_slurl")->setValue(url); -- cgit v1.2.3