summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2010-01-28 12:27:17 +0000
committerLynx Linden <lynx@lindenlab.com>2010-01-28 12:27:17 +0000
commitb3e25e1fbd9cfccc0363cb436ad4302ead974859 (patch)
tree217c46f8e5e838144241bb0a0f202750393d11e6
parent8d4c36dd8251a98551137f912ec9dcc905549ab5 (diff)
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.
-rw-r--r--indra/newview/llinspectremoteobject.cpp25
1 files changed, 19 insertions, 6 deletions
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<LLUICtrl>("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<LLUICtrl>("object_slurl")->setValue(url);
+
+ // disable the Map button if we don't have a SLurl
+ getChild<LLUICtrl>("map_btn")->setEnabled(! mSLurl.empty());
+
+ // disable the Block button if we don't have the owner ID
+ getChild<LLUICtrl>("block_btn")->setEnabled(! mOwnerID.isNull());
}
//////////////////////////////////////////////////////////////////////////////