From 1b6d6b7e794ad4401faa91a79774922a5baec968 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 3 May 2013 11:57:59 -0700 Subject: ACME-323 Create a tab for 'Invite people you know to SL': FBC Test Two tabs are now named to match UX spec. Also created a function called createPersonTabs() which simplifies tab creation. The LLPersonFolderView is being turned into the tab manager. --- indra/newview/llpanelpeople.cpp | 25 ------------------------- indra/newview/llpersonfolderview.cpp | 24 ++++++++++++++++++++++++ indra/newview/llpersonfolderview.h | 4 ++++ 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 03135ce580..22b79a9380 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -750,31 +750,6 @@ BOOL LLPanelPeople::postBuild() scroller->setFollowsAll(); mPersonFolderView->setScrollContainer(scroller); mPersonFolderView->setFollowsAll(); - - //Create a person tab - LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); - LLPersonTabView::Params params; - params.name = item->getDisplayName(); - params.root = mPersonFolderView; - params.listener = item; - params.tool_tip = params.name; - LLPersonTabView * widget = LLUICtrlFactory::create(params); - widget->addToFolder(mPersonFolderView); - - mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; - mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; - - //Create a person tab - item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel); - params.name = item->getDisplayName(); - params.root = mPersonFolderView; - params.listener = item; - params.tool_tip = params.name; - widget = LLUICtrlFactory::create(params); - widget->addToFolder(mPersonFolderView); - - mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; - mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; gIdleCallbacks.addFunction(idle, this); diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index ba1e9d20eb..21578e986b 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -38,6 +38,8 @@ LLFolderView(p), mConversationsEventStream("ConversationsEventsTwo") { mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1)); + + createPersonTabs(); } LLPersonFolderView::~LLPersonFolderView() @@ -45,6 +47,28 @@ LLPersonFolderView::~LLPersonFolderView() mConversationsEventStream.stopListening("ConversationsRefresh"); } +void LLPersonFolderView::createPersonTabs() +{ + createPersonTab("SL residents you may want to friend"); + createPersonTab("Invite people you know to SL"); +} + +void LLPersonFolderView::createPersonTab(const std::string& tab_name) +{ + //Create a person tab + LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); + LLPersonTabView::Params params; + params.name = item->getDisplayName(); + params.root = this; + params.listener = item; + params.tool_tip = params.name; + LLPersonTabView * widget = LLUICtrlFactory::create(params); + widget->addToFolder(this); + + mPersonFolderModelMap[item->getID()] = item; + mPersonFolderViewMap[item->getID()] = widget; +} + BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) { LLFolderViewItem * item = getCurSelectedItem(); diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 74e9142a7c..1cf597b8c9 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -50,6 +50,10 @@ public: LLPersonFolderView(const Params &p); ~LLPersonFolderView(); + + void createPersonTabs(); + void createPersonTab(const std::string& tab_name); + bool onConversationModelEvent(const LLSD &event); LLPersonView * createConversationViewParticipant(LLPersonModel * item); -- cgit v1.2.3 From 0408a984d3efb55cdf88c314e333be3b29c291ea Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 3 May 2013 13:55:12 -0700 Subject: ACME-324 Populate list with FB only friends: When clicking the '+' button FB only friends will appear in the second tab titled 'Invite people you know to SL'. --- indra/newview/llpanelpeople.cpp | 38 ++++++++++++++++++++++++++++++++---- indra/newview/llpersonfolderview.cpp | 1 + indra/newview/llpersonfolderview.h | 1 + 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 22b79a9380..e1933c041c 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1641,17 +1641,29 @@ void LLPanelPeople::openFacebookWeb(std::string url) void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); + S32 model_index; for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { std::string name = i->second["name"].asString(); LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + //FB+SL but not SL friend + if(agent_id.notNull()) + { + model_index = 0; + } + //FB only friend + else + { + model_index = 1; + } + //add to avatar list mFacebookFriends->addNewItem(agent_id, name, false); //Add to folder view - LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); + LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); if(session_model) { addParticipantToModel(session_model, agent_id, name); @@ -1663,11 +1675,29 @@ void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); std::string prefix("Test Name"); + LLPersonTabModel * person_folder_model; + LLUUID agentID; + std::string name; + S32 model_index; + for(int i = 0; i < 300; ++i) { - LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); - std::string name = prefix + " " + suffix; - addParticipantToModel(person_folder_model, gAgent.getID(), name); + //Adds FB+SL people that aren't yet SL friends + if(i < 10) + { + model_index = 0; + agentID = gAgent.getID(); + } + //Adds FB only friends + else + { + model_index = 1; + agentID = LLUUID(NULL); + } + + person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); + name = prefix + " " + suffix; + addParticipantToModel(person_folder_model, agentID, name); // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... suffix[1]+=1; if (suffix[1]=='{') diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 21578e986b..8f468e6814 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -65,6 +65,7 @@ void LLPersonFolderView::createPersonTab(const std::string& tab_name) LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(this); + mPersonTabIDs.push_back(item->getID()); mPersonFolderModelMap[item->getID()] = item; mPersonFolderViewMap[item->getID()] = widget; } diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 1cf597b8c9..3f5f874e0f 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -61,6 +61,7 @@ public: person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; + std::vector mPersonTabIDs; LLEventStream mConversationsEventStream; }; -- cgit v1.2.3 From cca67a38d89da30d2b36690d91eb00cac04384bd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 3 May 2013 16:18:47 -0700 Subject: =?UTF-8?q?ACME-326=20Add=20=E2=80=98connect=20to=20facebook?= =?UTF-8?q?=E2=80=99=20on=20menu=20bar=20with=20functionality:=20Now=20the?= =?UTF-8?q?=20'SL=20residents=20you=20may=20want=20to=20friend'=20folder?= =?UTF-8?q?=20is=20populated=20only=20with=20FB+SL=20users=20who=20are=20n?= =?UTF-8?q?ot=20yet=20friends.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llpanelpeople.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e1933c041c..f9f4d6d1b6 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1642,14 +1642,18 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); S32 model_index; + LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { std::string name = i->second["name"].asString(); LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + //add to avatar list + mFacebookFriends->addNewItem(agent_id, name, false); + //FB+SL but not SL friend - if(agent_id.notNull()) + if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) { model_index = 0; } @@ -1659,9 +1663,6 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) model_index = 1; } - //add to avatar list - mFacebookFriends->addNewItem(agent_id, name, false); - //Add to folder view LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); if(session_model) -- cgit v1.2.3 From e30c0925f517b18830b7a4d520246acd98981ab3 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 11:31:22 -0700 Subject: ACME-326 Populate the list with FB users who use SL but are not yet SL friends: Code cleanup --- indra/newview/llpanelpeople.cpp | 12 +++---- indra/newview/llpersonfolderview.cpp | 68 +++++++++++++++++++++--------------- indra/newview/llpersonfolderview.h | 7 ++-- 3 files changed, 49 insertions(+), 38 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index f9f4d6d1b6..56523773b8 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1664,10 +1664,10 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) } //Add to folder view - LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); - if(session_model) + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); + if(person_tab_model) { - addParticipantToModel(session_model, agent_id, name); + addParticipantToModel(person_tab_model, agent_id, name); } } } @@ -1676,7 +1676,7 @@ void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); std::string prefix("Test Name"); - LLPersonTabModel * person_folder_model; + LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; S32 model_index; @@ -1696,9 +1696,9 @@ void LLPanelPeople::addTestParticipant() agentID = LLUUID(NULL); } - person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); + person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); name = prefix + " " + suffix; - addParticipantToModel(person_folder_model, agentID, name); + addParticipantToModel(person_tab_model, agentID, name); // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... suffix[1]+=1; if (suffix[1]=='{') diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 8f468e6814..191c7d5bcd 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -47,29 +47,6 @@ LLPersonFolderView::~LLPersonFolderView() mConversationsEventStream.stopListening("ConversationsRefresh"); } -void LLPersonFolderView::createPersonTabs() -{ - createPersonTab("SL residents you may want to friend"); - createPersonTab("Invite people you know to SL"); -} - -void LLPersonFolderView::createPersonTab(const std::string& tab_name) -{ - //Create a person tab - LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); - LLPersonTabView::Params params; - params.name = item->getDisplayName(); - params.root = this; - params.listener = item; - params.tool_tip = params.name; - LLPersonTabView * widget = LLUICtrlFactory::create(params); - widget->addToFolder(this); - - mPersonTabIDs.push_back(item->getID()); - mPersonFolderModelMap[item->getID()] = item; - mPersonFolderViewMap[item->getID()] = widget; -} - BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) { LLFolderViewItem * item = getCurSelectedItem(); @@ -97,6 +74,29 @@ BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) return LLView::handleMouseDown( x, y, mask ); } +void LLPersonFolderView::createPersonTabs() +{ + createPersonTab("SL residents you may want to friend"); + createPersonTab("Invite people you know to SL"); +} + +void LLPersonFolderView::createPersonTab(const std::string& tab_name) +{ + //Create a person tab + LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); + LLPersonTabView::Params params; + params.name = item->getDisplayName(); + params.root = this; + params.listener = item; + params.tool_tip = params.name; + LLPersonTabView * widget = LLUICtrlFactory::create(params); + widget->addToFolder(this); + + mIndexToFolderVec.push_back(item->getID()); + mPersonFolderModelMap[item->getID()] = item; + mPersonFolderViewMap[item->getID()] = widget; +} + bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) { std::string type = event.get("type").asString(); @@ -105,17 +105,17 @@ bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) if(type == "add_participant") { - LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); - LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[folder_id]); + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderModelMap[folder_id]); + LLPersonTabView * person_tab_view = dynamic_cast(mPersonFolderViewMap[folder_id]); - if(person_folder_model) + if(person_tab_model) { - LLPersonModel * person_model = person_folder_model->findParticipant(person_id); + LLPersonModel * person_model = person_tab_model->findParticipant(person_id); if(person_model) { - LLPersonView * participant_view = createConversationViewParticipant(person_model); - participant_view->addToFolder(person_folder_view); + LLPersonView * person_view = createConversationViewParticipant(person_model); + person_view->addToFolder(person_tab_view); } } } @@ -137,3 +137,13 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod return LLUICtrlFactory::create(params); } + +LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(const S32 index) +{ + return mPersonFolderModelMap[mIndexToFolderVec[index]]; +} + +LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(const S32 index) +{ + return mPersonFolderViewMap[mIndexToFolderVec[index]]; +} diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 3f5f874e0f..3a15f59164 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -50,18 +50,19 @@ public: LLPersonFolderView(const Params &p); ~LLPersonFolderView(); + BOOL handleMouseDown( S32 x, S32 y, MASK mask ); void createPersonTabs(); void createPersonTab(const std::string& tab_name); - bool onConversationModelEvent(const LLSD &event); LLPersonView * createConversationViewParticipant(LLPersonModel * item); - BOOL handleMouseDown( S32 x, S32 y, MASK mask ); + LLPersonTabModel * getPersonTabModelByIndex(const S32 index); + LLPersonTabView * getPersonTabViewByIndex(const S32 index); person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; - std::vector mPersonTabIDs; + std::vector mIndexToFolderVec; LLEventStream mConversationsEventStream; }; -- cgit v1.2.3 From f6ad5819c15b1acca1a8b6498bc56adf1c0c3ac9 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 11:46:16 -0700 Subject: ACME-326 Populate the list with FB users who use SL but are not yet SL friends: Code cleanup --- indra/newview/llpanelpeople.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 56523773b8..b9afe10d84 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1663,7 +1663,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) model_index = 1; } - //Add to folder view + //Add to person tab model LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); if(person_tab_model) { -- cgit v1.2.3 From c451672ee7e3bc8229a3e5cba544c93495147024 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 14:22:46 -0700 Subject: ACME-338 Hide info button for FB only friends: Upon hover of FB only friends the info button and profile button are hidden. --- indra/newview/llpanelpeople.cpp | 16 ++++++++-------- indra/newview/llpersonfolderview.cpp | 19 +++++++++---------- indra/newview/llpersonfolderview.h | 16 ++++++++-------- indra/newview/llpersonmodelcommon.cpp | 5 +++-- indra/newview/llpersonmodelcommon.h | 10 +++++++++- indra/newview/llpersontabview.cpp | 20 +++++++++++++++----- indra/newview/llpersontabview.h | 8 +++++--- 7 files changed, 57 insertions(+), 37 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b9afe10d84..f7492a51e1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1641,7 +1641,7 @@ void LLPanelPeople::openFacebookWeb(std::string url) void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); - S32 model_index; + LLPersonTabModel::tab_type tab_type; LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) @@ -1655,16 +1655,16 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) //FB+SL but not SL friend if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) { - model_index = 0; + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; } //FB only friend else { - model_index = 1; + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; } //Add to person tab model - LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); if(person_tab_model) { addParticipantToModel(person_tab_model, agent_id, name); @@ -1679,24 +1679,24 @@ void LLPanelPeople::addTestParticipant() LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; - S32 model_index; + LLPersonTabModel::tab_type tab_type; for(int i = 0; i < 300; ++i) { //Adds FB+SL people that aren't yet SL friends if(i < 10) { - model_index = 0; + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; agentID = gAgent.getID(); } //Adds FB only friends else { - model_index = 1; + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; agentID = LLUUID(NULL); } - person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); + person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); name = prefix + " " + suffix; addParticipantToModel(person_tab_model, agentID, name); // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 191c7d5bcd..c22e4f3e58 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -30,7 +30,6 @@ #include "llpersonfolderview.h" #include "llpersontabview.h" -#include "llpersonmodelcommon.h" LLPersonFolderView::LLPersonFolderView(const Params &p) : @@ -76,14 +75,14 @@ BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) void LLPersonFolderView::createPersonTabs() { - createPersonTab("SL residents you may want to friend"); - createPersonTab("Invite people you know to SL"); + createPersonTab(LLPersonTabModel::FB_SL_NON_SL_FRIEND, "SL residents you may want to friend"); + createPersonTab(LLPersonTabModel::FB_ONLY_FRIEND, "Invite people you know to SL"); } -void LLPersonFolderView::createPersonTab(const std::string& tab_name) +void LLPersonFolderView::createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name) { //Create a person tab - LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); + LLPersonTabModel* item = new LLPersonTabModel(tab_type, tab_name, *mViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); params.root = this; @@ -92,7 +91,7 @@ void LLPersonFolderView::createPersonTab(const std::string& tab_name) LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(this); - mIndexToFolderVec.push_back(item->getID()); + mIndexToFolderMap[tab_type] = item->getID(); mPersonFolderModelMap[item->getID()] = item; mPersonFolderViewMap[item->getID()] = widget; } @@ -138,12 +137,12 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod return LLUICtrlFactory::create(params); } -LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(const S32 index) +LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type) { - return mPersonFolderModelMap[mIndexToFolderVec[index]]; + return mPersonFolderModelMap[mIndexToFolderMap[tab_type]]; } -LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(const S32 index) +LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type) { - return mPersonFolderViewMap[mIndexToFolderVec[index]]; + return mPersonFolderViewMap[mIndexToFolderMap[tab_type]]; } diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 3a15f59164..85dec6515d 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -27,7 +27,10 @@ #ifndef LL_LLPERSONFOLDERVIEW_H #define LL_LLPERSONFOLDERVIEW_H -class LLPersonTabModel; +#include "llevents.h" +#include "llfolderview.h" +#include "llpersonmodelcommon.h" + class LLPersonTabView; class LLPersonView; class LLPersonModel; @@ -35,9 +38,6 @@ class LLPersonModel; typedef std::map person_folder_model_map; typedef std::map person_folder_view_map; -#include "llevents.h" -#include "llfolderview.h" - class LLPersonFolderView : public LLFolderView { public: @@ -53,16 +53,16 @@ public: BOOL handleMouseDown( S32 x, S32 y, MASK mask ); void createPersonTabs(); - void createPersonTab(const std::string& tab_name); + void createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name); bool onConversationModelEvent(const LLSD &event); LLPersonView * createConversationViewParticipant(LLPersonModel * item); - LLPersonTabModel * getPersonTabModelByIndex(const S32 index); - LLPersonTabView * getPersonTabViewByIndex(const S32 index); + LLPersonTabModel * getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type); + LLPersonTabView * getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type); person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; - std::vector mIndexToFolderVec; + std::map mIndexToFolderMap; LLEventStream mConversationsEventStream; }; diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 6b4c71faa2..70a24ac77a 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -132,8 +132,9 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) // LLPersonTabModel // -LLPersonTabModel::LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(display_name,root_view_model) +LLPersonTabModel::LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(display_name,root_view_model), +mTabType(tab_type) { } diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index f44f619d18..7be3387564 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -108,7 +108,13 @@ protected: class LLPersonTabModel : public LLPersonModelCommon { public: - LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model); + enum tab_type + { + FB_SL_NON_SL_FRIEND, + FB_ONLY_FRIEND, + }; + + LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model); LLPersonTabModel(LLFolderViewModelInterface& root_view_model); LLPointer getIcon() const { return NULL; } @@ -118,6 +124,8 @@ public: void clearParticipants(); LLPersonModel* findParticipant(const LLUUID& person_id); + tab_type mTabType; + private: }; diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index fdc024beb8..0dfd53705b 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -160,8 +160,10 @@ S32 LLPersonView::getLabelXPos() void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) { LLFolderViewItem::addToFolder(person_folder_view); - //Added item to folder, could change folder's mHasVisibleChildren flag so call arrange + //Added item to folder could change folder's mHasVisibleChildren flag so call arrange person_folder_view->requestArrange(); + + mPersonTabModel = static_cast(getParentFolder()->getViewModelItem()); } LLPersonView::~LLPersonView() @@ -191,16 +193,24 @@ BOOL LLPersonView::postBuild() void LLPersonView::onMouseEnter(S32 x, S32 y, MASK mask) { - mInfoBtn->setVisible(TRUE); - mProfileBtn->setVisible(TRUE); + if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) + { + mInfoBtn->setVisible(TRUE); + mProfileBtn->setVisible(TRUE); + } + updateChildren(); LLFolderViewItem::onMouseEnter(x, y, mask); } void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask) { - mInfoBtn->setVisible(FALSE); - mProfileBtn->setVisible(FALSE); + if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) + { + mInfoBtn->setVisible(FALSE); + mProfileBtn->setVisible(FALSE); + } + updateChildren(); LLFolderViewItem::onMouseLeave(x, y, mask); } diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 9cce615167..9e5fdc3057 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -33,6 +33,8 @@ #include "lloutputmonitorctrl.h" #include "lltextbox.h" +class LLPersonTabModel; + class LLPersonTabView : public LLFolderViewFolder { @@ -104,9 +106,11 @@ protected: private: + //Short-cut to tab model + LLPersonTabModel * mPersonTabModel; + LLPointer mImageOver; LLPointer mImageSelected; - LLAvatarIconCtrl* mAvatarIcon; LLTextBox * mLastInteractionTimeTextbox; LLIconCtrl * mPermissionEditTheirsIcon; @@ -117,8 +121,6 @@ private: LLButton * mProfileBtn; LLOutputMonitorCtrl * mOutputMonitorCtrl; - - typedef enum e_avatar_item_child { ALIC_SPEAKER_INDICATOR, ALIC_PROFILE_BUTTON, -- cgit v1.2.3 From 04587bdb9d5e1653d5b19a6ca51e547180994958 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 17:53:18 -0700 Subject: ACME-340 Get facebook icon from spec and add to viewer: Added a facebook icon and the icon appears only for the 'Invite people you know to SL' tab. --- indra/newview/llpersontabview.cpp | 33 +++++++++++++++++++-- indra/newview/llpersontabview.h | 2 ++ .../skins/default/textures/icons/Facebook.png | Bin 0 -> 365 bytes indra/newview/skins/default/textures/textures.xml | 2 ++ .../skins/default/xui/en/widgets/person_view.xml | 12 ++++++++ 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Facebook.png diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 0dfd53705b..6aa51febcb 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -125,6 +125,7 @@ bool LLPersonView::sChildrenWidthsInitialized = false; ChildWidthVec LLPersonView::mChildWidthVec; LLPersonView::Params::Params() : +facebook_icon("facebook_icon"), avatar_icon("avatar_icon"), last_interaction_time_textbox("last_interaction_time_textbox"), permission_edit_theirs_icon("permission_edit_theirs_icon"), @@ -140,6 +141,7 @@ LLPersonView::LLPersonView(const LLPersonView::Params& p) : LLFolderViewItem(p), mImageOver(LLUI::getUIImage("ListItem_Over")), mImageSelected(LLUI::getUIImage("ListItem_Select")), +mFacebookIcon(NULL), mAvatarIcon(NULL), mLastInteractionTimeTextbox(NULL), mPermissionEditTheirsIcon(NULL), @@ -154,7 +156,19 @@ mOutputMonitorCtrl(NULL) S32 LLPersonView::getLabelXPos() { - return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; + S32 label_x_pos; + + if(mAvatarIcon->getVisible()) + { + label_x_pos = getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; + } + else + { + label_x_pos = getIndentation() + mFacebookIcon->getRect().getWidth() + mIconPad; + } + + + return label_x_pos; } void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) @@ -164,6 +178,16 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) person_folder_view->requestArrange(); mPersonTabModel = static_cast(getParentFolder()->getViewModelItem()); + + if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) + { + mAvatarIcon->setVisible(TRUE); + } + else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND) + { + mFacebookIcon->setVisible(TRUE); + } + } LLPersonView::~LLPersonView() @@ -295,11 +319,16 @@ void LLPersonView::drawHighlight() void LLPersonView::initFromParams(const LLPersonView::Params & params) { + LLIconCtrl::Params facebook_icon_params(params.facebook_icon()); + applyXUILayout(facebook_icon_params, this); + mFacebookIcon = LLUICtrlFactory::create(facebook_icon_params); + addChild(mFacebookIcon); + LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon()); applyXUILayout(avatar_icon_params, this); mAvatarIcon = LLUICtrlFactory::create(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(last_interaction_time_textbox); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 9e5fdc3057..9839a1eaaf 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -77,6 +77,7 @@ public: struct Params : public LLInitParam::Block { Params(); + Optional facebook_icon; Optional avatar_icon; Optional last_interaction_time_textbox; Optional permission_edit_theirs_icon; @@ -111,6 +112,7 @@ private: LLPointer mImageOver; LLPointer mImageSelected; + LLIconCtrl * mFacebookIcon; LLAvatarIconCtrl* mAvatarIcon; LLTextBox * mLastInteractionTimeTextbox; LLIconCtrl * mPermissionEditTheirsIcon; diff --git a/indra/newview/skins/default/textures/icons/Facebook.png b/indra/newview/skins/default/textures/icons/Facebook.png new file mode 100644 index 0000000000..8287d56f88 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Facebook.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 5b17ef94db..18146943a5 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -199,6 +199,8 @@ with the same filename but different name + + 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 4a39109f36..006437401c 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -13,6 +13,17 @@ text_pad_right="4" arrow_size="10" max_folder_item_overlap="2"> +