From 4a25ce8b9d5d56b160d0d13c4681cd916c4ea4e0 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 2 Oct 2012 22:34:44 -0700 Subject: CHUI-341 : Implement the use of LLEventStream and LLEventPump to signal conversation model changes, picked by LLIMFloaterContainer. Suppress pooling on draw(). --- indra/newview/llconversationmodel.cpp | 16 +++++++++++++ indra/newview/llconversationmodel.h | 2 ++ indra/newview/llimfloatercontainer.cpp | 41 +++++++++++++++++++++++++--------- indra/newview/llimfloatercontainer.h | 3 +++ 4 files changed, 52 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 9fa8758d11..1057dbaf31 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" +#include "llevents.h" #include "llconversationmodel.h" // @@ -63,6 +64,18 @@ LLConversationItem::LLConversationItem(LLFolderViewModelInterface& root_view_mod { } +void LLConversationItem::postEvent(const std::string& event_type) +{ + LLSD event; + event["pump"] = "ConversationModelEvent"; + LLSD payload; + payload["type"] = event_type; + payload["name"] = getName(); + payload["uuid"] = getUUID(); + event["payload"] = payload; + LLEventPumps::instance().obtain("ConversationsEvents").post(event); +} + // Virtual action callbacks void LLConversationItem::performAction(LLInventoryModel* model, std::string action) { @@ -111,12 +124,14 @@ void LLConversationItemSession::addParticipant(LLConversationItemParticipant* pa addChild(participant); mIsLoaded = true; mNeedsRefresh = true; + postEvent("add_participant"); } void LLConversationItemSession::removeParticipant(LLConversationItemParticipant* participant) { removeChild(participant); mNeedsRefresh = true; + postEvent("remove_participant"); } void LLConversationItemSession::removeParticipant(const LLUUID& participant_id) @@ -254,6 +269,7 @@ void LLConversationItemParticipant::onAvatarNameCache(const LLAvatarName& av_nam mName = (av_name.mUsername.empty() ? av_name.mDisplayName : av_name.mUsername); mDisplayName = (av_name.mDisplayName.empty() ? av_name.mUsername : av_name.mDisplayName); mNeedsRefresh = true; + postEvent("update_participant"); if (mParent) { mParent->requestSort(); diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 30f94d51ae..97e5b0fc31 100755 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -124,6 +124,8 @@ public: void resetRefresh() { mNeedsRefresh = false; } bool needsRefresh() { return mNeedsRefresh; } + void postEvent(const std::string& event_type); + protected: std::string mName; // Name of the session or the participant LLUUID mUUID; // UUID of the session or the participant diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 6f7eb7822a..8642eaf5e1 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -49,6 +49,7 @@ #include "llcallbacklist.h" #include "llworld.h" +#include "llsdserialize.h" // // LLIMFloaterContainer // @@ -56,6 +57,7 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed) : LLMultiFloater(seed), mExpandCollapseBtn(NULL), mConversationsRoot(NULL), + mStream("ConversationsEvents"), mInitialized(false) { mCommitCallbackRegistrar.add("IMFloaterContainer.Action", boost::bind(&LLIMFloaterContainer::onCustomAction, this, _2)); @@ -136,6 +138,9 @@ BOOL LLIMFloaterContainer::postBuild() p.use_ellipses = true; mConversationsRoot = LLUICtrlFactory::create(p); + // Add listener to conversation model events + mStream.listen("ConversationsRefresh", boost::bind(&LLIMFloaterContainer::onConversationModelEvent, this, _1)); + // a scroller for folder view LLRect scroller_view_rect = mConversationsListPanel->getRect(); scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); @@ -378,18 +383,29 @@ void LLIMFloaterContainer::idle(void* user_data) self->mConversationsRoot->update(); } -void LLIMFloaterContainer::draw() +bool LLIMFloaterContainer::onConversationModelEvent(const LLSD& event) { - // CHUI Notes - // Currently, the model is not responsible for creating the view which is a good thing. This means that + // For debug only + //std::ostringstream llsd_value; + //llsd_value << LLSDOStreamer(event) << std::endl; + //llinfos << "Merov debug : onConversationModelEvent, event = " << llsd_value.str() << llendl; + // end debug + + // Note: In conversations, the model is not responsible for creating the view which is a good thing. This means that // the model could change substantially and the view could decide to echo only a portion of this model. // Consequently, the participant views need to be created either by the session view or by the container panel. - // For the moment, we create them here (which makes for complicated code...) to conform to the pattern - // implemented in llinventorypanel.cpp (see LLInventoryPanel::buildNewViews()). - // The best however would be to have an observer on the model so that we would not pool on each draw to know - // if the view needs refresh. The current implementation (testing for change on draw) is less - // efficient perf wise than a listener/observer scheme. We will implement that shortly. - + // For the moment, we create them here to conform to the pattern implemented in llinventorypanel.cpp + // (see LLInventoryPanel::buildNewViews()). + + // Note: For the moment, we're not very smart about the event paramter and we just refresh the whole set of views/widgets + // according to the current state of the whole model. + // We should at least analyze the event payload and do things differently for a handful of useful cases: + // - add session or participant + // - remove session or participant + // - update session or participant (e.g. rename, change sort order, etc...) + // see LLConversationItem::postEvent() for the payload formatting. + // *TODO: Add handling for various event signatures (add, remove, update, resort) + // On each session in mConversationsItems for (conversations_items_map::iterator it_session = mConversationsItems.begin(); it_session != mConversationsItems.end(); it_session++) { @@ -418,7 +434,7 @@ void LLIMFloaterContainer::draw() participant_view->setVisible(TRUE); } else - // Else, see if it needs refresh + // Else, see if it needs refresh { if (participant_model->needsRefresh()) { @@ -434,6 +450,11 @@ void LLIMFloaterContainer::draw() } } + return false; +} + +void LLIMFloaterContainer::draw() +{ if (mTabContainer->getTabCount() == 0) { // Do not close the container when every conversation is torn off because the user diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 2debc2455b..8e953025bc 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -31,6 +31,7 @@ #include #include "llimview.h" +#include "llevents.h" #include "llfloater.h" #include "llmultifloater.h" #include "llavatarpropertiesprocessor.h" @@ -130,6 +131,7 @@ public: private: LLConversationViewSession* createConversationItemWidget(LLConversationItem* item); LLConversationViewParticipant* createConversationViewParticipant(LLConversationItem* item); + bool onConversationModelEvent(const LLSD& event); // Conversation list data LLPanel* mConversationsListPanel; // This is the main widget we add conversation widget to @@ -137,6 +139,7 @@ private: conversations_widgets_map mConversationsWidgets; LLConversationViewModel mConversationViewModel; LLFolderView* mConversationsRoot; + LLEventStream mStream; }; #endif // LL_LLIMFLOATERCONTAINER_H -- cgit v1.2.3 From bd64c483639ae33518609398fce7c51ddc73dae7 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 3 Oct 2012 16:46:46 -0700 Subject: CHUI-358 : Fixed the removal of participants as they leave conversations. Used the event mechanism for this. --- indra/newview/llconversationmodel.cpp | 18 ++++++++---------- indra/newview/llconversationmodel.h | 2 +- indra/newview/llimfloatercontainer.cpp | 31 +++++++++++++++++++++++++------ 3 files changed, 34 insertions(+), 17 deletions(-) (limited to 'indra') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 1057dbaf31..7ddb725fb1 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -64,15 +64,13 @@ LLConversationItem::LLConversationItem(LLFolderViewModelInterface& root_view_mod { } -void LLConversationItem::postEvent(const std::string& event_type) +void LLConversationItem::postEvent(const std::string& event_type, LLConversationItemParticipant* participant) { LLSD event; - event["pump"] = "ConversationModelEvent"; - LLSD payload; - payload["type"] = event_type; - payload["name"] = getName(); - payload["uuid"] = getUUID(); - event["payload"] = payload; + event["type"] = event_type; + event["session_uuid"] = getUUID(); + event["participant_name"] = participant->getName(); + event["participant_uuid"] = participant->getUUID(); LLEventPumps::instance().obtain("ConversationsEvents").post(event); } @@ -124,14 +122,14 @@ void LLConversationItemSession::addParticipant(LLConversationItemParticipant* pa addChild(participant); mIsLoaded = true; mNeedsRefresh = true; - postEvent("add_participant"); + postEvent("add_participant", participant); } void LLConversationItemSession::removeParticipant(LLConversationItemParticipant* participant) { removeChild(participant); mNeedsRefresh = true; - postEvent("remove_participant"); + postEvent("remove_participant", participant); } void LLConversationItemSession::removeParticipant(const LLUUID& participant_id) @@ -269,7 +267,7 @@ void LLConversationItemParticipant::onAvatarNameCache(const LLAvatarName& av_nam mName = (av_name.mUsername.empty() ? av_name.mDisplayName : av_name.mUsername); mDisplayName = (av_name.mDisplayName.empty() ? av_name.mUsername : av_name.mDisplayName); mNeedsRefresh = true; - postEvent("update_participant"); + postEvent("update_participant", this); if (mParent) { mParent->requestSort(); diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 97e5b0fc31..32280f3293 100755 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -124,7 +124,7 @@ public: void resetRefresh() { mNeedsRefresh = false; } bool needsRefresh() { return mNeedsRefresh; } - void postEvent(const std::string& event_type); + void postEvent(const std::string& event_type, LLConversationItemParticipant* participant); protected: std::string mName; // Name of the session or the participant diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 8642eaf5e1..e58154b2a2 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -391,21 +391,39 @@ bool LLIMFloaterContainer::onConversationModelEvent(const LLSD& event) //llinfos << "Merov debug : onConversationModelEvent, event = " << llsd_value.str() << llendl; // end debug - // Note: In conversations, the model is not responsible for creating the view which is a good thing. This means that - // the model could change substantially and the view could decide to echo only a portion of this model. + // Note: In conversations, the model is not responsible for creating the view, which is a good thing. This means that + // the model could change substantially and the view could echo only a portion of this model (though currently the + // conversation view does echo the conversation model 1 to 1). // Consequently, the participant views need to be created either by the session view or by the container panel. - // For the moment, we create them here to conform to the pattern implemented in llinventorypanel.cpp + // For the moment, we create them here, at the container level, to conform to the pattern implemented in llinventorypanel.cpp // (see LLInventoryPanel::buildNewViews()). - // Note: For the moment, we're not very smart about the event paramter and we just refresh the whole set of views/widgets + // Note: For the moment, we're not very smart about the event parameter and we just refresh the whole set of views/widgets // according to the current state of the whole model. - // We should at least analyze the event payload and do things differently for a handful of useful cases: + // We should at least analyze the event payload and do things differently for a handful of cases: // - add session or participant // - remove session or participant // - update session or participant (e.g. rename, change sort order, etc...) - // see LLConversationItem::postEvent() for the payload formatting. + // Please see LLConversationItem::postEvent() for the payload formatting. // *TODO: Add handling for various event signatures (add, remove, update, resort) + std::string type = event.get("type").asString(); + if (type == "remove_participant") + { + LLUUID session_id = event.get("session_uuid").asUUID(); + LLConversationViewSession* session_view = dynamic_cast(mConversationsWidgets[session_id]); + LLUUID participant_id = event.get("participant_uuid").asUUID(); + LLConversationViewParticipant* participant_view = session_view->findParticipant(participant_id); + if (participant_view) + { + session_view->extractItem(participant_view); + delete participant_view; + session_view->refresh(); + mConversationsRoot->arrangeAll(); + } + } + else + { // On each session in mConversationsItems for (conversations_items_map::iterator it_session = mConversationsItems.begin(); it_session != mConversationsItems.end(); it_session++) { @@ -449,6 +467,7 @@ bool LLIMFloaterContainer::onConversationModelEvent(const LLSD& event) current_participant_model++; } } + } return false; } -- cgit v1.2.3 From 5d846e141464f02a1d896ffa82d639f973f8044b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 3 Oct 2012 19:06:33 -0700 Subject: CHUI-341 : Fixed. Took Nat's review comments into account. --- indra/newview/llconversationmodel.cpp | 7 ++----- indra/newview/llimfloatercontainer.cpp | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 0f29ffe77f..3c111c919a 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -28,6 +28,7 @@ #include "llviewerprecompiledheaders.h" #include "llevents.h" +#include "llsdutil.h" #include "llconversationmodel.h" #include "llimview.h" //For LLIMModel @@ -67,11 +68,7 @@ LLConversationItem::LLConversationItem(LLFolderViewModelInterface& root_view_mod void LLConversationItem::postEvent(const std::string& event_type, LLConversationItemParticipant* participant) { - LLSD event; - event["type"] = event_type; - event["session_uuid"] = getUUID(); - event["participant_name"] = participant->getName(); - event["participant_uuid"] = participant->getUUID(); + LLSD event(LLSDMap("type", event_type)("session_uuid", getUUID())("participant_name",participant->getName())("participant_uuid",participant->getUUID())); LLEventPumps::instance().obtain("ConversationsEvents").post(event); } diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 36c39f5717..78bd90fb96 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -79,6 +79,8 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed) LLIMFloaterContainer::~LLIMFloaterContainer() { + mStream.stopListening("ConversationsRefresh"); + gIdleCallbacks.deleteFunction(idle, this); mNewMessageConnection.disconnect(); -- cgit v1.2.3 From 8013e645603d1075b848ef91178af0fa3f9dc38c Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 4 Oct 2012 14:30:16 +0300 Subject: CHUI-313 FIXED "Conversations", "Conversations Log" menu items are added --- indra/newview/skins/default/xui/en/menu_viewer.xml | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 88b30c8272..c805b6db42 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -218,8 +218,18 @@ label="Communicate" name="Communicate" tear_off="true"> - + + + + @@ -243,6 +253,17 @@ function="Agent.ToggleMicrophone" parameter="speak" /> + + + + + Date: Thu, 4 Oct 2012 14:53:36 +0300 Subject: CHUI-327 FIXED Set "left" property for chat_history element --- indra/newview/skins/default/xui/en/floater_im_session.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 5c74f7f9bb..8cd0463de8 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -246,7 +246,7 @@ parse_highlights="true" parse_urls="true" width="230" - left="0"> + left="5"> -- cgit v1.2.3 From 06a7bd27cb07bd692d02604dcce735122456be6b Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Thu, 4 Oct 2012 17:13:10 +0300 Subject: CHUI-331 FIXED (Resizing conversation list when message panel is collapsed does not resize list) *fixed missing parentheses from last push --- indra/llui/lllayoutstack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index be6d359c9a..1f2496a8e7 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -767,7 +767,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& { // freeze new size as fraction F32 new_fractional_size = (updated_auto_resize_headroom == 0.f) ? MAX_FRACTIONAL_SIZE - : llclamp(total_visible_fraction * (F32)(new_dim - panelp->getRelevantMinDim() - 1) / updated_auto_resize_headroom, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE); + : llclamp(total_visible_fraction * (F32)(new_dim - (panelp->getRelevantMinDim() - 1)) / updated_auto_resize_headroom, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE); fraction_given_up -= new_fractional_size - panelp->mFractionalSize; fraction_remaining -= panelp->mFractionalSize; panelp->mFractionalSize = new_fractional_size; -- cgit v1.2.3 From f533a251553d95045ab7c1d37a149004cd1e2ef0 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 4 Oct 2012 20:36:04 -0700 Subject: CHUI-381 : Implement add_participant and update_participant events handling. --- indra/newview/llconversationmodel.cpp | 12 +++-- indra/newview/llconversationmodel.h | 2 +- indra/newview/llimfloatercontainer.cpp | 86 +++++++++++++--------------------- indra/newview/llimfloatercontainer.h | 2 +- 4 files changed, 42 insertions(+), 60 deletions(-) (limited to 'indra') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 3c111c919a..b2b768bf9a 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -66,9 +66,11 @@ LLConversationItem::LLConversationItem(LLFolderViewModelInterface& root_view_mod { } -void LLConversationItem::postEvent(const std::string& event_type, LLConversationItemParticipant* participant) +void LLConversationItem::postEvent(const std::string& event_type, LLConversationItemSession* session, LLConversationItemParticipant* participant) { - LLSD event(LLSDMap("type", event_type)("session_uuid", getUUID())("participant_name",participant->getName())("participant_uuid",participant->getUUID())); + LLUUID session_id = (session ? session->getUUID() : LLUUID()); + LLUUID participant_id = (participant ? participant->getUUID() : LLUUID()); + LLSD event(LLSDMap("type", event_type)("session_uuid", session_id)("participant_uuid", participant_id)); LLEventPumps::instance().obtain("ConversationsEvents").post(event); } @@ -138,14 +140,14 @@ void LLConversationItemSession::addParticipant(LLConversationItemParticipant* pa addChild(participant); mIsLoaded = true; mNeedsRefresh = true; - postEvent("add_participant", participant); + postEvent("add_participant", this, participant); } void LLConversationItemSession::removeParticipant(LLConversationItemParticipant* participant) { removeChild(participant); mNeedsRefresh = true; - postEvent("remove_participant", participant); + postEvent("remove_participant", this, participant); } void LLConversationItemSession::removeParticipant(const LLUUID& participant_id) @@ -338,11 +340,11 @@ void LLConversationItemParticipant::onAvatarNameCache(const LLAvatarName& av_nam mName = (av_name.mUsername.empty() ? av_name.mDisplayName : av_name.mUsername); mDisplayName = (av_name.mDisplayName.empty() ? av_name.mUsername : av_name.mDisplayName); mNeedsRefresh = true; - postEvent("update_participant", this); if (mParent) { mParent->requestSort(); } + postEvent("update_participant", dynamic_cast(mParent), this); } void LLConversationItemParticipant::dumpDebugData() diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 7218cdf25a..d5f7e1a56b 100755 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -126,7 +126,7 @@ public: void resetRefresh() { mNeedsRefresh = false; } bool needsRefresh() { return mNeedsRefresh; } - void postEvent(const std::string& event_type, LLConversationItemParticipant* participant); + void postEvent(const std::string& event_type, LLConversationItemSession* session, LLConversationItemParticipant* participant); void buildParticipantMenuOptions(menuentry_vec_t& items); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 78bd90fb96..4022ebdf5b 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -58,7 +58,7 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed) : LLMultiFloater(seed), mExpandCollapseBtn(NULL), mConversationsRoot(NULL), - mStream("ConversationsEvents"), + mConversationsEventStream("ConversationsEvents"), mInitialized(false) { mEnableCallbackRegistrar.add("IMFloaterContainer.Check", boost::bind(&LLIMFloaterContainer::isActionChecked, this, _2)); @@ -79,7 +79,7 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed) LLIMFloaterContainer::~LLIMFloaterContainer() { - mStream.stopListening("ConversationsRefresh"); + mConversationsEventStream.stopListening("ConversationsRefresh"); gIdleCallbacks.deleteFunction(idle, this); @@ -160,7 +160,7 @@ BOOL LLIMFloaterContainer::postBuild() mConversationsRoot->setCallbackRegistrar(&mCommitCallbackRegistrar); // Add listener to conversation model events - mStream.listen("ConversationsRefresh", boost::bind(&LLIMFloaterContainer::onConversationModelEvent, this, _1)); + mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLIMFloaterContainer::onConversationModelEvent, this, _1)); // a scroller for folder view LLRect scroller_view_rect = mConversationsListPanel->getRect(); @@ -419,22 +419,20 @@ bool LLIMFloaterContainer::onConversationModelEvent(const LLSD& event) // For the moment, we create them here, at the container level, to conform to the pattern implemented in llinventorypanel.cpp // (see LLInventoryPanel::buildNewViews()). - // Note: For the moment, we're not very smart about the event parameter and we just refresh the whole set of views/widgets - // according to the current state of the whole model. - // We should at least analyze the event payload and do things differently for a handful of cases: - // - add session or participant - // - remove session or participant - // - update session or participant (e.g. rename, change sort order, etc...) - // Please see LLConversationItem::postEvent() for the payload formatting. - // *TODO: Add handling for various event signatures (add, remove, update, resort) - std::string type = event.get("type").asString(); + LLUUID session_id = event.get("session_uuid").asUUID(); + LLUUID participant_id = event.get("participant_uuid").asUUID(); + + LLConversationViewSession* session_view = dynamic_cast(mConversationsWidgets[session_id]); + if (!session_view) + { + // We skip events that are not associated to a session + return false; + } + LLConversationViewParticipant* participant_view = session_view->findParticipant(participant_id); + if (type == "remove_participant") { - LLUUID session_id = event.get("session_uuid").asUUID(); - LLConversationViewSession* session_view = dynamic_cast(mConversationsWidgets[session_id]); - LLUUID participant_id = event.get("participant_uuid").asUUID(); - LLConversationViewParticipant* participant_view = session_view->findParticipant(participant_id); if (participant_view) { session_view->extractItem(participant_view); @@ -443,52 +441,34 @@ bool LLIMFloaterContainer::onConversationModelEvent(const LLSD& event) mConversationsRoot->arrangeAll(); } } - else - { - // On each session in mConversationsItems - for (conversations_items_map::iterator it_session = mConversationsItems.begin(); it_session != mConversationsItems.end(); it_session++) + else if (type == "add_participant") { - // Get the current session descriptors - LLConversationItem* session_model = it_session->second; - LLUUID session_id = it_session->first; - LLConversationViewSession* session_view = dynamic_cast(mConversationsWidgets[session_id]); - // If the session model has been changed, refresh the corresponding view - if (session_model->needsRefresh()) + if (!participant_view) { - session_view->refresh(); - } - // Iterate through each model participant child - LLFolderViewModelItemCommon::child_list_t::const_iterator current_participant_model = session_model->getChildrenBegin(); - LLFolderViewModelItemCommon::child_list_t::const_iterator end_participant_model = session_model->getChildrenEnd(); - while (current_participant_model != end_participant_model) - { - LLConversationItem* participant_model = dynamic_cast(*current_participant_model); - LLUUID participant_id = participant_model->getUUID(); - LLConversationViewParticipant* participant_view = session_view->findParticipant(participant_id); - // Is there a corresponding view? If not create it - if (!participant_view) - { - participant_view = createConversationViewParticipant(participant_model); - participant_view->addToFolder(session_view); - participant_view->setVisible(TRUE); - } - else - // Else, see if it needs refresh + LLConversationItemSession* session_model = dynamic_cast(mConversationsItems[session_id]); + if (session_model) { - if (participant_model->needsRefresh()) + LLConversationItemParticipant* participant_model = session_model->findParticipant(participant_id); + if (participant_model) { - participant_view->refresh(); + participant_view = createConversationViewParticipant(participant_model); + participant_view->addToFolder(session_view); + participant_view->setVisible(TRUE); } } - // Reset the need for refresh - session_model->resetRefresh(); - mConversationViewModel.requestSortAll(); - mConversationsRoot->arrangeAll(); - // Next participant - current_participant_model++; + } } + else if (type == "update_participant") + { + if (participant_view) + { + participant_view->refresh(); + } } + + mConversationViewModel.requestSortAll(); + mConversationsRoot->arrangeAll(); return false; } diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 832e67ae23..ceb054dfa3 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -149,7 +149,7 @@ private: conversations_widgets_map mConversationsWidgets; LLConversationViewModel mConversationViewModel; LLFolderView* mConversationsRoot; - LLEventStream mStream; + LLEventStream mConversationsEventStream; }; #endif // LL_LLIMFLOATERCONTAINER_H -- cgit v1.2.3 From aeeeae2690c9ea612667ed46021e17cb083510e5 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 5 Oct 2012 12:51:31 -0700 Subject: CHUI-364 : Fixed. Do not render participants widgets when closing a conversation handle. --- indra/newview/llconversationview.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index d4eb551f7a..416e6da2da 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -181,10 +181,8 @@ void LLConversationViewSession::draw() // draw highlight for selected items drawHighlight(show_context, true, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); - // draw children if root folder, or any other folder that is open or animating to closed state - bool draw_children = getRoot() == static_cast(this) - || isOpen() - || mCurHeight != mTargetHeight; + // Draw children if root folder, or any other folder that is open. Do not draw children when animating to closed state or you get rendering overlap. + bool draw_children = getRoot() == static_cast(this) || isOpen(); for (folders_t::iterator iter = mFolders.begin(); iter != mFolders.end();) -- cgit v1.2.3 From db452823e5cc615225f3f163d827954447cf9bd8 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 5 Oct 2012 20:28:11 -0700 Subject: CHUI-194 : WIP : Update the ad-hoc conversation line item title, add a new update_session event. Still some clean up to do. --- indra/newview/llavataractions.cpp | 22 +++++++++++++++ indra/newview/llavataractions.h | 8 ++++++ indra/newview/llconversationmodel.cpp | 49 +++++++++++++++++++++++++++++++--- indra/newview/llconversationmodel.h | 1 + indra/newview/llimfloater.cpp | 30 ++------------------- indra/newview/llimfloatercontainer.cpp | 9 +++++-- 6 files changed, 86 insertions(+), 33 deletions(-) (limited to 'indra') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 248685b964..50697d1885 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -714,6 +714,28 @@ void LLAvatarActions::buildResidentsString(const std::vector avata } } +// static +void LLAvatarActions::buildResidentsString(const uuid_vec_t& avatar_uuids, std::string& residents_string) +{ + std::vector avatar_names; + uuid_vec_t::const_iterator it = avatar_uuids.begin(); + for (; it != avatar_uuids.end(); ++it) + { + LLAvatarName av_name; + if (LLAvatarNameCache::get(*it, &av_name)) + { + avatar_names.push_back(av_name); + } + } + + // We should check whether the vector is not empty to pass the assertion + // that avatar_names.size() > 0 in LLAvatarActions::buildResidentsString. + if (!avatar_names.empty()) + { + LLAvatarActions::buildResidentsString(avatar_names, residents_string); + } +} + //static std::set LLAvatarActions::getInventorySelectedUUIDs() { diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 6e60f624ad..e7cef587c2 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -218,6 +218,14 @@ public: */ static void buildResidentsString(const std::vector avatar_names, std::string& residents_string); + /** + * Builds a string of residents' display names separated by "words_separator" string. + * + * @param avatar_uuids - a vector of given avatar uuids from which resulting string is built + * @param residents_string - the resulting string + */ + static void buildResidentsString(const uuid_vec_t& avatar_uuids, std::string& residents_string); + /** * Opens the chat history for avatar */ diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index b2b768bf9a..15824704fd 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -27,6 +27,8 @@ #include "llviewerprecompiledheaders.h" +#include "llavatarnamecache.h" +#include "llavataractions.h" #include "llevents.h" #include "llsdutil.h" #include "llconversationmodel.h" @@ -140,9 +142,48 @@ void LLConversationItemSession::addParticipant(LLConversationItemParticipant* pa addChild(participant); mIsLoaded = true; mNeedsRefresh = true; + updateParticipantName(participant); postEvent("add_participant", this, participant); } +void LLConversationItemSession::updateParticipantName(LLConversationItemParticipant* participant) +{ + // We modify the session name only in the case of an ad-hoc session, exit otherwise (nothing to do) + if (getType() != CONV_SESSION_AD_HOC) + { + return; + } + // Avoid changing the default name if no participant present yet + if (mChildren.size() == 0) + { + return; + } + // Build a string containing the participants names and check if ready for display (we don't want "(waiting)" in there) + // *TODO: Further factor out common code with LLIMFloater::onParticipantsListChanged() + bool all_names_resolved = true; + uuid_vec_t temp_uuids; // uuids vector for building the added participants' names string + child_list_t::iterator iter = mChildren.begin(); + while (iter != mChildren.end()) + { + LLConversationItemParticipant* current_participant = dynamic_cast(*iter); + temp_uuids.push_back(current_participant->getUUID()); + LLAvatarName av_name; + if (!LLAvatarNameCache::get(current_participant->getUUID(), &av_name)) + { + all_names_resolved = false; + break; + } + iter++; + } + if (all_names_resolved) + { + std::string new_session_name; + LLAvatarActions::buildResidentsString(temp_uuids, new_session_name); + renameItem(new_session_name); + postEvent("update_session", this, NULL); + } +} + void LLConversationItemSession::removeParticipant(LLConversationItemParticipant* participant) { removeChild(participant); @@ -340,11 +381,13 @@ void LLConversationItemParticipant::onAvatarNameCache(const LLAvatarName& av_nam mName = (av_name.mUsername.empty() ? av_name.mDisplayName : av_name.mUsername); mDisplayName = (av_name.mDisplayName.empty() ? av_name.mUsername : av_name.mDisplayName); mNeedsRefresh = true; - if (mParent) + LLConversationItemSession* parent_session = dynamic_cast(mParent); + if (parent_session) { - mParent->requestSort(); + parent_session->requestSort(); + parent_session->updateParticipantName(this); } - postEvent("update_participant", dynamic_cast(mParent), this); + postEvent("update_participant", parent_session, this); } void LLConversationItemParticipant::dumpDebugData() diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index d5f7e1a56b..1d082852f5 100755 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -149,6 +149,7 @@ public: LLPointer getIcon() const { return NULL; } void setSessionID(const LLUUID& session_id) { mUUID = session_id; mNeedsRefresh = true; } void addParticipant(LLConversationItemParticipant* participant); + void updateParticipantName(LLConversationItemParticipant* participant); void removeParticipant(LLConversationItemParticipant* participant); void removeParticipant(const LLUUID& participant_id); void clearParticipants(); diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 99337bd5f3..467f48600a 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -60,10 +60,6 @@ #include "llnotificationmanager.h" #include "llautoreplace.h" -/// Helper function to resolve resident names from given uuids -/// and form a string of names separated by "words_separator". -static void build_names_string(const uuid_vec_t& uuids, std::string& names_string); - floater_showed_signal_t LLIMFloater::sIMFloaterShowedSignal; LLIMFloater::LLIMFloater(const LLUUID& session_id) @@ -476,7 +472,7 @@ void LLIMFloater::addP2PSessionParticipants(const LLSD& notification, const LLSD void LLIMFloater::sendParticipantsAddedNotification(const uuid_vec_t& uuids) { std::string names_string; - build_names_string(uuids, names_string); + LLAvatarActions::buildResidentsString(uuids, names_string); LLStringUtil::format_map_t args; args["[NAME]"] = names_string; @@ -581,7 +577,7 @@ void LLIMFloater::onParticipantsListChanged(LLUICtrl* ctrl) if (all_names_resolved) { std::string ui_title; - build_names_string(temp_uuids, ui_title); + LLAvatarActions::buildResidentsString(temp_uuids, ui_title); updateSessionName(ui_title, ui_title); } } @@ -1334,25 +1330,3 @@ boost::signals2::connection LLIMFloater::setIMFloaterShowedCallback(const floate { return LLIMFloater::sIMFloaterShowedSignal.connect(cb); } - -// static -void build_names_string(const uuid_vec_t& uuids, std::string& names_string) -{ - std::vector avatar_names; - uuid_vec_t::const_iterator it = uuids.begin(); - for (; it != uuids.end(); ++it) - { - LLAvatarName av_name; - if (LLAvatarNameCache::get(*it, &av_name)) - { - avatar_names.push_back(av_name); - } - } - - // We should check whether the vector is not empty to pass the assertion - // that avatar_names.size() > 0 in LLAvatarActions::buildResidentsString. - if (!avatar_names.empty()) - { - LLAvatarActions::buildResidentsString(avatar_names, names_string); - } -} diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 4022ebdf5b..7c5aaa7d0f 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -466,7 +466,11 @@ bool LLIMFloaterContainer::onConversationModelEvent(const LLSD& event) participant_view->refresh(); } } - + else if (type == "update_session") + { + session_view->refresh(); + } + mConversationViewModel.requestSortAll(); mConversationsRoot->arrangeAll(); @@ -1111,7 +1115,7 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid) removeConversationListItem(uuid,false); // Create a conversation session model - LLConversationItem* item = NULL; + LLConversationItemSession* item = NULL; LLSpeakerMgr* speaker_manager = (is_nearby_chat ? (LLSpeakerMgr*)(LLLocalSpeakerMgr::getInstance()) : LLIMModel::getInstance()->getSpeakerManager(uuid)); if (speaker_manager) { @@ -1123,6 +1127,7 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid) return; } item->renameItem(display_name); + item->updateParticipantName(NULL); mConversationsItems[uuid] = item; -- cgit v1.2.3 From 698cfc2811a6ce976a153a1a0d87d31c56dd52ec Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Mon, 8 Oct 2012 15:19:00 +0300 Subject: CHUI-390 FIXED Selecting Chat History option from right click menu on a conversation name does not open chat history viewer --- indra/newview/llimfloatercontainer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 7c5aaa7d0f..94e7f1000b 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -888,7 +888,13 @@ void LLIMFloaterContainer::doToSelectedConversation(const std::string& command, } else if("chat_history" == command) { - LLAvatarActions::viewChatHistory(conversationItem->getUUID()); + const LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(conversationItem->getUUID()); + + if (NULL != session) + { + const LLUUID session_id = session->isOutgoingAdHoc() ? session->generateOutgouigAdHocHash() : session->mSessionID; + LLFloaterReg::showInstance("preview_conversation", session_id, true); + } } else { -- cgit v1.2.3 From 93e36340ec895a44d0b0bc73157fe23279883863 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Mon, 8 Oct 2012 22:20:58 +0300 Subject: CHUI-331 (Resizing conversation list when message panel is collapsed does not resize list) fixed --- indra/newview/llimfloatercontainer.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 94e7f1000b..5f111b39d4 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -553,12 +553,25 @@ void LLIMFloaterContainer::collapseMessagesPane(bool collapse) gSavedPerAccountSettings.setBOOL("ConversationsExpandMessagePaneFirst", mConversationsPane->isCollapsed()); } + // Save left pane rectangle before collapsing/expanding right pane. + LLRect prevRect = mConversationsPane->getRect(); + // Show/hide the messages pane. mConversationsStack->collapsePanel(mMessagesPane, collapse); + if (!collapse) + { + // Make sure layout is updated before resizing conversation pane. + mConversationsStack->updateLayout(); + } + updateState(collapse, gSavedPerAccountSettings.getS32("ConversationsMessagePaneWidth")); + if (!collapse) + { + // Restore conversation's pane previous width after expanding messages pane. + mConversationsPane->setTargetDim(prevRect.getWidth()); + } } - void LLIMFloaterContainer::collapseConversationsPane(bool collapse) { if (mConversationsPane->isCollapsed() == collapse) -- cgit v1.2.3 From 0d619bcdc1fbb7869a6376749b0bd46b1d40c91e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 8 Oct 2012 18:20:37 -0700 Subject: CHUI-147 : Sort the residents names when getting a resident string list --- indra/newview/llavataractions.cpp | 8 ++++---- indra/newview/llavataractions.h | 2 +- indra/newview/llconversationmodel.cpp | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 50697d1885..3326103d03 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -697,15 +697,15 @@ namespace action_give_inventory } // static -void LLAvatarActions::buildResidentsString(const std::vector avatar_names, std::string& residents_string) +void LLAvatarActions::buildResidentsString(std::vector avatar_names, std::string& residents_string) { llassert(avatar_names.size() > 0); - + + std::sort(avatar_names.begin(), avatar_names.end()); const std::string& separator = LLTrans::getString("words_separator"); for (std::vector::const_iterator it = avatar_names.begin(); ; ) { - LLAvatarName av_name = *it; - residents_string.append(av_name.mDisplayName); + residents_string.append((*it).mDisplayName); if (++it == avatar_names.end()) { break; diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index e7cef587c2..6e1198cd09 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -216,7 +216,7 @@ public: * @param avatar_names - a vector of given avatar names from which resulting string is built * @param residents_string - the resulting string */ - static void buildResidentsString(const std::vector avatar_names, std::string& residents_string); + static void buildResidentsString(std::vector avatar_names, std::string& residents_string); /** * Builds a string of residents' display names separated by "words_separator" string. diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 15824704fd..29e7ac4e12 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -159,7 +159,6 @@ void LLConversationItemSession::updateParticipantName(LLConversationItemParticip return; } // Build a string containing the participants names and check if ready for display (we don't want "(waiting)" in there) - // *TODO: Further factor out common code with LLIMFloater::onParticipantsListChanged() bool all_names_resolved = true; uuid_vec_t temp_uuids; // uuids vector for building the added participants' names string child_list_t::iterator iter = mChildren.begin(); @@ -170,6 +169,9 @@ void LLConversationItemSession::updateParticipantName(LLConversationItemParticip LLAvatarName av_name; if (!LLAvatarNameCache::get(current_participant->getUUID(), &av_name)) { + // If the name is not in the cache yet, bail out + // Note: we don't bind ourselves to the LLAvatarNameCache event as we are called by + // onAvatarNameCache() which is itself attached to the same event. all_names_resolved = false; break; } -- cgit v1.2.3 From 1db55ab6da9f6fcc9f51d4c09ed5fa2b88afd7c4 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 9 Oct 2012 12:07:35 -0700 Subject: CHUI-393 : Suppress the sort participants by distance from you menu item. Kept the code around. --- indra/newview/skins/default/xui/en/menu_participant_view.xml | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/menu_participant_view.xml b/indra/newview/skins/default/xui/en/menu_participant_view.xml index 0043c14479..6fa0707eea 100644 --- a/indra/newview/skins/default/xui/en/menu_participant_view.xml +++ b/indra/newview/skins/default/xui/en/menu_participant_view.xml @@ -59,17 +59,6 @@ function="IMFloaterContainer.Check" parameter="sort_participants_by_recent" /> - - - - Date: Tue, 9 Oct 2012 20:31:15 -0700 Subject: CHUI-375 : Fixed default parameters changed in methods profile but not in binding calls. --- indra/llui/llui.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 41a948e545..f43409a1ff 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1629,10 +1629,10 @@ void LLUI::initClass(const settings_map_t& settings, LLUICtrl::CommitCallbackRegistry::Registrar& reg = LLUICtrl::CommitCallbackRegistry::defaultRegistrar(); // Callbacks for associating controls with floater visibility: - reg.add("Floater.Toggle", boost::bind(&LLFloaterReg::toggleInstance, _2, LLSD())); - reg.add("Floater.ToggleOrBringToFront", boost::bind(&LLFloaterReg::toggleInstanceOrBringToFront, _2, LLSD())); - reg.add("Floater.Show", boost::bind(&LLFloaterReg::showInstance, _2, LLSD(), FALSE)); - reg.add("Floater.Hide", boost::bind(&LLFloaterReg::hideInstance, _2, LLSD())); + reg.add("Floater.Toggle", boost::bind(&LLFloaterReg::toggleInstance, _2, LLSD(LLUUID()))); + reg.add("Floater.ToggleOrBringToFront", boost::bind(&LLFloaterReg::toggleInstanceOrBringToFront, _2, LLSD(LLUUID()))); + reg.add("Floater.Show", boost::bind(&LLFloaterReg::showInstance, _2, LLSD(LLUUID()), FALSE)); + reg.add("Floater.Hide", boost::bind(&LLFloaterReg::hideInstance, _2, LLSD(LLUUID()))); // Button initialization callback for toggle buttons reg.add("Button.SetFloaterToggle", boost::bind(&LLButton::setFloaterToggle, _1, _2)); @@ -1647,8 +1647,8 @@ void LLUI::initClass(const settings_map_t& settings, reg.add("Button.ToggleFloater", boost::bind(&LLButton::toggleFloaterAndSetToggleState, _1, _2)); // Used by menus along with Floater.Toggle to display visibility as a check-mark - LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD())); - LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD())); + LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD(LLUUID()))); + LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD(LLUUID()))); // Parse the master list of commands LLCommandManager::load(); -- cgit v1.2.3 From 8b4423d428a0a209711eb18cc003d9ca4970e17a Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Wed, 10 Oct 2012 20:04:56 +0300 Subject: CHUI-377 (Icons in message panel out of position when nearby chat conversation selected) FIXED --- indra/newview/llimconversation.cpp | 33 ++++++++++++++++++++++----------- indra/newview/llimconversation.h | 2 ++ 2 files changed, 24 insertions(+), 11 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index 2ad7f9b193..3b334df189 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -393,7 +393,7 @@ void LLIMConversation::updateHeaderAndToolbar() // prevent start conversation before its container LLIMFloaterContainer::getInstance(); - bool is_torn_off = !getHost(); + bool is_torn_off = checkIfTornOff(); if (!is_torn_off) { hideAllStandardButtons(); @@ -505,16 +505,7 @@ void LLIMConversation::onSlide(LLIMConversation* self) /*virtual*/ void LLIMConversation::onOpen(const LLSD& key) { - LLIMFloaterContainer* host_floater = dynamic_cast(getHost()); - bool is_hosted = !!host_floater; - if (is_hosted) - { - // Show the messages pane when opening a floater hosted in the Conversations - host_floater->collapseMessagesPane(false); - } - - setTornOff(!is_hosted); - updateHeaderAndToolbar(); + checkIfTornOff(); } // virtual @@ -546,3 +537,23 @@ bool LLIMConversation::isChatMultiTab() // Restart is required in order to change chat window type. return true; } + +bool LLIMConversation::checkIfTornOff() +{ + bool isTorn = !getHost(); + if (!isTorn) + { + LLIMFloaterContainer* host_floater = dynamic_cast(getHost()); + + // Show the messages pane when opening a floater hosted in the Conversations + host_floater->collapseMessagesPane(false); + } + + if (isTorn != isTornOff()) + { + setTornOff(isTorn); + updateHeaderAndToolbar(); + } + + return isTorn; +} \ No newline at end of file diff --git a/indra/newview/llimconversation.h b/indra/newview/llimconversation.h index c54081d316..0960d6db88 100644 --- a/indra/newview/llimconversation.h +++ b/indra/newview/llimconversation.h @@ -138,6 +138,8 @@ private: */ void reshapeChatHistory(); + bool checkIfTornOff(); + LLTimer* mRefreshTimer; ///< Defines the rate at which refresh() is called. bool mHadFocus; -- cgit v1.2.3 From 82e5649fba22f7fa0cb4744f632aa836f0855f85 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Thu, 11 Oct 2012 14:06:35 +0300 Subject: CHUI-377 (Icons in message panel out of position when nearby chat conversation selected) Fixed bug with collapsing messages pane --- indra/newview/llimconversation.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index 3b334df189..9f3c6d0f3d 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -505,7 +505,12 @@ void LLIMConversation::onSlide(LLIMConversation* self) /*virtual*/ void LLIMConversation::onOpen(const LLSD& key) { - checkIfTornOff(); + if (!checkIfTornOff()) + { + LLIMFloaterContainer* host_floater = dynamic_cast(getHost()); + // Show the messages pane when opening a floater hosted in the Conversations + host_floater->collapseMessagesPane(false); + } } // virtual @@ -541,13 +546,6 @@ bool LLIMConversation::isChatMultiTab() bool LLIMConversation::checkIfTornOff() { bool isTorn = !getHost(); - if (!isTorn) - { - LLIMFloaterContainer* host_floater = dynamic_cast(getHost()); - - // Show the messages pane when opening a floater hosted in the Conversations - host_floater->collapseMessagesPane(false); - } if (isTorn != isTornOff()) { @@ -556,4 +554,4 @@ bool LLIMConversation::checkIfTornOff() } return isTorn; -} \ No newline at end of file +} -- cgit v1.2.3 From 0ff5a0c8ceebfab0d786aaf027c7c548170afe8d Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 11 Oct 2012 19:58:26 +0300 Subject: CHUI-356 FIXED Call notifyObserverSessionIDUpdated() only after initing IM floater with new session id --- indra/newview/llimview.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index b45903835a..a604c884ca 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -643,6 +643,12 @@ void LLIMModel::processSessionInitializedReply(const LLUUID& old_session_id, con { session->sessionInitReplyReceived(new_session_id); + LLIMFloater* im_floater = LLIMFloater::findInstance(old_session_id); + if (im_floater) + { + im_floater->sessionInitReplyReceived(new_session_id); + } + if (old_session_id != new_session_id) { mId2SessionMap.erase(old_session_id); @@ -651,12 +657,6 @@ void LLIMModel::processSessionInitializedReply(const LLUUID& old_session_id, con gIMMgr->notifyObserverSessionIDUpdated(old_session_id, new_session_id); } - LLIMFloater* im_floater = LLIMFloater::findInstance(old_session_id); - if (im_floater) - { - im_floater->sessionInitReplyReceived(new_session_id); - } - // auto-start the call on session initialization? if (session->mStartCallOnInitialize) { -- cgit v1.2.3