diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-05-06 11:31:22 -0700 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-05-06 11:31:22 -0700 |
commit | e30c0925f517b18830b7a4d520246acd98981ab3 (patch) | |
tree | 90fa81816cd4a03892ce2646360897f601375daf /indra/newview/llpersonfolderview.cpp | |
parent | cca67a38d89da30d2b36690d91eb00cac04384bd (diff) |
ACME-326 Populate the list with FB users who use SL but are not yet SL friends: Code cleanup
Diffstat (limited to 'indra/newview/llpersonfolderview.cpp')
-rw-r--r-- | indra/newview/llpersonfolderview.cpp | 68 |
1 files changed, 39 insertions, 29 deletions
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<LLPersonTabView>(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<LLPersonTabView>(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<LLPersonTabModel *>(mPersonFolderModelMap[folder_id]); - LLPersonTabView * person_folder_view = dynamic_cast<LLPersonTabView *>(mPersonFolderViewMap[folder_id]); + LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderModelMap[folder_id]); + LLPersonTabView * person_tab_view = dynamic_cast<LLPersonTabView *>(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<LLPersonView>(params); } + +LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(const S32 index) +{ + return mPersonFolderModelMap[mIndexToFolderVec[index]]; +} + +LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(const S32 index) +{ + return mPersonFolderViewMap[mIndexToFolderVec[index]]; +} |