From b59e4a02b65480d79ca8ce9dd1859ecedeecb1e6 Mon Sep 17 00:00:00 2001
From: Mnikolenko ProductEngine <mnikolenko@productengine.com>
Date: Thu, 28 May 2015 12:08:06 +0300
Subject: [PATCH] MAINT-3597 FIXED Bumps, Pushes & Hits Improvements

---
 indra/newview/llfloaterbump.cpp               | 32 +++++++++++++------
 indra/newview/llfloaterbump.h                 |  4 +++
 indra/newview/llviewermessage.cpp             |  6 ++++
 .../skins/default/xui/en/floater_bumps.xml    |  6 ++--
 4 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp
index 34904cf7eda..957c91b2263 100755
--- a/indra/newview/llfloaterbump.cpp
+++ b/indra/newview/llfloaterbump.cpp
@@ -32,6 +32,7 @@
 
 #include "llavataractions.h"
 #include "llfloaterbump.h"
+#include "llfloaterreg.h"
 #include "llfloaterreporter.h"
 #include "llmutelist.h"
 #include "llpanelblockedlist.h"
@@ -87,11 +88,11 @@ BOOL LLFloaterBump::postBuild()
 // virtual
 void LLFloaterBump::onOpen(const LLSD& key)
 {
-	mNames.clear();
-	mList->deleteAllItems();
-
 	if (gMeanCollisionList.empty())
 	{
+		mNames.clear();
+		mList->deleteAllItems();
+
 		std::string none_detected = getString("none_detected");
 		LLSD row;
 		row["columns"][0]["value"] = none_detected;
@@ -100,12 +101,20 @@ void LLFloaterBump::onOpen(const LLSD& key)
 	}
 	else
 	{
-		for (mean_collision_list_t::iterator iter = gMeanCollisionList.begin();
-			 iter != gMeanCollisionList.end(); ++iter)
-		{
-			LLMeanCollisionData *mcd = *iter;
-			add(mList, mcd);
-		}
+		populateCollisionList();
+	}
+}
+
+void LLFloaterBump::populateCollisionList()
+{
+	mNames.clear();
+	mList->deleteAllItems();
+
+	for (mean_collision_list_t::iterator iter = gMeanCollisionList.begin();
+				 iter != gMeanCollisionList.end(); ++iter)
+	{
+		LLMeanCollisionData *mcd = *iter;
+		add(mList, mcd);
 	}
 }
 
@@ -247,3 +256,8 @@ void LLFloaterBump::inviteToGroup()
 {
 	LLAvatarActions::inviteToGroup(mItemUUID);
 }
+
+LLFloaterBump* LLFloaterBump::getInstance()
+{
+	return LLFloaterReg::getTypedInstance<LLFloaterBump>("bumps");
+}
diff --git a/indra/newview/llfloaterbump.h b/indra/newview/llfloaterbump.h
index 11b7db9fee0..ce52c75255f 100755
--- a/indra/newview/llfloaterbump.h
+++ b/indra/newview/llfloaterbump.h
@@ -46,6 +46,10 @@ class LLFloaterBump
 	/*virtual*/	BOOL postBuild();
 	/*virtual*/ void onOpen(const LLSD& key);
 	
+	static LLFloaterBump* getInstance();
+
+	void populateCollisionList();
+
 	void startIM();
 	void startCall();
 	void reportAbuse();
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 4e9144ac269..f5350a0b309 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -57,6 +57,7 @@
 #include "llcallingcard.h"
 #include "llbuycurrencyhtml.h"
 #include "llfirstuse.h"
+#include "llfloaterbump.h"
 #include "llfloaterbuyland.h"
 #include "llfloaterland.h"
 #include "llfloaterregioninfo.h"
@@ -6215,6 +6216,11 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use
 			gCacheName->get(perp, false, boost::bind(&mean_name_callback, _1, _2, _3));
 		}
 	}
+	LLFloaterBump* bumps_floater = LLFloaterBump::getInstance();
+	if(bumps_floater && bumps_floater->isInVisibleChain())
+	{
+		bumps_floater->populateCollisionList();
+	}
 }
 
 void process_frozen_message(LLMessageSystem *msgsystem, void **user_data)
diff --git a/indra/newview/skins/default/xui/en/floater_bumps.xml b/indra/newview/skins/default/xui/en/floater_bumps.xml
index 1f2fe62b3cf..126e3aac480 100755
--- a/indra/newview/skins/default/xui/en/floater_bumps.xml
+++ b/indra/newview/skins/default/xui/en/floater_bumps.xml
@@ -7,7 +7,7 @@
  help_topic="floater_bumps"
  save_rect="true"
  title="BUMPS, PUSHES &amp; HITS"
- width="400">
+ width="420">
     <floater.string
      name="none_detected">
         None detected
@@ -34,7 +34,7 @@
     </floater.string>
     <floater.string
      name="timeStr">
-        [[hour,datetime,slt]:[min,datetime,slt]]
+        [[hour,datetime,slt]:[min,datetime,slt]:[second,datetime,slt]]
     </floater.string>
     <scroll_list
      draw_border="false"
@@ -45,5 +45,5 @@
      multi_select="true"
      name="bump_list"
      top="20"
-     width="388" />
+     width="408" />
 </floater>
-- 
GitLab