From 0ce0d897f4e8bed87299b88b3ac24812bfe6afbd Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 29 Apr 2013 17:01:47 -0700
Subject: ACME-252 Create AvatarFolderItemView: Now the personview contains all
 icons that the avatarlistitem view contains.

---
 indra/newview/llpersonfolderview.cpp               |  1 -
 indra/newview/llpersontabview.cpp                  | 64 +++++++++++++++--
 indra/newview/llpersontabview.h                    | 35 ++++++++--
 .../skins/default/xui/en/widgets/person_view.xml   | 81 ++++++++++++++++++++++
 4 files changed, 172 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index 8141eecc35..636d093e0e 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -104,7 +104,6 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod
 	//24 should be loaded from .xml somehow
 	params.rect = LLRect (0, 24, getRect().getWidth(), 0);
 	params.tool_tip = params.name;
-	params.folder_indentation = 2;
 
 	return LLUICtrlFactory::create<LLPersonView>(params);
 }
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index e0bda32308..eaa112e051 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -117,16 +117,32 @@ void LLPersonTabView::drawHighlight()
 static LLDefaultChildRegistry::Register<LLPersonView> r_person_view("person_view");
 
 LLPersonView::Params::Params() :
-avatar_icon("avatar_icon")
+avatar_icon("avatar_icon"),
+last_interaction_time_textbox("last_interaction_time_textbox"),
+permission_edit_theirs_icon("permission_edit_theirs_icon"),
+permission_edit_mine_icon("permission_edit_mine_icon"),
+permission_map_icon("permission_map_icon"),
+permission_online_icon("permission_online_icon"),
+info_btn("info_btn"),
+profile_btn("profile_btn"),
+output_monitor("output_monitor")
 {}
 
 LLPersonView::LLPersonView(const LLPersonView::Params& p) :
 LLFolderViewItem(p),
 mImageOver(LLUI::getUIImage("ListItem_Over")),
 mImageSelected(LLUI::getUIImage("ListItem_Select")),
-mAvatarIcon(NULL)
+mAvatarIcon(NULL),
+mLastInteractionTimeTextbox(NULL),
+mPermissionEditTheirsIcon(NULL),
+mPermissionEditMineIcon(NULL),
+mPermissionMapIcon(NULL),
+mPermissionOnlineIcon(NULL),
+mInfoBtn(NULL),
+mProfileBtn(NULL),
+mOutputMonitorCtrl(NULL)
 {
-
+	initChildrenWidths(this);
 }
 
 S32 LLPersonView::getLabelXPos()
@@ -175,7 +191,7 @@ void LLPersonView::drawHighlight()
 	if(mIsSelected)
 	{
 		mImageSelected->draw(x, y, width, height);
-		//Need to find a better color that matches the outline in avatarlistitem
+		//Draw outline
 		gl_rect_2d(x, 
 			height, 
 			width,
@@ -195,4 +211,44 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params)
 	applyXUILayout(avatar_icon_params, this);
 	mAvatarIcon = LLUICtrlFactory::create<LLAvatarIconCtrl>(avatar_icon_params);
 	addChild(mAvatarIcon);
+	
+	LLTextBox::Params last_interaction_time_textbox(params.last_interaction_time_textbox());
+	applyXUILayout(last_interaction_time_textbox, this);
+	mLastInteractionTimeTextbox = LLUICtrlFactory::create<LLTextBox>(last_interaction_time_textbox);
+	addChild(mLastInteractionTimeTextbox);
+
+	LLIconCtrl::Params permission_edit_theirs_icon(params.permission_edit_theirs_icon());
+	applyXUILayout(permission_edit_theirs_icon, this);
+	mPermissionEditTheirsIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_edit_theirs_icon);
+	addChild(mPermissionEditTheirsIcon);
+
+	LLIconCtrl::Params permission_map_icon(params.permission_map_icon());
+	applyXUILayout(permission_map_icon, this);
+	mPermissionMapIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_map_icon);
+	addChild(mPermissionMapIcon);
+
+	LLIconCtrl::Params permission_online_icon(params.permission_online_icon());
+	applyXUILayout(permission_online_icon, this);
+	mPermissionOnlineIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_online_icon);
+	addChild(mPermissionOnlineIcon);
+
+	LLButton::Params info_btn(params.info_btn());
+	applyXUILayout(info_btn, this);
+	mInfoBtn = LLUICtrlFactory::create<LLButton>(info_btn);
+	addChild(mInfoBtn);
+
+	LLButton::Params profile_btn(params.profile_btn());
+	applyXUILayout(profile_btn, this);
+	mProfileBtn = LLUICtrlFactory::create<LLButton>(profile_btn);
+	addChild(mProfileBtn);
+	
+	LLOutputMonitorCtrl::Params output_monitor(params.output_monitor());
+	applyXUILayout(output_monitor, this);
+	mOutputMonitorCtrl = LLUICtrlFactory::create<LLOutputMonitorCtrl>(output_monitor);
+	addChild(mOutputMonitorCtrl);
+}
+
+void LLPersonView::initChildrenWidths(LLPersonView* self)
+{
+
 }
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index e1b34e1da4..d8d1a65df6 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -28,7 +28,10 @@
 #define LL_LLPERSONTABVIEW_H
 
 #include "llavatariconctrl.h"
+#include "llbutton.h"
 #include "llfolderviewitem.h"
+#include "lloutputmonitorctrl.h"
+#include "lltextbox.h"
 
 class LLPersonTabView : public LLFolderViewFolder
 {
@@ -70,6 +73,14 @@ public:
 	{
 		Params();
 		Optional<LLAvatarIconCtrl::Params> avatar_icon;
+		Optional<LLTextBox::Params> last_interaction_time_textbox;
+		Optional<LLIconCtrl::Params> permission_edit_theirs_icon;
+		Optional<LLIconCtrl::Params> permission_edit_mine_icon;
+		Optional<LLIconCtrl::Params> permission_map_icon;
+		Optional<LLIconCtrl::Params> permission_online_icon;
+		Optional<LLButton::Params> info_btn;
+		Optional<LLButton::Params> profile_btn;
+		Optional<LLOutputMonitorCtrl::Params> output_monitor;
 	};
 
 	LLPersonView(const LLPersonView::Params& p);
@@ -89,18 +100,34 @@ private:
 	LLPointer<LLUIImage> mImageSelected;
 
 	LLAvatarIconCtrl* mAvatarIcon;
+	LLTextBox * mLastInteractionTimeTextbox;
+	LLIconCtrl * mPermissionEditTheirsIcon;
+	LLIconCtrl * mPermissionEditMineIcon;
+	LLIconCtrl * mPermissionMapIcon;
+	LLIconCtrl * mPermissionOnlineIcon;
 	LLButton * mInfoBtn;
+	LLButton * mProfileBtn;
+	LLOutputMonitorCtrl * mOutputMonitorCtrl;
+
+
 
 	typedef enum e_avatar_item_child {
 		ALIC_SPEAKER_INDICATOR,
+		ALIC_PROFILE_BUTTON,
 		ALIC_INFO_BUTTON,
+		ALIC_PERMISSION_ONLINE,
+		ALIC_PERMISSION_MAP,
+		ALIC_PERMISSION_EDIT_MINE,
+		ALIC_PERMISSION_EDIT_THEIRS,
+		ALIC_INTERACTION_TIME,
 		ALIC_COUNT,
 	} EAvatarListItemChildIndex;
 
-	static bool	sStaticInitialized; // this variable is introduced to improve code readability
-	static S32 sChildrenWidths[ALIC_COUNT];
-	//static void initChildrenWidths(LLConversationViewParticipant* self);
-	//void updateChildren();
+	static bool	sStaticInitialized;
+	static S32 sMouseOverChildrenWidths[ALIC_COUNT];
+	static S32 sMouseOverChildren[ALIC_COUNT];
+	static void initChildrenWidths(LLPersonView* self);
+	void updateChildren();
 	//LLView* getItemChildView(EAvatarListItemChildIndex child_view_index);
 };
 
diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml
index 84ad807b83..d257a5114f 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml
@@ -21,5 +21,86 @@
       left="5"
       top="2"
       width="20" />
+    <last_interaction_time_textbox
+      layout="topleft"
+      follows="right"
+      font="SansSerifSmall"
+      height="15"
+      left_pad="5"
+      right="-164"
+      name="last_interaction_time_textbox"
+      text_color="LtGray_50"
+      value="0s"
+      width="35" />
+    <permission_edit_theirs_icon
+      layout="topleft"
+      height="16"
+      follows="right"
+      image_name="Permission_Edit_Objects_Theirs"
+      left_pad="3"
+      right="-129"
+      name="permission_edit_theirs_icon"
+      tool_tip="You can edit this friend&apos;s objects"
+      top="4"
+      width="16" />
+    <permission_edit_mine_icon
+      layout="topleft"
+      height="16"
+      follows="right"
+      image_name="Permission_Edit_Objects_Mine"
+      left_pad="3"
+      right="-110"
+      name="permission_edit_mine_icon"
+      tool_tip="This friend can edit, delete or take your objects"
+      width="16" />
+    <permission_map_icon
+      height="16"
+      follows="right"
+      image_name="Permission_Visible_Map"
+      left_pad="3"
+      tool_tip="This friend can locate you on the map"
+      right="-91"
+      name="permission_map_icon"
+      width="16" />
+    <permission_online_icon
+      height="16"
+      follows="right"
+      image_name="Permission_Visible_Online"
+      left_pad="3"
+      right="-72"
+      name="permission_online_icon"
+      tool_tip="This friend can see when you&apos;re online"
+      width="16" />
+    <info_btn
+      follows="right"
+      height="16"
+      image_pressed="Info_Press"
+      image_unselected="Info_Over"
+      left_pad="3"
+      right="-53"
+      name="info_btn"
+      tool_tip="More info"
+      tab_stop="false"
+      width="16" />
+    <profile_btn
+      follows="right"
+      height="20"
+      image_overlay="Web_Profile_Off"
+      left_pad="5"
+      right="-28"
+      name="profile_btn"
+      tab_stop="false"
+      tool_tip="View profile"
+      top_delta="-2"
+      width="20" />
+    <output_monitor
+      auto_update="true"
+      follows="right"
+      draw_border="false"
+      height="16"
+      right="-3"
+      mouse_opaque="true"
+      name="speaking_indicator"
+      width="20" />
  </person_view>
 
-- 
cgit v1.2.3


From 548b75f3fdec08227c5d41424e3af90fbe455208 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 30 Apr 2013 01:40:46 +0100
Subject: updated to grab FB URLs from server

---
 indra/newview/llpanelpeople.cpp | 35 ++++++++++++++++++++---------------
 indra/newview/llpanelpeople.h   |  3 +--
 2 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index ef45cc44f7..712a116873 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -91,9 +91,6 @@ static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
 static const std::string FBCTESTTWO_TAB_NAME	= "fbctesttwo_panel";
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
-static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc";
-static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect";
-
 class LLFacebookConnectHandler : public LLCommandHandler
 {
 public:
@@ -1729,6 +1726,14 @@ public:
 			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
 		}
 	}
+
+	/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (status == 302)
+		{
+			mPanelPeople->openFacebookWeb(content["location"]);
+		}
+	}
 };
 
 class FacebookDisconnectResponder : public LLHTTPClient::Responder
@@ -1782,7 +1787,7 @@ public:
 			// show the facebook login page if not connected yet
 			if (status == 404 && mShowLoginIfNotConnected)
 			{
-				mPanelPeople->openFacebookWeb("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL());
+				mPanelPeople->connectToFacebook();
 			}
 		}
 	}
@@ -1810,6 +1815,14 @@ public:
 			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
 		}
 	}
+
+	/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (status == 302)
+		{
+			mPanelPeople->openFacebookWeb(content["location"]);
+		}
+	}
 };
 
 void LLPanelPeople::loadFacebookFriends()
@@ -1828,8 +1841,9 @@ void LLPanelPeople::tryToReconnectToFacebook()
 void LLPanelPeople::connectToFacebook(const std::string& auth_code)
 {
 	LLSD body;
-	body["code"] = auth_code;
-	body["redirect_uri"] = getFacebookRedirectURL();
+	if (!auth_code.empty())
+		body["code"] = auth_code;
+
 	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this));
 }
 
@@ -1846,13 +1860,6 @@ std::string LLPanelPeople::getFacebookConnectURL(const std::string& route)
 	return url;
 }
 
-std::string LLPanelPeople::getFacebookRedirectURL()
-{
-	static std::string sFacebookRedirectUrl = gAgent.getRegion()->getCapability("FacebookRedirect");
-	llinfos << sFacebookRedirectUrl << llendl;
-	return sFacebookRedirectUrl;
-}	
-
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
 	if (mConnectedToFbc)
@@ -1867,12 +1874,10 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 
 void LLPanelPeople::onFacebookAppRequestClicked()
 {
-	openFacebookWeb("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL());
 }
 
 void LLPanelPeople::onFacebookAppSendClicked()
 {
-	openFacebookWeb("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL());
 }
 
 static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test");
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 95105309d2..943d84ac1d 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -69,11 +69,10 @@ public:
 	void hideFacebookFriends();
 	void loadFacebookFriends();
 	void tryToReconnectToFacebook();
-	void connectToFacebook(const std::string& auth_code);
+	void connectToFacebook(const std::string& auth_code = "");
 	void disconnectFromFacebook();
 	
 	std::string getFacebookConnectURL(const std::string& route = "");
-	std::string getFacebookRedirectURL();
 	
 	bool mConnectedToFbc;
 	bool mTryToConnectToFbc;
-- 
cgit v1.2.3