Commit 25c21d87 authored by Cinder's avatar Cinder
Browse files

Fix for chat focus bug

parent cd7de404
...@@ -72,12 +72,12 @@ LLFloaterIMContainer::LLFloaterIMContainer(const LLSD& seed, const Params& param ...@@ -72,12 +72,12 @@ LLFloaterIMContainer::LLFloaterIMContainer(const LLSD& seed, const Params& param
mMessagesPane(nullptr), mMessagesPane(nullptr),
mConversationsPane(nullptr), mConversationsPane(nullptr),
mConversationsStack(nullptr), mConversationsStack(nullptr),
mConversationsListPanel(nullptr),
mConversationsRoot(nullptr),
mConversationsEventStream("ConversationsEvents"),
mInitialized(false), mInitialized(false),
mIsFirstLaunch(true), mIsFirstLaunch(true),
mIsFirstOpen(true) mIsFirstOpen(true),
mConversationsListPanel(nullptr),
mConversationsRoot(nullptr),
mConversationsEventStream("ConversationsEvents")
{ {
mEnableCallbackRegistrar.add("IMFloaterContainer.Check", boost::bind(&LLFloaterIMContainer::isActionChecked, this, _2)); mEnableCallbackRegistrar.add("IMFloaterContainer.Check", boost::bind(&LLFloaterIMContainer::isActionChecked, this, _2));
mCommitCallbackRegistrar.add("IMFloaterContainer.Action", boost::bind(&LLFloaterIMContainer::onCustomAction, this, _2)); mCommitCallbackRegistrar.add("IMFloaterContainer.Action", boost::bind(&LLFloaterIMContainer::onCustomAction, this, _2));
...@@ -160,6 +160,7 @@ void LLFloaterIMContainer::sessionIDUpdated(const LLUUID& old_session_id, const ...@@ -160,6 +160,7 @@ void LLFloaterIMContainer::sessionIDUpdated(const LLUUID& old_session_id, const
void LLFloaterIMContainer::sessionRemoved(const LLUUID& session_id) void LLFloaterIMContainer::sessionRemoved(const LLUUID& session_id)
{ {
removeConversationListItem(session_id); removeConversationListItem(session_id);
} }
...@@ -556,7 +557,7 @@ void LLFloaterIMContainer::draw() ...@@ -556,7 +557,7 @@ void LLFloaterIMContainer::draw()
participant_model->setModeratorOptionsVisible(isGroupModerator() && participant_model->getUUID() != gAgentID); participant_model->setModeratorOptionsVisible(isGroupModerator() && participant_model->getUUID() != gAgentID);
participant_model->setGroupBanVisible(haveAbilityToBan() && participant_model->getUUID() != gAgentID); participant_model->setGroupBanVisible(haveAbilityToBan() && participant_model->getUUID() != gAgentID);
current_participant_model++; ++current_participant_model;
} }
// Update floater's title as required by the currently selected session or use the default title // Update floater's title as required by the currently selected session or use the default title
LLFloaterIMSession* conversation_floaterp = LLFloaterIMSession::findInstance(current_session->getUUID()); LLFloaterIMSession* conversation_floaterp = LLFloaterIMSession::findInstance(current_session->getUUID());
...@@ -650,7 +651,7 @@ void LLFloaterIMContainer::setVisible(BOOL visible) ...@@ -650,7 +651,7 @@ void LLFloaterIMContainer::setVisible(BOOL visible)
{ {
// Make sure we have the Nearby Chat present when showing the conversation container // Make sure we have the Nearby Chat present when showing the conversation container
nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"); nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat");
if ((nearby_chat == nullptr) || mIsFirstOpen) if (nearby_chat == nullptr || mIsFirstOpen)
{ {
mIsFirstOpen = false; mIsFirstOpen = false;
// If not found, force the creation of the nearby chat conversation panel // If not found, force the creation of the nearby chat conversation panel
...@@ -1067,7 +1068,7 @@ void LLFloaterIMContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids, bool par ...@@ -1067,7 +1068,7 @@ void LLFloaterIMContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids, bool par
} }
} }
const LLConversationItem* LLFloaterIMContainer::getCurSelectedViewModelItem() const LLConversationItem* LLFloaterIMContainer::getCurSelectedViewModelItem() const
{ {
LLConversationItem* conversation_item = nullptr; LLConversationItem* conversation_item = nullptr;
...@@ -1763,7 +1764,7 @@ LLConversationItem* LLFloaterIMContainer::addConversationListItem(const LLUUID& ...@@ -1763,7 +1764,7 @@ LLConversationItem* LLFloaterIMContainer::addConversationListItem(const LLUUID&
LLConversationItem* participant_model = dynamic_cast<LLConversationItem*>(*current_participant_model); LLConversationItem* participant_model = dynamic_cast<LLConversationItem*>(*current_participant_model);
LLConversationViewParticipant* participant_view = createConversationViewParticipant(participant_model); LLConversationViewParticipant* participant_view = createConversationViewParticipant(participant_model);
participant_view->addToFolder(widget); participant_view->addToFolder(widget);
current_participant_model++; ++current_participant_model;
} }
} }
...@@ -1794,7 +1795,7 @@ LLConversationItem* LLFloaterIMContainer::addConversationListItem(const LLUUID& ...@@ -1794,7 +1795,7 @@ LLConversationItem* LLFloaterIMContainer::addConversationListItem(const LLUUID&
return item; return item;
} }
bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool change_focus) bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid)
{ {
// Delete the widget and the associated conversation item // Delete the widget and the associated conversation item
// Note : since the mConversationsItems is also the listener to the widget, deleting // Note : since the mConversationsItems is also the listener to the widget, deleting
...@@ -1817,8 +1818,9 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c ...@@ -1817,8 +1818,9 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c
mConversationsItems.erase(uuid); mConversationsItems.erase(uuid);
mConversationsWidgets.erase(uuid); mConversationsWidgets.erase(uuid);
// Don't let the focus fall IW, select and refocus on the first conversation in the list // Don't let the focus fall inworld if we had focus on the convo,
if (change_focus) // select and refocus on the first conversation in the list
if (is_widget_selected)
{ {
setFocus(TRUE); setFocus(TRUE);
if (new_selection) if (new_selection)
...@@ -2114,7 +2116,7 @@ LLSpeakerMgr* LLFloaterIMContainer::getSpeakerMgrForSelectedParticipant() ...@@ -2114,7 +2116,7 @@ LLSpeakerMgr* LLFloaterIMContainer::getSpeakerMgrForSelectedParticipant()
: LLIMModel::getInstance()->getSpeakerManager(*conversation_uuidp); : LLIMModel::getInstance()->getSpeakerManager(*conversation_uuidp);
} }
LLSpeaker* LLFloaterIMContainer::getSpeakerOfSelectedParticipant(LLSpeakerMgr* speaker_managerp) LLSpeaker* LLFloaterIMContainer::getSpeakerOfSelectedParticipant(LLSpeakerMgr* speaker_managerp) const
{ {
if (speaker_managerp == nullptr) if (speaker_managerp == nullptr)
{ {
...@@ -2305,7 +2307,7 @@ void LLFloaterIMContainer::expandConversation() ...@@ -2305,7 +2307,7 @@ void LLFloaterIMContainer::expandConversation()
} }
} }
bool LLFloaterIMContainer::isParticipantListExpanded() bool LLFloaterIMContainer::isParticipantListExpanded() const
{ {
bool is_expanded = false; bool is_expanded = false;
if (!mConversationsPane->isCollapsed()) if (!mConversationsPane->isCollapsed())
......
...@@ -151,7 +151,7 @@ private: ...@@ -151,7 +151,7 @@ private:
void setSortOrder(const LLConversationSort& order); void setSortOrder(const LLConversationSort& order);
void getSelectedUUIDs(uuid_vec_t& selected_uuids, bool participant_uuids = true) const; void getSelectedUUIDs(uuid_vec_t& selected_uuids, bool participant_uuids = true) const;
const LLConversationItem * getCurSelectedViewModelItem(); const LLConversationItem * getCurSelectedViewModelItem() const;
void getParticipantUUIDs(uuid_vec_t& selected_uuids); void getParticipantUUIDs(uuid_vec_t& selected_uuids);
void doToSelected(const LLSD& userdata); void doToSelected(const LLSD& userdata);
bool checkContextMenuItem(const LLSD& userdata); bool checkContextMenuItem(const LLSD& userdata);
...@@ -162,7 +162,7 @@ private: ...@@ -162,7 +162,7 @@ private:
static void confirmMuteAllCallback(const LLSD& notification, const LLSD& response); static void confirmMuteAllCallback(const LLSD& notification, const LLSD& response);
bool enableModerateContextMenuItem(const std::string& userdata); bool enableModerateContextMenuItem(const std::string& userdata);
LLSpeaker * getSpeakerOfSelectedParticipant(LLSpeakerMgr * speaker_managerp); LLSpeaker * getSpeakerOfSelectedParticipant(LLSpeakerMgr * speaker_managerp) const;
LLSpeakerMgr * getSpeakerMgrForSelectedParticipant(); LLSpeakerMgr * getSpeakerMgrForSelectedParticipant();
bool isGroupModerator(); bool isGroupModerator();
bool haveAbilityToBan(); bool haveAbilityToBan();
...@@ -174,7 +174,7 @@ private: ...@@ -174,7 +174,7 @@ private:
void toggleAllowTextChat(const LLUUID& participant_uuid); void toggleAllowTextChat(const LLUUID& participant_uuid);
void toggleMute(const LLUUID& participant_id, U32 flags); void toggleMute(const LLUUID& participant_id, U32 flags);
void banSelectedMember(const LLUUID& participant_uuid); void banSelectedMember(const LLUUID& participant_uuid);
bool isParticipantListExpanded(); bool isParticipantListExpanded() const;
LLButton* mExpandCollapseBtn; LLButton* mExpandCollapseBtn;
LLButton* mStubCollapseBtn; LLButton* mStubCollapseBtn;
...@@ -195,7 +195,7 @@ private: ...@@ -195,7 +195,7 @@ private:
// Conversation list implementation // Conversation list implementation
public: public:
bool removeConversationListItem(const LLUUID& uuid, bool change_focus = true); bool removeConversationListItem(const LLUUID& uuid);
LLConversationItem* addConversationListItem(const LLUUID& uuid, bool isWidgetSelected = false); LLConversationItem* addConversationListItem(const LLUUID& uuid, bool isWidgetSelected = false);
void setTimeNow(const LLUUID& session_id, const LLUUID& participant_id); void setTimeNow(const LLUUID& session_id, const LLUUID& participant_id);
void setNearbyDistances(); void setNearbyDistances();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment