From 7172b76f0e70bcb1c4616f7126c279637e18c675 Mon Sep 17 00:00:00 2001
From: Mnikolenko ProductEngine <mnikolenko@productengine.com>
Date: Wed, 12 Aug 2015 12:09:57 +0300
Subject: [PATCH] SL-193  FIXED Show info icons for experiences in
 Key,Allowed,Blocked lists.

---
 indra/newview/llnamelistctrl.cpp                | 15 ++++++++++++---
 indra/newview/llnamelistctrl.h                  | 17 +++++++++++++----
 indra/newview/llpanelexperiencelisteditor.cpp   |  6 ++++--
 indra/newview/llpanelexperiencelisteditor.h     |  3 ++-
 .../xui/en/panel_experience_list_editor.xml     |  6 +++---
 5 files changed, 34 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index 79988a0800..5510598ae7 100755
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -130,8 +130,14 @@ BOOL LLNameListCtrl::handleDragAndDrop(
 	return handled;
 }
 
-void LLNameListCtrl::showInspector(const LLUUID& avatar_id, bool is_group)
+void LLNameListCtrl::showInspector(const LLUUID& avatar_id, bool is_group, bool is_experience)
 {
+	if(is_experience)
+	{
+		LLFloaterReg::showInstance("experience_profile", avatar_id, true);
+		return;
+	}
+
 	if (is_group)
 		LLFloaterReg::showInstance("inspect_group", LLSD().with("group_id", avatar_id));
 	else
@@ -230,10 +236,11 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask)
 
 				// Should we show a group or an avatar inspector?
 				bool is_group = hit_item->isGroup();
+				bool is_experience = hit_item->isExperience();
 
 				LLToolTip::Params params;
 				params.background_visible( false );
-				params.click_callback( boost::bind(&LLNameListCtrl::showInspector, this, avatar_id, is_group) );
+				params.click_callback( boost::bind(&LLNameListCtrl::showInspector, this, avatar_id, is_group, is_experience) );
 				params.delay_time(0.0f);		// spawn instantly on hover
 				params.image( icon );
 				params.message("");
@@ -295,7 +302,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
 	const std::string& prefix)
 {
 	LLUUID id = name_item.value().asUUID();
-	LLNameListItem* item = new LLNameListItem(name_item,name_item.target() == GROUP);
+	LLNameListItem* item = new LLNameListItem(name_item,name_item.target() == GROUP, name_item.target() == EXPERIENCE);
 
 	if (!item) return NULL;
 
@@ -353,6 +360,8 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
 			}
 			break;
 		}
+	case EXPERIENCE:
+		// just use supplied name
 	default:
 		break;
 	}
diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h
index 515962df7d..19ce3c7aed 100755
--- a/indra/newview/llnamelistctrl.h
+++ b/indra/newview/llnamelistctrl.h
@@ -44,22 +44,30 @@ class LLNameListItem : public LLScrollListItem, public LLHandleProvider<LLNameLi
 public:
 	bool isGroup() const { return mIsGroup; }
 	void setIsGroup(bool is_group) { mIsGroup = is_group; }
+	bool isExperience() const { return mIsExperience; }
+	void setIsExperience(bool is_experience) { mIsExperience = is_experience; }
 
 protected:
 	friend class LLNameListCtrl;
 
 	LLNameListItem( const LLScrollListItem::Params& p )
-	:	LLScrollListItem(p), mIsGroup(false)
+	:	LLScrollListItem(p), mIsGroup(false), mIsExperience(false)
 	{
 	}
 
 	LLNameListItem( const LLScrollListItem::Params& p, bool is_group )
-	:	LLScrollListItem(p), mIsGroup(is_group)
+	:	LLScrollListItem(p), mIsGroup(is_group), mIsExperience(false)
+	{
+	}
+
+	LLNameListItem( const LLScrollListItem::Params& p, bool is_group, bool is_experience )
+	:	LLScrollListItem(p), mIsGroup(is_group), mIsExperience(is_experience)
 	{
 	}
 
 private:
 	bool mIsGroup;
+	bool mIsExperience;
 };
 
 
@@ -73,7 +81,8 @@ public:
 	{
 		INDIVIDUAL,
 		GROUP,
-		SPECIAL
+		SPECIAL,
+		EXPERIENCE
 	} ENameType;
 
 	// provide names for enums
@@ -160,7 +169,7 @@ public:
 
 	/*virtual*/ void mouseOverHighlightNthItem( S32 index );
 private:
-	void showInspector(const LLUUID& avatar_id, bool is_group);
+	void showInspector(const LLUUID& avatar_id, bool is_group, bool is_experience = false);
 	void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, std::string suffix, LLHandle<LLNameListItem> item);
 
 private:
diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp
index fc4ee9862e..7c07301762 100644
--- a/indra/newview/llpanelexperiencelisteditor.cpp
+++ b/indra/newview/llpanelexperiencelisteditor.cpp
@@ -33,6 +33,7 @@
 #include "llfloaterexperiencepicker.h"
 #include "llfloaterreg.h"
 #include "llhandle.h"
+#include "llnamelistctrl.h"
 #include "llscrolllistctrl.h"
 #include "llviewerregion.h"
 #include "llagent.h"
@@ -54,7 +55,7 @@ LLPanelExperienceListEditor::LLPanelExperienceListEditor()
 
 BOOL LLPanelExperienceListEditor::postBuild()
 {
-	mItems = getChild<LLScrollListCtrl>("experience_list");
+	mItems = getChild<LLNameListCtrl>("experience_list");
 	mAdd = getChild<LLButton>("btn_add");
 	mRemove = getChild<LLButton>("btn_remove");
 	mProfile = getChild<LLButton>("btn_profile");
@@ -178,12 +179,13 @@ void LLPanelExperienceListEditor::onItems()
 	{
 		const LLUUID& experience = *it;
 		item["id"]=experience;
+		item["target"] = LLNameListCtrl::EXPERIENCE;
 		LLSD& columns = item["columns"];
 		columns[0]["column"] = "experience_name";
 		columns[0]["value"] = getString("loading");
 		mItems->addElement(item);
 
-		LLExperienceCache::get(experience, boost::bind(&LLPanelExperienceListEditor::experienceDetailsCallback, 
+		LLExperienceCache::get(experience, boost::bind(&LLPanelExperienceListEditor::experienceDetailsCallback,
 			getDerivedHandle<LLPanelExperienceListEditor>(), _1));
 	}
 
diff --git a/indra/newview/llpanelexperiencelisteditor.h b/indra/newview/llpanelexperiencelisteditor.h
index f69f0509be..bc9867752d 100644
--- a/indra/newview/llpanelexperiencelisteditor.h
+++ b/indra/newview/llpanelexperiencelisteditor.h
@@ -31,6 +31,7 @@
 #include "lluuid.h"
 #include <set>
 
+class LLNameListCtrl;
 class LLScrollListCtrl;
 class LLButton;
 class LLFloaterExperiencePicker;
@@ -82,7 +83,7 @@ private:
 	uuid_list_t mExperienceIds;
 
 
-	LLScrollListCtrl*			mItems;
+	LLNameListCtrl*				mItems;
 	filter_list					mFilters;
 	LLButton*					mAdd;
 	LLButton*					mRemove;
diff --git a/indra/newview/skins/default/xui/en/panel_experience_list_editor.xml b/indra/newview/skins/default/xui/en/panel_experience_list_editor.xml
index c76b958eda..c357f9e7d5 100644
--- a/indra/newview/skins/default/xui/en/panel_experience_list_editor.xml
+++ b/indra/newview/skins/default/xui/en/panel_experience_list_editor.xml
@@ -47,19 +47,19 @@
       height="12"
       follows="top|left">
    </text>
-  <scroll_list
+  <name_list
     draw_heading="false"
     left="3"
     width="225"
     height="75"
     follows="all"
     name="experience_list">
-    <columns
+    <name_list.columns
       width="225"
       user_resize="false"
       name="experience_name"
       label="Name"/>
-  </scroll_list>
+  </name_list>
   <button
     layout="topleft"
     follows="top|right"
-- 
GitLab