Skip to content
Snippets Groups Projects
Commit 8c64fbf1 authored by Merov Linden's avatar Merov Linden
Browse files

CHUI-468 : WIP : More cleanup and fix of the participants sorting in LLIMConversation

parent 2abe0fea
No related branches found
No related tags found
No related merge requests found
...@@ -166,7 +166,8 @@ void LLIMConversation::addToHost(const LLUUID& session_id) ...@@ -166,7 +166,8 @@ void LLIMConversation::addToHost(const LLUUID& session_id)
conversp->setHost(floater_container); conversp->setHost(floater_container);
conversp->setHost(NULL); conversp->setHost(NULL);
} }
// Added floaters share some state (like sort order) with their host
conversp->setSortOrder(floater_container->getSortOrder());
} }
} }
} }
...@@ -483,22 +484,11 @@ LLConversationViewParticipant* LLIMConversation::createConversationViewParticipa ...@@ -483,22 +484,11 @@ LLConversationViewParticipant* LLIMConversation::createConversationViewParticipa
return LLUICtrlFactory::create<LLConversationViewParticipant>(params); return LLUICtrlFactory::create<LLConversationViewParticipant>(params);
} }
void LLIMConversation::onSortMenuItemClicked(const LLSD& userdata) void LLIMConversation::setSortOrder(const LLConversationSort& order)
{ {
// *TODO: Check this code when sort order menu will be added. (EM) mConversationViewModel.setSorter(order);
/* mConversationsRoot->arrangeAll();
if (!getParticipantList()) refreshConversation();
{
return;
}
std::string chosen_item = userdata.asString();
if (chosen_item == "sort_name")
{
getParticipantList()->setSortOrder(LLParticipantList::E_SORT_BY_NAME);
}
*/
} }
void LLIMConversation::onIMSessionMenuItemClicked(const LLSD& userdata) void LLIMConversation::onIMSessionMenuItemClicked(const LLSD& userdata)
......
...@@ -89,7 +89,8 @@ class LLIMConversation ...@@ -89,7 +89,8 @@ class LLIMConversation
void refreshConversation(); void refreshConversation();
void buildConversationViewParticipant(); void buildConversationViewParticipant();
void setSortOrder(const LLConversationSort& order);
protected: protected:
// callback for click on any items of the visual states menu // callback for click on any items of the visual states menu
...@@ -107,8 +108,6 @@ class LLIMConversation ...@@ -107,8 +108,6 @@ class LLIMConversation
// refresh a visual state of the Call button // refresh a visual state of the Call button
void updateCallBtnState(bool callIsActive); void updateCallBtnState(bool callIsActive);
void onSortMenuItemClicked(const LLSD& userdata);
void hideOrShowTitle(); // toggle the floater's drag handle void hideOrShowTitle(); // toggle the floater's drag handle
void hideAllStandardButtons(); void hideAllStandardButtons();
......
...@@ -764,6 +764,19 @@ void LLIMFloaterContainer::setSortOrder(const LLConversationSort& order) ...@@ -764,6 +764,19 @@ void LLIMFloaterContainer::setSortOrder(const LLConversationSort& order)
mConversationsRoot->arrangeAll(); mConversationsRoot->arrangeAll();
// try to keep selection onscreen, even if it wasn't to start with // try to keep selection onscreen, even if it wasn't to start with
mConversationsRoot->scrollToShowSelection(); mConversationsRoot->scrollToShowSelection();
// Notify all conversation (torn off or not) of the change to the sort order
// Note: For the moment, the sort order is *unique* across all conversations. That might change in the future.
for (conversations_items_map::iterator it_session = mConversationsItems.begin(); it_session != mConversationsItems.end(); it_session++)
{
LLUUID session_id = it_session->first;
LLIMConversation *conversation_floater = (session_id.isNull() ? (LLIMConversation*)(LLFloaterReg::findTypedInstance<LLNearbyChat>("nearby_chat")) : (LLIMConversation*)(LLIMFloater::findInstance(session_id)));
if (conversation_floater)
{
conversation_floater->setSortOrder(order);
}
}
gSavedSettings.setU32("ConversationSortOrder", (U32)order); gSavedSettings.setU32("ConversationSortOrder", (U32)order);
} }
......
...@@ -92,6 +92,7 @@ class LLIMFloaterContainer ...@@ -92,6 +92,7 @@ class LLIMFloaterContainer
LLUUID getSelectedSession() { return mSelectedSession; } LLUUID getSelectedSession() { return mSelectedSession; }
void setSelectedSession(LLUUID sessionID) { mSelectedSession = sessionID; } void setSelectedSession(LLUUID sessionID) { mSelectedSession = sessionID; }
LLConversationItem* getSessionModel(const LLUUID& session_id) { return get_ptr_in_map(mConversationsItems,session_id); } LLConversationItem* getSessionModel(const LLUUID& session_id) { return get_ptr_in_map(mConversationsItems,session_id); }
LLConversationSort& getSortOrder() { return mConversationViewModel.getSorter(); }
private: private:
typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t; typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t;
......
...@@ -302,15 +302,6 @@ LLParticipantList::~LLParticipantList() ...@@ -302,15 +302,6 @@ LLParticipantList::~LLParticipantList()
delete mAvalineUpdater; delete mAvalineUpdater;
} }
/*
void LLParticipantList::setSpeakingIndicatorsVisible(BOOL visible)
{
if (mAvatarList)
{
mAvatarList->setSpeakingIndicatorsVisible(visible);
}
}
*/
/* /*
void LLParticipantList::onAvatarListDoubleClicked(LLUICtrl* ctrl) void LLParticipantList::onAvatarListDoubleClicked(LLUICtrl* ctrl)
{ {
......
...@@ -49,7 +49,6 @@ class LLParticipantList : public LLConversationItemSession ...@@ -49,7 +49,6 @@ class LLParticipantList : public LLConversationItemSession
bool exclude_agent = true, bool exclude_agent = true,
bool can_toggle_icons = true); bool can_toggle_icons = true);
~LLParticipantList(); ~LLParticipantList();
// void setSpeakingIndicatorsVisible(BOOL visible);
enum EParticipantSortOrder enum EParticipantSortOrder
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment