From cf18a1d22c7a4c315a651bc39085bc6d723e8e7d Mon Sep 17 00:00:00 2001
From: "Paul Guslisty pguslisty@productengine.com"
 <Paul Guslisty pguslisty@productengine.com>
Date: Thu, 11 Feb 2010 12:52:26 +0200
Subject: [PATCH] EXT - 2753 (Implement Avatar icons on IM multifloater tabs)
 refactoring:

- Deleted unnecessary parameters (UIButtonImageTopPadding, UIButtonImageBottomPadding) from settings.xml and their usage in LLTabContainer

- Deleted triggers (LLIMFloaterContainer::processProperties and LLIMFloaterContainer::changed) due to LLIMFloaterContainer no more Observer

- Renamed class LLParticularGroupMgrObserver to LLParticularGroupObserver as the last one's name is more self explanatory

--HG--
branch : product-engine
---
 indra/llui/lltabcontainer.cpp           |  5 -----
 indra/newview/app_settings/settings.xml | 22 ------------------
 indra/newview/llgroupmgr.cpp            |  6 ++---
 indra/newview/llgroupmgr.h              | 10 ++++-----
 indra/newview/llimfloatercontainer.cpp  | 30 -------------------------
 indra/newview/llimfloatercontainer.h    |  5 +----
 6 files changed, 9 insertions(+), 69 deletions(-)

diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index fe699cfa01f..13340e7ded7 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1631,14 +1631,9 @@ void LLTabContainer::setTabImage(LLPanel* child, LLIconCtrl* icon)
 void LLTabContainer::reshapeTuple(LLTabTuple* tuple)
 {
 	static LLUICachedControl<S32> tab_padding ("UITabPadding", 0);
-	static LLUICachedControl<S32> image_top_padding ("UIButtonImageTopPadding", 2);
-	static LLUICachedControl<S32> image_bottom_padding ("UIButtonImageBottomPadding", 2);
 
 	if (!mIsVertical)
 	{
-		tuple->mButton->setImageOverlayTopPad(image_top_padding);
-		tuple->mButton->setImageOverlayBottomPad(image_bottom_padding);
-
 		// remove current width from total tab strip width
 		mTotalTabWidth -= tuple->mButton->getRect().getWidth();
 
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index db4e0b5afd3..48205370ef6 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9948,28 +9948,6 @@
       <string>S32</string>
       <key>Value</key>
       <integer>15</integer>
-    </map>
-    <key>UIButtonImageTopPadding</key>
-    <map>
-      <key>Comment</key>
-      <string>Button Overlay Image Top Padding</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>2</integer>
-    </map>
-    <key>UIButtonImageBottomPadding</key>
-    <map>
-      <key>Comment</key>
-      <string>Button Overlay Image Bottom Padding</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>2</integer>
     </map>
 	<key>UploadBakedTexOld</key>
     <map>
diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp
index 4c1019a8820..e65990a0958 100644
--- a/indra/newview/llgroupmgr.cpp
+++ b/indra/newview/llgroupmgr.cpp
@@ -762,7 +762,7 @@ void LLGroupMgr::addObserver(LLGroupMgrObserver* observer)
 		mObservers.insert(std::pair<LLUUID, LLGroupMgrObserver*>(observer->getID(), observer));
 }
 
-void LLGroupMgr::addObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer)
+void LLGroupMgr::addObserver(const LLUUID& group_id, LLParticularGroupObserver* observer)
 {
 	if(group_id.notNull() && observer)
 	{
@@ -792,7 +792,7 @@ void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer)
 	}
 }
 
-void LLGroupMgr::removeObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer)
+void LLGroupMgr::removeObserver(const LLUUID& group_id, LLParticularGroupObserver* observer)
 {
 	if(group_id.isNull() || !observer)
 	{
@@ -1364,7 +1364,7 @@ void LLGroupMgr::notifyObservers(LLGroupChange gc)
 			gi->second->mChanged = FALSE;
 
 
-			// notify LLParticularGroupMgrObserver
+			// notify LLParticularGroupObserver
 		    observer_map_t::iterator obs_it = mParticularObservers.find(group_id);
 		    if(obs_it == mParticularObservers.end())
 		        return;
diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h
index 588b4a90344..2c86de8b970 100644
--- a/indra/newview/llgroupmgr.h
+++ b/indra/newview/llgroupmgr.h
@@ -53,10 +53,10 @@ class LLGroupMgrObserver
 	LLUUID	mID;
 };
 
-class LLParticularGroupMgrObserver
+class LLParticularGroupObserver
 {
 public:
-	virtual ~LLParticularGroupMgrObserver(){}
+	virtual ~LLParticularGroupObserver(){}
 	virtual void changed(const LLUUID& group_id, LLGroupChange gc) = 0;
 };
 
@@ -313,9 +313,9 @@ class LLGroupMgr : public LLSingleton<LLGroupMgr>
 	~LLGroupMgr();
 
 	void addObserver(LLGroupMgrObserver* observer);
-	void addObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer);
+	void addObserver(const LLUUID& group_id, LLParticularGroupObserver* observer);
 	void removeObserver(LLGroupMgrObserver* observer);
-	void removeObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer);
+	void removeObserver(const LLUUID& group_id, LLParticularGroupObserver* observer);
 	LLGroupMgrGroupData* getGroupData(const LLUUID& id);
 
 	void sendGroupPropertiesRequest(const LLUUID& group_id);
@@ -374,7 +374,7 @@ class LLGroupMgr : public LLSingleton<LLGroupMgr>
 	typedef std::map<LLUUID, LLGroupMgrGroupData*> group_map_t;
 	group_map_t mGroups;
 
-	typedef std::set<LLParticularGroupMgrObserver*> observer_set_t;
+	typedef std::set<LLParticularGroupObserver*> observer_set_t;
 	typedef std::map<LLUUID,observer_set_t> observer_map_t;
 	observer_map_t mParticularObservers;
 };
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index ba034609e9a..7162386d082 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -121,36 +121,6 @@ void LLIMFloaterContainer::onCloseFloater(LLUUID& id)
 	mSessions.erase(id);
 }
 
-void LLIMFloaterContainer::processProperties(void* data, enum EAvatarProcessorType type)
-{
-	if (APT_PROPERTIES == type)
-	{
-		LLAvatarData* avatar_data = static_cast<LLAvatarData*>(data);
-		if (avatar_data)
-		{
-			LLUUID avatar_id = avatar_data->avatar_id;
-			LLUUID* cached_avatarId = LLAvatarIconIDCache::getInstance()->get(avatar_id);
-			if(cached_avatarId && cached_avatarId->notNull() && avatar_data->image_id != *cached_avatarId)
-			{
-				LLAvatarIconIDCache::getInstance()->add(avatar_id,avatar_data->image_id);
-				mTabContainer->setTabImage(get_ptr_in_map(mSessions, avatar_id), avatar_data->image_id);
-			}
-		}
-	}
-}
-
-void LLIMFloaterContainer::changed(const LLUUID& group_id, LLGroupChange gc)
-{
-	if (GC_PROPERTIES == gc)
-	{
-		LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(group_id);
-		if (group_data && group_data->mInsigniaID.notNull())
-		{
-			mTabContainer->setTabImage(get_ptr_in_map(mSessions, group_id), group_data->mInsigniaID);
-		}
-	}
-}
-
 void LLIMFloaterContainer::onNewMessageReceived(const LLSD& data)
 {
 	LLUUID session_id = data["from_id"].asUUID();
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index b07ef2d71dd..46c0617c017 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -43,7 +43,7 @@
 
 class LLTabContainer;
 
-class LLIMFloaterContainer : public LLMultiFloater, public LLAvatarPropertiesObserver, public LLParticularGroupMgrObserver
+class LLIMFloaterContainer : public LLMultiFloater
 {
 public:
 	LLIMFloaterContainer(const LLSD& seed);
@@ -57,9 +57,6 @@ class LLIMFloaterContainer : public LLMultiFloater, public LLAvatarPropertiesObs
 								BOOL select_added_floater, 
 								LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
 
-	void processProperties(void* data, EAvatarProcessorType type);
-	void changed(const LLUUID& group_id, LLGroupChange gc);
-
 	static LLFloater* getCurrentVoiceFloater();
 
 	static LLIMFloaterContainer* findInstance();
-- 
GitLab