summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterinspect.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-06-21 08:04:56 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-06-21 08:04:56 +0000
commit9ec432034dc3c45d7ce763eb02dae4cc7f6b8da8 (patch)
tree4a505c1e0919af52800b3ffb3eaf135e7d6f9ce6 /indra/newview/llfloaterinspect.cpp
parent351ebe9fcb76f3b99c2957004bb8493a904869ee (diff)
merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3
ignore-dead-branch
Diffstat (limited to 'indra/newview/llfloaterinspect.cpp')
-rw-r--r--indra/newview/llfloaterinspect.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp
index de8a094fa9..4b29a304ac 100644
--- a/indra/newview/llfloaterinspect.cpp
+++ b/indra/newview/llfloaterinspect.cpp
@@ -31,11 +31,15 @@
*/
#include "llviewerprecompiledheaders.h"
-#include "llfloateravatarinfo.h"
+
#include "llfloaterinspect.h"
+
+#include "llfloaterreg.h"
#include "llfloatertools.h"
+#include "llfriendactions.h"
#include "llcachename.h"
#include "llscrolllistctrl.h"
+#include "llscrolllistitem.h"
#include "llselectmgr.h"
#include "lltoolcomp.h"
#include "lltoolmgr.h"
@@ -45,17 +49,16 @@
LLFloaterInspect* LLFloaterInspect::sInstance = NULL;
-LLFloaterInspect::LLFloaterInspect(void) :
- LLFloater(std::string("Inspect Object")),
+LLFloaterInspect::LLFloaterInspect(void)
+ : LLFloater(),
mDirty(FALSE)
{
- sInstance = this;
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inspect.xml");
}
LLFloaterInspect::~LLFloaterInspect(void)
{
- if(!gFloaterTools->getVisible())
+ if(!LLFloaterReg::instanceVisible("build"))
{
if(LLToolMgr::getInstance()->getBaseTool() == LLToolCompInspect::getInstance())
{
@@ -66,7 +69,7 @@ LLFloaterInspect::~LLFloaterInspect(void)
}
else
{
- gFloaterTools->setFocus(TRUE);
+ LLFloaterReg::showInstance("build", LLSD(), TRUE);
}
sInstance = NULL;
}
@@ -88,7 +91,7 @@ void LLFloaterInspect::show(void* ignored)
sInstance = new LLFloaterInspect;
}
- sInstance->open();
+ sInstance->openFloater();
LLToolMgr::getInstance()->setTransientTool(LLToolCompInspect::getInstance());
LLSelectMgr::getInstance()->setForceSelection(forcesel); // restore previouis value
@@ -119,7 +122,7 @@ void LLFloaterInspect::onClickCreatorProfile(void* ctrl)
LLSelectNode* node = sInstance->mObjectSelection->getFirstNode(&func);
if(node)
{
- LLFloaterAvatarInfo::showFromDirectory(node->mPermissions->getCreator());
+ LLFriendActions::showProfile(node->mPermissions->getCreator());
}
}
}
@@ -146,7 +149,7 @@ void LLFloaterInspect::onClickOwnerProfile(void* ctrl)
if(node)
{
const LLUUID& owner_id = node->mPermissions->getOwner();
- LLFloaterAvatarInfo::showFromDirectory(owner_id);
+ LLFriendActions::showProfile(owner_id);
}
}
}
@@ -156,7 +159,7 @@ BOOL LLFloaterInspect::postBuild()
mObjectList = getChild<LLScrollListCtrl>("object_list");
childSetAction("button owner",onClickOwnerProfile, this);
childSetAction("button creator",onClickCreatorProfile, this);
- childSetCommitCallback("object_list", onSelectObject);
+ childSetCommitCallback("object_list", onSelectObject, NULL);
return TRUE;
}
@@ -212,7 +215,6 @@ void LLFloaterInspect::refresh()
{
LLSelectNode* obj = *iter;
LLSD row;
- char time[MAX_STRING];
std::string owner_name, creator_name;
if (obj->mCreationDate == 0)
@@ -221,8 +223,11 @@ void LLFloaterInspect::refresh()
}
time_t timestamp = (time_t) (obj->mCreationDate/1000000);
- LLStringUtil::copy(time, ctime(&timestamp), MAX_STRING);
- time[24] = '\0';
+ std::string timeStr = getString("timeStamp");
+ LLSD substitution;
+ substitution["datetime"] = (S32) timestamp;
+ LLStringUtil::format (timeStr, substitution);
+
gCacheName->getFullName(obj->mPermissions->getOwner(), owner_name);
gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name);
row["id"] = obj->getObject()->getID();
@@ -246,7 +251,7 @@ void LLFloaterInspect::refresh()
row["columns"][2]["value"] = creator_name;
row["columns"][3]["column"] = "creation_date";
row["columns"][3]["type"] = "text";
- row["columns"][3]["value"] = time;
+ row["columns"][3]["value"] = timeStr;
mObjectList->addElement(row, ADD_TOP);
}
if(selected_index > -1 && mObjectList->getItemIndex(selected_uuid) == selected_index)