From 9ec432034dc3c45d7ce763eb02dae4cc7f6b8da8 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Sun, 21 Jun 2009 08:04:56 +0000 Subject: merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3 ignore-dead-branch --- indra/newview/llfloaterbump.cpp | 56 +++++++++++------------------------------ 1 file changed, 15 insertions(+), 41 deletions(-) (limited to 'indra/newview/llfloaterbump.cpp') diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index 96e51c2fa2..5cf4d90ece 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -37,25 +37,19 @@ #include "llscrolllistctrl.h" +#include "llsd.h" #include "lluictrlfactory.h" #include "llviewermessage.h" #include "llappviewer.h" // gPacificDaylightTime -///---------------------------------------------------------------------------- -/// Local function declarations, constants, enums, and typedefs -///---------------------------------------------------------------------------- -LLFloaterBump* LLFloaterBump::sInstance = NULL; - ///---------------------------------------------------------------------------- /// Class LLFloaterBump ///---------------------------------------------------------------------------- // Default constructor -LLFloaterBump::LLFloaterBump() +LLFloaterBump::LLFloaterBump(const LLSD& key) : LLFloater() { - sInstance = this; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_bumps.xml"); } @@ -63,29 +57,19 @@ LLFloaterBump::LLFloaterBump() // Destroys the object LLFloaterBump::~LLFloaterBump() { - sInstance = NULL; } -// static -void LLFloaterBump::show(void *contents) +// virtual +void LLFloaterBump::onOpen(const LLSD& key) { - if (gNoRender) - { + LLScrollListCtrl* list = getChild("bump_list"); + if (!list) return; - } - - if (!sInstance) - { - sInstance = new LLFloaterBump(); - } - - LLScrollListCtrl* list = sInstance->getChild("bump_list"); - if (!list) return; list->deleteAllItems(); if (gMeanCollisionList.empty()) { - std::string none_detected = sInstance->getString("none_detected"); + std::string none_detected = getString("none_detected"); LLSD row; row["columns"][0]["value"] = none_detected; row["columns"][0]["font"] = "SansSerifBold"; @@ -97,33 +81,23 @@ void LLFloaterBump::show(void *contents) iter != gMeanCollisionList.end(); ++iter) { LLMeanCollisionData *mcd = *iter; - LLFloaterBump::add(list, mcd); + add(list, mcd); } } - - sInstance->open(); /*Flawfinder: ignore*/ } void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) { - if (!sInstance) - { - new LLFloaterBump(); - } - if (mcd->mFirstName.empty() || list->getItemCount() >= 20) { return; } - // There's only one internal tm buffer. - struct tm* timep; - - // Convert to Pacific, based on server's opinion of whether - // it's daylight savings time there. - timep = utc_to_pacific_time(mcd->mTime, gPacificDaylightTime); - - std::string time = llformat("[%d:%02d]", timep->tm_hour, timep->tm_min); + std::string timeStr = getString ("timeStr"); + LLSD substitution; + + substitution["datetime"] = (S32) mcd->mTime; + LLStringUtil::format (timeStr, substitution); std::string action; switch(mcd->mType) @@ -150,8 +124,8 @@ void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) } // All above action strings are in XML file - LLUIString text = sInstance->getString(action); - text.setArg("[TIME]", time); + LLUIString text = getString(action); + text.setArg("[TIME]", timeStr); text.setArg("[FIRST]", mcd->mFirstName); text.setArg("[LAST]", mcd->mLastName); -- cgit v1.2.3 From ade6bbb06c6a842f39a3fe32decf7c66682df092 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Sun, 21 Jun 2009 17:16:27 +0000 Subject: merge -r 124105-124625 skinning-13 -> viewer-2.0.0-3 --- indra/newview/llfloaterbump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterbump.cpp') diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index 5cf4d90ece..e4e1c7efa2 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -50,7 +50,7 @@ LLFloaterBump::LLFloaterBump(const LLSD& key) : LLFloater() { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_bumps.xml"); + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_bumps.xml"); } -- cgit v1.2.3