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 From 8aa424128ad06567f4c32c6672dc63d9b2111efa Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 11 Oct 2012 10:38:34 -0700 Subject: CHUI-380: Before code review changes. Now the user selects a conversation or participant of a conversation the correct chat floater will appear. Focus will be redirected to the chat input text box automatically allowing the user to type into the input text box. --- indra/newview/llconversationview.cpp | 28 ++++++++++++++++++++++++--- indra/newview/llconversationview.h | 1 + indra/newview/llimfloater.cpp | 37 +++++++++++++++++++++--------------- indra/newview/llimfloater.h | 1 + indra/newview/llnearbychat.cpp | 20 +++++++++++++++++++ indra/newview/llnearbychat.h | 2 +- 6 files changed, 70 insertions(+), 19 deletions(-) (limited to 'indra') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index d4eb551f7a..112c38d8b8 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -32,6 +32,8 @@ #include #include "llagentdata.h" #include "llconversationmodel.h" +#include "llimfloater.h" +#include "llnearbychat.h" #include "llimconversation.h" #include "llimfloatercontainer.h" #include "llfloaterreg.h" @@ -407,21 +409,41 @@ void LLConversationViewParticipant::draw() static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE); const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE); - const BOOL filled = show_context || (getRoot() ? getRoot()->getParentPanel()->hasFocus() : FALSE); // If we have keyboard focus, draw selection filled const LLFontGL* font = getLabelFontForStyle(mLabelStyle); F32 right_x = 0; F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; F32 text_left = (F32)getLabelXPos(); - LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor; + LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor; - drawHighlight(show_context, filled, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); + drawHighlight(show_context, true, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); drawLabel(font, text_left, y, color, right_x); LLView::draw(); } +void LLConversationViewParticipant::selectItem() +{ + LLConversationItem* vmi = this->getParentFolder() ? static_cast(this->getParentFolder()->getViewModelItem()) : NULL; + + if(vmi) + { + //When null, show the nearby chat conversation floater + if(vmi->getUUID().isNull()) + { + LLNearbyChat* nearbyChat = LLFloaterReg::findTypedInstance("nearby_chat"); + nearbyChat->show(); + } + //Otherwise, show the IM conversation floater + else + { + LLIMFloater::show(vmi->getUUID()); + } + } + + LLFolderViewItem::selectItem(); +} void LLConversationViewParticipant::refresh() { diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index c81c70b456..bd95387bbe 100755 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -113,6 +113,7 @@ public: }; virtual ~LLConversationViewParticipant( void ) { } + void selectItem(); bool hasSameValue(const LLUUID& uuid) { return (uuid == mUUID); } virtual void refresh(); void addToFolder(LLFolderViewFolder* folder); diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 99337bd5f3..990b9c45f9 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -719,6 +719,27 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock) } } +void LLIMFloater::setFocus(BOOL focusFlag) +{ + LLTransientDockableFloater::setFocus(focusFlag); + + BOOL is_minimized = focusFlag && isChatMultiTab() + ? LLIMFloaterContainer::getInstance()->isMinimized() + : !focusFlag; + + //Redirect focus to input editor + if (!is_minimized && mChatHistory && mInputEditor) + { + //only if floater was construced and initialized from xml + updateMessages(); + //prevent stealing focus when opening a background IM tab (EXT-5387, checking focus for EXT-6781) + if (!isChatMultiTab() || hasFocus()) + { + mInputEditor->setFocus(TRUE); + } + } +} + void LLIMFloater::setVisible(BOOL visible) { LLNotificationsUI::LLScreenChannel* channel = static_cast @@ -734,21 +755,6 @@ void LLIMFloater::setVisible(BOOL visible) channel->redrawToasts(); } - BOOL is_minimized = visible && isChatMultiTab() - ? LLIMFloaterContainer::getInstance()->isMinimized() - : !visible; - - if (!is_minimized && mChatHistory && mInputEditor) - { - //only if floater was construced and initialized from xml - updateMessages(); - //prevent stealing focus when opening a background IM tab (EXT-5387, checking focus for EXT-6781) - if (!isChatMultiTab() || hasFocus()) - { - mInputEditor->setFocus(TRUE); - } - } - if(!visible) { LLIMChiclet* chiclet = LLChicletBar::getInstance()->getChicletPanel()->findChiclet(mSessionID); @@ -761,6 +767,7 @@ void LLIMFloater::setVisible(BOOL visible) if (visible && isInVisibleChain()) { sIMFloaterShowedSignal(mSessionID); + setFocus(TRUE); } } diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index 5ed1d1ab35..26daf00afd 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -65,6 +65,7 @@ public: // LLView overrides /*virtual*/ BOOL postBuild(); + /*virtual*/ void setFocus(BOOL focusFlag); /*virtual*/ void setVisible(BOOL visible); /*virtual*/ BOOL getVisible(); // Check typing timeout timer. diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index b96b486868..e0778afd86 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -271,11 +271,31 @@ void LLNearbyChat::removeScreenChat() } } +void LLNearbyChat::setFocus(BOOL focusFlag) +{ + LLTransientDockableFloater::setFocus(focusFlag); + + BOOL is_minimized = focusFlag && isChatMultiTab() + ? LLIMFloaterContainer::getInstance()->isMinimized() + : !focusFlag; + + //Redirect focus to input editor + if (!is_minimized && mChatHistory && mInputEditor) + { + //prevent stealing focus when opening a background IM tab (EXT-5387, checking focus for EXT-6781) + if (!isChatMultiTab() || hasFocus()) + { + mInputEditor->setFocus(TRUE); + } + } +} + void LLNearbyChat::setVisible(BOOL visible) { if(visible) { removeScreenChat(); + setFocus(TRUE); } LLIMConversation::setVisible(visible); diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 93168ba96a..7ada4daea8 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -52,7 +52,7 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - + /*virtual*/ void setFocus(BOOL focusFlag); /*virtual*/ void setVisible(BOOL visible); void loadHistory(); -- cgit v1.2.3 From 375f380ea388b37c34ace9570822d0c117b3d2f1 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 11 Oct 2012 12:17:46 -0700 Subject: CHUI-380: Code cleanup after code review. --- indra/newview/llimfloater.cpp | 13 ++----------- indra/newview/llnearbychat.cpp | 12 ++---------- 2 files changed, 4 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 990b9c45f9..a1ed1e0b01 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -723,20 +723,11 @@ void LLIMFloater::setFocus(BOOL focusFlag) { LLTransientDockableFloater::setFocus(focusFlag); - BOOL is_minimized = focusFlag && isChatMultiTab() - ? LLIMFloaterContainer::getInstance()->isMinimized() - : !focusFlag; - //Redirect focus to input editor - if (!is_minimized && mChatHistory && mInputEditor) + if (focusFlag) { - //only if floater was construced and initialized from xml updateMessages(); - //prevent stealing focus when opening a background IM tab (EXT-5387, checking focus for EXT-6781) - if (!isChatMultiTab() || hasFocus()) - { - mInputEditor->setFocus(TRUE); - } + mInputEditor->setFocus(TRUE); } } diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index e0778afd86..a0ddc9b52b 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -275,18 +275,10 @@ void LLNearbyChat::setFocus(BOOL focusFlag) { LLTransientDockableFloater::setFocus(focusFlag); - BOOL is_minimized = focusFlag && isChatMultiTab() - ? LLIMFloaterContainer::getInstance()->isMinimized() - : !focusFlag; - //Redirect focus to input editor - if (!is_minimized && mChatHistory && mInputEditor) + if (focusFlag) { - //prevent stealing focus when opening a background IM tab (EXT-5387, checking focus for EXT-6781) - if (!isChatMultiTab() || hasFocus()) - { - mInputEditor->setFocus(TRUE); - } + mInputEditor->setFocus(TRUE); } } -- cgit v1.2.3 From f4b10aaebbaf8eb66d41ffa703f6ed7b909ba7e7 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 11 Oct 2012 17:48:39 -0700 Subject: CHUI-380: Fixing a bug that occurred when right clicking nearby chat and then right clicking a participant under a conversation. This would result in both the participant and conversation to be highlighted. Still a work in progress. This change involves introducing an old bug CHUI 289 and finding a different approach to solving it. --- indra/newview/llconversationview.cpp | 2 +- indra/newview/llimconversation.cpp | 4 ++-- indra/newview/llimfloater.cpp | 5 ++++- indra/newview/llnearbychat.cpp | 15 ++++++++------- 4 files changed, 15 insertions(+), 11 deletions(-) (limited to 'indra') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index f9a3a05e59..70f2446752 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -415,7 +415,7 @@ void LLConversationViewParticipant::draw() F32 text_left = (F32)getLabelXPos(); LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor; - drawHighlight(show_context, true, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); + drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); drawLabel(font, text_left, y, color, right_x); LLView::draw(); diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index 9f3c6d0f3d..2027f79eea 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -222,8 +222,8 @@ void LLIMConversation::onFocusReceived() if (! mHadFocus) { - LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance(); - container->setConvItemSelect(mSessionID); + // LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance(); + // container->setConvItemSelect(mSessionID); } } diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index a8add9c6ab..e4032738a7 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -725,6 +725,7 @@ void LLIMFloater::setFocus(BOOL focusFlag) updateMessages(); mInputEditor->setFocus(TRUE); } + } void LLIMFloater::setVisible(BOOL visible) @@ -754,8 +755,10 @@ void LLIMFloater::setVisible(BOOL visible) if (visible && isInVisibleChain()) { sIMFloaterShowedSignal(mSessionID); - setFocus(TRUE); + } + + setFocus(visible); } BOOL LLIMFloater::getVisible() diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index a0ddc9b52b..a89ae4a2dc 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -274,23 +274,24 @@ void LLNearbyChat::removeScreenChat() void LLNearbyChat::setFocus(BOOL focusFlag) { LLTransientDockableFloater::setFocus(focusFlag); - + //Redirect focus to input editor if (focusFlag) { mInputEditor->setFocus(TRUE); } + } void LLNearbyChat::setVisible(BOOL visible) { - if(visible) - { - removeScreenChat(); - setFocus(TRUE); - } - LLIMConversation::setVisible(visible); + + if(visible) + { + removeScreenChat(); + } + setFocus(visible); } -- cgit v1.2.3 From 9aa03f0bf284bbfa3f50883351c6e39f7ffa41c5 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Fri, 12 Oct 2012 14:29:44 +0300 Subject: CHUI-402 (Double-click on conversation participant should begin IM session) --- indra/newview/llimfloatercontainer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 5f111b39d4..0f44d42780 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -142,6 +142,9 @@ BOOL LLIMFloaterContainer::postBuild() mConversationsListPanel = getChild("conversations_list_panel"); + // Open IM session with selected participant on double click event + mConversationsListPanel->setDoubleClickCallback(boost::bind(&LLIMFloaterContainer::doToSelected, this, LLSD("im"))); + // Create the root model and view for all conversation sessions LLConversationItem* base_item = new LLConversationItem(getRootViewModel()); -- cgit v1.2.3 From 19c5b35a86dbe641fe397baf9a8194d78e440af8 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 12 Oct 2012 20:10:13 +0300 Subject: CHUI-385 FIXED All user's do not receive ad hoc messages after adding a user to a conversation --- indra/newview/llimfloatercontainer.cpp | 15 ++++++++++----- indra/newview/llimfloatercontainer.h | 4 ++-- indra/newview/llimview.cpp | 9 ++++++--- 3 files changed, 18 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 0f44d42780..2248699e5e 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -109,8 +109,7 @@ void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id) void LLIMFloaterContainer::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) { - removeConversationListItem(old_session_id); - addConversationListItem(new_session_id); + addConversationListItem(new_session_id, removeConversationListItem(old_session_id)); } void LLIMFloaterContainer::sessionRemoved(const LLUUID& session_id) @@ -1118,7 +1117,7 @@ void LLIMFloaterContainer::setNearbyDistances() } } -void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid) +void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid, bool isWidgetSelected /*= false*/) { bool is_nearby_chat = uuid.isNull(); @@ -1173,7 +1172,10 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid) current_participant_model++; } - setConvItemSelect(uuid); + if (isWidgetSelected) + { + setConvItemSelect(uuid); + } // set the widget to minimized mode if conversations pane is collapsed widget->toggleMinimizedMode(mConversationsPane->isCollapsed()); @@ -1181,17 +1183,19 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid) return; } -void LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool change_focus) +bool LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool change_focus) { // Delete the widget and the associated conversation item // Note : since the mConversationsItems is also the listener to the widget, deleting // the widget will also delete its listener + bool isWidgetSelected = false; conversations_widgets_map::iterator widget_it = mConversationsWidgets.find(uuid); if (widget_it != mConversationsWidgets.end()) { LLFolderViewItem* widget = widget_it->second; if (widget) { + isWidgetSelected = widget->isSelected(); widget->destroyView(); } } @@ -1211,6 +1215,7 @@ void LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool c widget->selectItem(); } } + return isWidgetSelected; } LLConversationViewSession* LLIMFloaterContainer::createConversationItemWidget(LLConversationItem* item) diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index ceb054dfa3..5c11577154 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -133,8 +133,8 @@ private: // Conversation list implementation public: - void removeConversationListItem(const LLUUID& uuid, bool change_focus = true); - void addConversationListItem(const LLUUID& uuid); + bool removeConversationListItem(const LLUUID& uuid, bool change_focus = true); + void addConversationListItem(const LLUUID& uuid, bool isWidgetSelected = false); void setTimeNow(const LLUUID& session_id, const LLUUID& participant_id); void setNearbyDistances(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index a604c884ca..aa5b9ce006 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); + if (old_session_id != new_session_id) + { + mId2SessionMap.erase(old_session_id); + mId2SessionMap[new_session_id] = session; + } + LLIMFloater* im_floater = LLIMFloater::findInstance(old_session_id); if (im_floater) { @@ -651,9 +657,6 @@ void LLIMModel::processSessionInitializedReply(const LLUUID& old_session_id, con if (old_session_id != new_session_id) { - mId2SessionMap.erase(old_session_id); - mId2SessionMap[new_session_id] = session; - gIMMgr->notifyObserverSessionIDUpdated(old_session_id, new_session_id); } -- cgit v1.2.3 From d7d0416547958792517a9b739b370e51c717fb23 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 12 Oct 2012 20:15:57 -0700 Subject: CHUI-380: (In progress) Refactoring needed to fix focusing issues when selecting an existing conversation item. This commit resolves re-introducing bug CHUI-289. Will code review and cleanup code in next commit. --- indra/llkdu/llimagej2ckdu.cpp | 4 ++-- indra/newview/llchiclet.h | 1 + indra/newview/llchicletbar.h | 1 + indra/newview/llconversationlog.h | 1 + indra/newview/llconversationview.cpp | 6 ++++-- indra/newview/llimconversation.cpp | 11 ----------- indra/newview/llimconversation.h | 3 --- indra/newview/llimfloatercontainer.cpp | 19 +++++++++++++++++++ indra/newview/llimfloatercontainer.h | 3 +++ indra/newview/llimview.cpp | 13 +++++++++++++ indra/newview/llimview.h | 2 ++ indra/newview/llsyswellwindow.h | 1 + 12 files changed, 47 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index cf88de12b4..db75b6e003 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -166,12 +166,12 @@ void LLKDUMessageWarning::put_text(const kdu_uint16 *s) void LLKDUMessageError::put_text(const char *s) { - llinfos << "KDU Error: " << s << llendl; + //llinfos << "KDU Error: " << s << llendl; } void LLKDUMessageError::put_text(const kdu_uint16 *s) { - llinfos << "KDU Error: " << s << llendl; + //llinfos << "KDU Error: " << s << llendl; } void LLKDUMessageError::flush(bool end_of_message) diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index f51d7b622c..3a52b0a67b 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -874,6 +874,7 @@ class LLIMWellChiclet : public LLSysWellChiclet, LLIMSessionObserver friend class LLUICtrlFactory; public: /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {} + /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {} /*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {}; /*virtual*/ void sessionRemoved(const LLUUID& session_id) { messageCountChanged(LLSD()); } /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) {} diff --git a/indra/newview/llchicletbar.h b/indra/newview/llchicletbar.h index 7d0d904810..0589a9fccc 100644 --- a/indra/newview/llchicletbar.h +++ b/indra/newview/llchicletbar.h @@ -51,6 +51,7 @@ public: // LLIMSessionObserver observe triggers /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); + /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; /*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {}; /*virtual*/ void sessionRemoved(const LLUUID& session_id); /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 373406aa6f..70f04b21c8 100644 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -124,6 +124,7 @@ public: // LLIMSessionObserver triggers virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); + virtual void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; // Stub virtual void sessionRemoved(const LLUUID& session_id){} // Stub virtual void sessionVoiceOrIMStarted(const LLUUID& session_id){}; // Stub virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id){}; // Stub diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 70f2446752..637f30635e 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -424,8 +424,10 @@ void LLConversationViewParticipant::draw() void LLConversationViewParticipant::selectItem() { LLConversationItem* vmi = this->getParentFolder() ? static_cast(this->getParentFolder()->getViewModelItem()) : NULL; - - if(vmi) + LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance(); + + //Only execute when switching floaters (conversations) + if(vmi && vmi->getUUID() != container->getSelectedSession()) { //When null, show the nearby chat conversation floater if(vmi->getUUID().isNull()) diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index 2027f79eea..bd2a2419a8 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -54,7 +54,6 @@ LLIMConversation::LLIMConversation(const LLSD& session_id) , mInputEditor(NULL) , mInputEditorTopPad(0) , mRefreshTimer(new LLTimer()) - , mHasFocus(false) { mSession = LLIMModel::getInstance()->findIMSession(mSessionID); @@ -216,21 +215,11 @@ void LLIMConversation::onFocusReceived() } LLTransientDockableFloater::onFocusReceived(); - - mHadFocus = mHasFocus; - mHasFocus = true; - - if (! mHadFocus) - { - // LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance(); - // container->setConvItemSelect(mSessionID); - } } void LLIMConversation::onFocusLost() { setBackgroundOpaque(false); - mHasFocus = false; LLTransientDockableFloater::onFocusLost(); } diff --git a/indra/newview/llimconversation.h b/indra/newview/llimconversation.h index 0960d6db88..603e0d0197 100644 --- a/indra/newview/llimconversation.h +++ b/indra/newview/llimconversation.h @@ -141,9 +141,6 @@ private: bool checkIfTornOff(); LLTimer* mRefreshTimer; ///< Defines the rate at which refresh() is called. - - bool mHadFocus; - bool mHasFocus; }; diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 5f111b39d4..0250854f36 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -101,6 +101,11 @@ void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::str addConversationListItem(session_id); } +void LLIMFloaterContainer::sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) +{ + doSomething(session_id); +} + void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id) { LLIMFloater::addToHost(session_id, true); @@ -1069,6 +1074,19 @@ void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id) } } +void LLIMFloaterContainer::doSomething(const LLUUID& session_id) +{ + LLConversationItem* vmi = static_cast(mConversationsRoot->getCurSelectedItem()->getParentFolder()->getViewModelItem()); + + if(session_id != vmi->getUUID()) + { + mSelectedSession = session_id; + LLFolderViewItem* widget = mConversationsWidgets[session_id]; + (widget->getRoot())->setSelection(widget, FALSE, FALSE); + } +} + + void LLIMFloaterContainer::setTimeNow(const LLUUID& session_id, const LLUUID& participant_id) { conversations_items_map::iterator item_it = mConversationsItems.find(session_id); @@ -1204,6 +1222,7 @@ void LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool c conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin(); if (widget_it != mConversationsWidgets.end()) { + mSelectedSession = widget_it->first; LLFolderViewItem* widget = widget_it->second; widget->selectItem(); } diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index ceb054dfa3..da134c498f 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -64,6 +64,7 @@ public: BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); void setConvItemSelect(const LLUUID& session_id); + void doSomething(const LLUUID& session_id); /*virtual*/ void tabClose(); static LLFloater* getCurrentVoiceFloater(); @@ -81,11 +82,13 @@ public: // LLIMSessionObserver observe triggers /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); + /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); /*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id); /*virtual*/ void sessionRemoved(const LLUUID& session_id); /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); LLConversationViewModel& getRootViewModel() { return mConversationViewModel; } + LLUUID getSelectedSession() { return mSelectedSession; } private: typedef std::map avatarID_panel_map_t; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index a604c884ca..e75db1b7af 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2654,6 +2654,11 @@ LLUUID LLIMMgr::addSession( { LLIMModel::getInstance()->newSession(session_id, name, dialog, other_participant_id, ids, voice); } + else + { + std::string session_name = LLIMModel::getInstance()->getName(session_id); + LLIMMgr::getInstance()->notifyObserverSessionAlreadyAdded(session_id, session_name, other_participant_id); + } //we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions if (!new_session) return session_id; @@ -2956,6 +2961,14 @@ void LLIMMgr::notifyObserverSessionAdded(const LLUUID& session_id, const std::st } } +void LLIMMgr::notifyObserverSessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) +{ + for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++) + { + (*it)->sessionAlreadyAdded(session_id, name, other_participant_id); + } +} + void LLIMMgr::notifyObserverSessionVoiceOrIMStarted(const LLUUID& session_id) { for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++) diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 82cfa394a6..a34359eb00 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -303,6 +303,7 @@ class LLIMSessionObserver public: virtual ~LLIMSessionObserver() {} virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0; + virtual void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0; virtual void sessionVoiceOrIMStarted(const LLUUID& session_id) = 0; virtual void sessionRemoved(const LLUUID& session_id) = 0; virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) = 0; @@ -469,6 +470,7 @@ private: static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group); void notifyObserverSessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); + void notifyObserverSessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); void notifyObserverSessionVoiceOrIMStarted(const LLUUID& session_id); void notifyObserverSessionRemoved(const LLUUID& session_id); void notifyObserverSessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index 6be12711ac..302007c9aa 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -171,6 +171,7 @@ public: // LLIMSessionObserver observe triggers /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); + /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {} /*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {}; /*virtual*/ void sessionRemoved(const LLUUID& session_id); /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); -- cgit v1.2.3 From f609f4cca3a91c8d6ea7c55b61d0b2cfd29be6b7 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 15 Oct 2012 13:55:12 +0300 Subject: CHUI-400 FIXED Disable "Activate Group" menu item if selected group is the active group --- indra/newview/llimfloatercontainer.cpp | 6 ++++++ indra/newview/skins/default/xui/en/menu_conversation.xml | 1 + 2 files changed, 7 insertions(+) (limited to 'indra') diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 2248699e5e..16751a6ea1 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -961,6 +961,12 @@ bool LLIMFloaterContainer::enableContextMenuItem(const LLSD& userdata) uuid_vec_t mUUIDs; getParticipantUUIDs(mUUIDs); + if(item == std::string("can_activate_group")) + { + LLUUID selected_group_id = getCurSelectedViewModelItem()->getUUID(); + return gAgent.getGroupID() != selected_group_id; + } + if(mUUIDs.size() <= 0) { return false; diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index 912ff811d9..682d70e4f0 100644 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -117,6 +117,7 @@ layout="topleft" name="activate_group"> + Date: Mon, 15 Oct 2012 13:58:21 -0700 Subject: CHUI-380: Final commit for this issue. After code review changed some method names to be more accurate. Also using dynamic_cast instead of static_cast for safety. --- indra/llkdu/llimagej2ckdu.cpp | 4 ++-- indra/newview/llchiclet.h | 2 +- indra/newview/llchicletbar.h | 2 +- indra/newview/llconversationlog.h | 2 +- indra/newview/llimfloatercontainer.cpp | 24 ++++++++++++++++-------- indra/newview/llimfloatercontainer.h | 4 ++-- indra/newview/llimview.cpp | 8 +++++--- indra/newview/llimview.h | 5 +++-- indra/newview/llsyswellwindow.h | 2 +- 9 files changed, 32 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index db75b6e003..cf88de12b4 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -166,12 +166,12 @@ void LLKDUMessageWarning::put_text(const kdu_uint16 *s) void LLKDUMessageError::put_text(const char *s) { - //llinfos << "KDU Error: " << s << llendl; + llinfos << "KDU Error: " << s << llendl; } void LLKDUMessageError::put_text(const kdu_uint16 *s) { - //llinfos << "KDU Error: " << s << llendl; + llinfos << "KDU Error: " << s << llendl; } void LLKDUMessageError::flush(bool end_of_message) diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 3a52b0a67b..6395f5b694 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -874,7 +874,7 @@ class LLIMWellChiclet : public LLSysWellChiclet, LLIMSessionObserver friend class LLUICtrlFactory; public: /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {} - /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {} + /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {} /*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {}; /*virtual*/ void sessionRemoved(const LLUUID& session_id) { messageCountChanged(LLSD()); } /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) {} diff --git a/indra/newview/llchicletbar.h b/indra/newview/llchicletbar.h index 0589a9fccc..a9a5b61ae7 100644 --- a/indra/newview/llchicletbar.h +++ b/indra/newview/llchicletbar.h @@ -51,7 +51,7 @@ public: // LLIMSessionObserver observe triggers /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); - /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; + /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; /*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {}; /*virtual*/ void sessionRemoved(const LLUUID& session_id); /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 70f04b21c8..b92cf0f5e2 100644 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -124,7 +124,7 @@ public: // LLIMSessionObserver triggers virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); - virtual void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; // Stub + virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; // Stub virtual void sessionRemoved(const LLUUID& session_id){} // Stub virtual void sessionVoiceOrIMStarted(const LLUUID& session_id){}; // Stub virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id){}; // Stub diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 0250854f36..c8897c1f92 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -101,9 +101,9 @@ void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::str addConversationListItem(session_id); } -void LLIMFloaterContainer::sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) +void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) { - doSomething(session_id); + setItemSelect(session_id); } void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id) @@ -1064,6 +1064,7 @@ bool LLIMFloaterContainer::checkContextMenuItem(const LLSD& userdata) return false; } +//Will select only the conversation item void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id) { LLFolderViewItem* widget = mConversationsWidgets[session_id]; @@ -1074,15 +1075,22 @@ void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id) } } -void LLIMFloaterContainer::doSomething(const LLUUID& session_id) +//Will select the conversation/participant item +void LLIMFloaterContainer::setItemSelect(const LLUUID& session_id) { - LLConversationItem* vmi = static_cast(mConversationsRoot->getCurSelectedItem()->getParentFolder()->getViewModelItem()); - if(session_id != vmi->getUUID()) + if(mConversationsRoot->getCurSelectedItem() && mConversationsRoot->getCurSelectedItem()->getParentFolder()) { - mSelectedSession = session_id; - LLFolderViewItem* widget = mConversationsWidgets[session_id]; - (widget->getRoot())->setSelection(widget, FALSE, FALSE); + //Retreive the conversation id. When a participant is selected, then have to to get the converation id from the parent. + LLConversationItem* vmi = dynamic_cast(mConversationsRoot->getCurSelectedItem()->getParentFolder()->getViewModelItem()); + + //Will allow selection/highlighting of the conversation/participant + if(session_id != vmi->getUUID()) + { + mSelectedSession = session_id; + LLFolderViewItem* widget = mConversationsWidgets[session_id]; + (widget->getRoot())->setSelection(widget, FALSE, FALSE); + } } } diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index da134c498f..c9da213f8c 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -64,7 +64,7 @@ public: BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); void setConvItemSelect(const LLUUID& session_id); - void doSomething(const LLUUID& session_id); + void setItemSelect(const LLUUID& session_id); /*virtual*/ void tabClose(); static LLFloater* getCurrentVoiceFloater(); @@ -82,7 +82,7 @@ public: // LLIMSessionObserver observe triggers /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); - /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); + /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); /*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id); /*virtual*/ void sessionRemoved(const LLUUID& session_id); /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index e75db1b7af..eea59c223a 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2650,14 +2650,16 @@ LLUUID LLIMMgr::addSession( } } + //Notify observers that a session was added if (new_session) { LLIMModel::getInstance()->newSession(session_id, name, dialog, other_participant_id, ids, voice); } + //Notifies observers that the session was already added else { std::string session_name = LLIMModel::getInstance()->getName(session_id); - LLIMMgr::getInstance()->notifyObserverSessionAlreadyAdded(session_id, session_name, other_participant_id); + LLIMMgr::getInstance()->notifyObserverSessionActivated(session_id, session_name, other_participant_id); } //we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions @@ -2961,11 +2963,11 @@ void LLIMMgr::notifyObserverSessionAdded(const LLUUID& session_id, const std::st } } -void LLIMMgr::notifyObserverSessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) +void LLIMMgr::notifyObserverSessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) { for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++) { - (*it)->sessionAlreadyAdded(session_id, name, other_participant_id); + (*it)->sessionActivated(session_id, name, other_participant_id); } } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index a34359eb00..00b67f520c 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -303,7 +303,7 @@ class LLIMSessionObserver public: virtual ~LLIMSessionObserver() {} virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0; - virtual void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0; + virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0; virtual void sessionVoiceOrIMStarted(const LLUUID& session_id) = 0; virtual void sessionRemoved(const LLUUID& session_id) = 0; virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) = 0; @@ -470,7 +470,8 @@ private: static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group); void notifyObserverSessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); - void notifyObserverSessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); + //Triggers when a session has already been added + void notifyObserverSessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); void notifyObserverSessionVoiceOrIMStarted(const LLUUID& session_id); void notifyObserverSessionRemoved(const LLUUID& session_id); void notifyObserverSessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index 302007c9aa..378d5e0aa2 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -171,7 +171,7 @@ public: // LLIMSessionObserver observe triggers /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); - /*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {} + /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {} /*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {}; /*virtual*/ void sessionRemoved(const LLUUID& session_id); /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); -- cgit v1.2.3 From 699e0a1e0b89e4d3c2d1342c821496c5699b8c52 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 15 Oct 2012 14:28:07 -0700 Subject: CHUI-380: Merge fix, the addConverationListItem API was changedso that it does not by default select the new conversation item. Adjusted sessionAdded and sessionVoiceOrImStarted functions to specify that the first item should be selected when calling addConversationListItem(). --- indra/newview/llimfloatercontainer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 8a30b5cd68..5c1105531e 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -98,7 +98,7 @@ LLIMFloaterContainer::~LLIMFloaterContainer() void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) { LLIMFloater::addToHost(session_id, true); - addConversationListItem(session_id); + addConversationListItem(session_id, true); } void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) @@ -109,7 +109,7 @@ void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std: void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id) { LLIMFloater::addToHost(session_id, true); - addConversationListItem(session_id); + addConversationListItem(session_id, true); } void LLIMFloaterContainer::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) -- cgit v1.2.3 From d0f9600f37a87b2d6c7a2c3cfbbc5d793e505872 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 15 Oct 2012 16:06:02 -0700 Subject: CHUI-380: Bug fix after merge. When selecting the participant of a conversation focus would be lost on the converstation floater. This was because focus would be set to the participant folder item. Resolution: Now delegate focus from the particiapnt folder item to the conversation floater. --- indra/newview/llconversationview.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 637f30635e..b7ebb70e86 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -425,6 +425,7 @@ void LLConversationViewParticipant::selectItem() { LLConversationItem* vmi = this->getParentFolder() ? static_cast(this->getParentFolder()->getViewModelItem()) : NULL; LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance(); + LLFloater* session_floater; //Only execute when switching floaters (conversations) if(vmi && vmi->getUUID() != container->getSelectedSession()) @@ -441,6 +442,12 @@ void LLConversationViewParticipant::selectItem() LLIMFloater::show(vmi->getUUID()); } } + //Focus the current conversation floater (it is already visible so just focus it) + else + { + session_floater = LLIMConversation::getConversation(vmi->getUUID()); + session_floater->setFocus(TRUE); + } LLFolderViewItem::selectItem(); } -- cgit v1.2.3 From 5a22949cf509ebd1a3c7dfbd029b4bc188fee4a3 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 16 Oct 2012 15:33:12 +0300 Subject: CHUI-388 FIXED Do not add menu items to Participant Menu if own avatar is selected in participant list. Do not show Menu if all menu items are disabled. --- indra/llui/llmenugl.cpp | 12 +++++++++++- indra/newview/llconversationmodel.cpp | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 5182a8cea1..ae4aa1e1dd 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3037,7 +3037,17 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) const S32 CURSOR_HEIGHT = 22; // Approximate "normal" cursor size const S32 CURSOR_WIDTH = 12; - if(menu->getChildList()->empty()) + //Do not show menu if all menu items are disabled + BOOL item_enabled = false; + for (LLView::child_list_t::const_iterator itor = menu->getChildList()->begin(); + itor != menu->getChildList()->end(); + ++itor) + { + LLView *menu_item = (*itor); + item_enabled = item_enabled || menu_item->getEnabled(); + } + + if(menu->getChildList()->empty() || !item_enabled) { return; } diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 29e7ac4e12..e5232d730c 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" +#include "llagent.h" #include "llavatarnamecache.h" #include "llavataractions.h" #include "llevents.h" @@ -374,7 +375,10 @@ void LLConversationItemParticipant::buildContextMenu(LLMenuGL& menu, U32 flags) menuentry_vec_t items; menuentry_vec_t disabled_items; - buildParticipantMenuOptions(items); + if(gAgent.getID() != mUUID) + { + buildParticipantMenuOptions(items); + } hide_context_entries(menu, items, disabled_items); } -- cgit v1.2.3