From b0c54dfd3e2ecc8d4f875276397a55cef40a3d9a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 19 Oct 2012 17:47:28 -0700 Subject: CHUI-433: Problem: Toasts were not being displayed due to incorrect tracking of the current conversation with focus. Resolution: Now when a conversation gains focus it will set a flag to ignore toasts. And when a conversation loses focus it will set a flag to re-enable toasts. --- indra/newview/llimconversation.cpp | 13 ++++--------- indra/newview/llimview.cpp | 5 ++--- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index bd2a2419a8..f4b8d39cd0 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -202,16 +202,10 @@ void LLIMConversation::onFocusReceived() { setBackgroundOpaque(true); - if (mSessionID.notNull()) + if (mSessionID.notNull() && isInVisibleChain()) { - LLChicletBar::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, true); - - if (getVisible()) - { - // suppress corresponding toast only if this floater is visible and have focus - LLIMModel::getInstance()->setActiveSessionID(mSessionID); - LLIMModel::instance().sendNoUnreadMessages(mSessionID); - } + LLIMModel::getInstance()->setActiveSessionID(mSessionID); + LLIMModel::instance().sendNoUnreadMessages(mSessionID); } LLTransientDockableFloater::onFocusReceived(); @@ -219,6 +213,7 @@ void LLIMConversation::onFocusReceived() void LLIMConversation::onFocusLost() { + LLIMModel::getInstance()->resetActiveSessionID(); setBackgroundOpaque(false); LLTransientDockableFloater::onFocusLost(); } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 115da54ec8..572f36ff7d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -119,8 +119,7 @@ void toast_callback(const LLSD& msg){ } // check whether incoming IM belongs to an active session or not - if (LLIMModel::getInstance()->getActiveSessionID().notNull() - && LLIMModel::getInstance()->getActiveSessionID() == msg["session_id"]) + if (LLIMModel::getInstance()->getActiveSessionID() == msg["session_id"]) { return; } @@ -147,7 +146,7 @@ void toast_callback(const LLSD& msg){ // Skip toasting if we have open window of IM with this session id LLIMFloater* open_im_floater = LLIMFloater::findInstance(msg["session_id"]); - if (open_im_floater && open_im_floater->getVisible()) + if (open_im_floater && open_im_floater->isInVisibleChain() && open_im_floater->hasFocus()) { return; } -- cgit v1.2.3 From 0d25cca2e1e117962aad57dc951c102bec52cb50 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Mon, 22 Oct 2012 15:01:03 -0700 Subject: Backed out changeset: 4202e227f8e4 --- indra/llui/llfloaterreg.cpp | 2 +- indra/llui/llfloaterreg.h | 24 ++++++++++++------------ indra/newview/llnearbychat.cpp | 12 ++++++------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 920525448c..9115eb7174 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -318,7 +318,7 @@ void LLFloaterReg::showInitialVisibleInstances() BOOL isvis = LLFloater::getControlGroup()->getBOOL(controlname); if (isvis) { - showInstance(name, LLSD(LLUUID())); // keyed floaters shouldn't set save_vis to true + showInstance(name, LLSD()); // keyed floaters shouldn't set save_vis to true } } } diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 7924b2a7b8..a1e1f8a988 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -90,23 +90,23 @@ public: static LLFloater* getLastFloaterCascading(); // Find / get (create) / remove / destroy - static LLFloater* findInstance(const std::string& name, const LLSD& key = LLSD(LLUUID())); - static LLFloater* getInstance(const std::string& name, const LLSD& key = LLSD(LLUUID())); - static LLFloater* removeInstance(const std::string& name, const LLSD& key = LLSD(LLUUID())); - static bool destroyInstance(const std::string& name, const LLSD& key = LLSD(LLUUID())); + static LLFloater* findInstance(const std::string& name, const LLSD& key = LLSD()); + static LLFloater* getInstance(const std::string& name, const LLSD& key = LLSD()); + static LLFloater* removeInstance(const std::string& name, const LLSD& key = LLSD()); + static bool destroyInstance(const std::string& name, const LLSD& key = LLSD()); // Iterators static const_instance_list_t& getFloaterList(const std::string& name); // Visibility Management // return NULL if instance not found or can't create instance (no builder) - static LLFloater* showInstance(const std::string& name, const LLSD& key = LLSD(LLUUID()), BOOL focus = FALSE); + static LLFloater* showInstance(const std::string& name, const LLSD& key = LLSD(), BOOL focus = FALSE); // Close a floater (may destroy or set invisible) // return false if can't find instance - static bool hideInstance(const std::string& name, const LLSD& key = LLSD(LLUUID())); + static bool hideInstance(const std::string& name, const LLSD& key = LLSD()); // return true if instance is visible: - static bool toggleInstance(const std::string& name, const LLSD& key = LLSD(LLUUID())); - static bool instanceVisible(const std::string& name, const LLSD& key = LLSD(LLUUID())); + static bool toggleInstance(const std::string& name, const LLSD& key = LLSD()); + static bool instanceVisible(const std::string& name, const LLSD& key = LLSD()); static void showInitialVisibleInstances(); static void hideVisibleInstances(const std::set& exceptions = std::set()); @@ -126,23 +126,23 @@ public: static void registerControlVariables(); // Callback wrappers - static void toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& key = LLSD(LLUUID())); + static void toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& key = LLSD()); // Typed find / get / show template - static T* findTypedInstance(const std::string& name, const LLSD& key = LLSD(LLUUID())) + static T* findTypedInstance(const std::string& name, const LLSD& key = LLSD()) { return dynamic_cast(findInstance(name, key)); } template - static T* getTypedInstance(const std::string& name, const LLSD& key = LLSD(LLUUID())) + static T* getTypedInstance(const std::string& name, const LLSD& key = LLSD()) { return dynamic_cast(getInstance(name, key)); } template - static T* showTypedInstance(const std::string& name, const LLSD& key = LLSD(LLUUID()), BOOL focus = FALSE) + static T* showTypedInstance(const std::string& name, const LLSD& key = LLSD(), BOOL focus = FALSE) { return dynamic_cast(showInstance(name, key, focus)); } diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index a89ae4a2dc..5b274dd389 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -287,10 +287,10 @@ void LLNearbyChat::setVisible(BOOL visible) { LLIMConversation::setVisible(visible); - if(visible) - { - removeScreenChat(); - } + if(visible) + { + removeScreenChat(); + } setFocus(visible); } @@ -327,7 +327,7 @@ void LLNearbyChat::addToHost() mIsHostSet = true; } -} + } bool LLNearbyChat::isHostSet() { @@ -722,7 +722,7 @@ void LLNearbyChat::sendChatFromViewer(const LLWString &wtext, EChatType type, BO send_chat_from_viewer(utf8_out_text, type, channel); } -// static +// static bool LLNearbyChat::isWordsName(const std::string& name) { // checking to see if it's display name plus username in parentheses -- cgit v1.2.3 From 23d58c0c0906bd5434611cc73da9437ec7a5b830 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 22 Oct 2012 17:31:51 -0700 Subject: CHUI-433: Implemented an alternate solution to the problem. The original solution was ambiguous and incomplete and also preserved an existing hack. The new solution removes a hack/deprecated code (setActiveSession/getActiveSession functions). Basically, a toast message is not displayed if the user already has the conversation in focus. When the conversation floater loses focus toasts message will be displayed for that conversation. --- indra/newview/llimconversation.cpp | 2 -- indra/newview/llimview.cpp | 30 ++++++----------------------- indra/newview/llimview.h | 7 ------- indra/newview/llnotificationhandlerutil.cpp | 17 ---------------- 4 files changed, 6 insertions(+), 50 deletions(-) diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index f4b8d39cd0..74bf8cb6fe 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -204,7 +204,6 @@ void LLIMConversation::onFocusReceived() if (mSessionID.notNull() && isInVisibleChain()) { - LLIMModel::getInstance()->setActiveSessionID(mSessionID); LLIMModel::instance().sendNoUnreadMessages(mSessionID); } @@ -213,7 +212,6 @@ void LLIMConversation::onFocusReceived() void LLIMConversation::onFocusLost() { - LLIMModel::getInstance()->resetActiveSessionID(); setBackgroundOpaque(false); LLTransientDockableFloater::onFocusLost(); } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 572f36ff7d..4c5631d5e1 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -118,11 +118,12 @@ void toast_callback(const LLSD& msg){ return; } - // check whether incoming IM belongs to an active session or not - if (LLIMModel::getInstance()->getActiveSessionID() == msg["session_id"]) - { - return; - } + // Skip toasting if we have open window of IM with this session id + LLIMFloater* open_im_floater = LLIMFloater::findInstance(msg["session_id"]); + if (open_im_floater && open_im_floater->isInVisibleChain() && open_im_floater->hasFocus()) + { + return; + } // Skip toasting for system messages if (msg["from_id"].asUUID() == LLUUID::null) @@ -144,30 +145,11 @@ void toast_callback(const LLSD& msg){ return; } - // Skip toasting if we have open window of IM with this session id - LLIMFloater* open_im_floater = LLIMFloater::findInstance(msg["session_id"]); - if (open_im_floater && open_im_floater->isInVisibleChain() && open_im_floater->hasFocus()) - { - return; - } - LLAvatarNameCache::get(msg["from_id"].asUUID(), boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); } -void LLIMModel::setActiveSessionID(const LLUUID& session_id) -{ - // check if such an ID really exists - if (!findIMSession(session_id)) - { - llwarns << "Trying to set as active a non-existent session!" << llendl; - return; - } - - mActiveSessionID = session_id; -} - LLIMModel::LLIMModel() { addNewMsgCallback(boost::bind(&LLIMFloater::newIMCallback, _1)); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 00b67f520c..054388bc6c 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -147,13 +147,6 @@ public: LLIMModel(); - - //we should control the currently active session - LLUUID mActiveSessionID; - void setActiveSessionID(const LLUUID& session_id); - void resetActiveSessionID() { mActiveSessionID.setNull(); } - LLUUID getActiveSessionID() { return mActiveSessionID; } - /** Session id to session object */ std::map mId2SessionMap; diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 9fd73746e8..b4e8927879 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -93,13 +93,6 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, } else { - // store active session id - const LLUUID & active_session_id = - LLIMModel::instance().getActiveSessionID(); - - // set searched session as active to avoid IM toast popup - LLIMModel::instance().setActiveSessionID(session_id); - S32 unread = session->mNumUnread; S32 participant_unread = session->mParticipantUnreadMessageCount; LLIMModel::instance().addMessageSilently(session_id, from, from_id, @@ -110,16 +103,6 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, // update IM floater messages updateIMFLoaterMesages(session_id); - - // restore active session id - if (active_session_id.isNull()) - { - LLIMModel::instance().resetActiveSessionID(); - } - else - { - LLIMModel::instance().setActiveSessionID(active_session_id); - } } } -- cgit v1.2.3 From a780eb1a92811c2531c2fc1d211e8e5dd03da103 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 23 Oct 2012 13:20:53 +0300 Subject: CHUI-418 FIXED Check that mViewModelItem is not NULL --- indra/llui/llfolderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index c8b8bcae48..c31a832141 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -505,7 +505,7 @@ void LLFolderView::sanitizeSelection() // ensure that each ancestor is open and potentially passes filtering BOOL visible = false; - if(item->getViewModelItem()) + if(item->getViewModelItem() != NULL) { visible = item->getViewModelItem()->potentiallyVisible(); // initialize from filter state for this item } -- cgit v1.2.3 From 52a8ea96a1b9ad52a01c4617de63f8cc1bec1e31 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 23 Oct 2012 10:38:04 -0700 Subject: Backed out changeset: 174fccc7016d --- indra/llui/llui.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index f43409a1ff..41a948e545 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(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()))); + 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())); // 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(LLUUID()))); - LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD(LLUUID()))); + LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD())); + LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD())); // Parse the master list of commands LLCommandManager::load(); -- cgit v1.2.3 From 06978c99d12a1261f3834fa2ebc19e24c54fd1d4 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 24 Oct 2012 13:06:30 +0300 Subject: CHUI-430 FIXED Open Nearby chat if is is the only conversation in the list. --- indra/newview/llimfloatercontainer.cpp | 16 ++++++++++++++++ indra/newview/llimfloatercontainer.h | 1 + 2 files changed, 17 insertions(+) diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index cf4d054dd5..7821f2ee0d 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -222,6 +222,7 @@ BOOL LLIMFloaterContainer::postBuild() void LLIMFloaterContainer::onOpen(const LLSD& key) { LLMultiFloater::onOpen(key); + openNearbyChat(); } // virtual @@ -508,6 +509,7 @@ void LLIMFloaterContainer::setVisible(BOOL visible) LLSD name("nearby_chat"); LLFloaterReg::toggleInstanceOrBringToFront(name); } + openNearbyChat(); } nearby_chat = LLFloaterReg::findTypedInstance("nearby_chat"); @@ -1491,4 +1493,18 @@ void LLIMFloaterContainer::toggleAllowTextChat(const LLUUID& participant_uuid) } } +void LLIMFloaterContainer::openNearbyChat() +{ + // If there's only one conversation in the container and that conversation is the nearby chat + //(which it should be...), open it so to make the list of participants visible. This happens to be the most common case when opening the Chat floater. + if(mConversationsItems.size() == 1) + { + LLConversationViewSession* nearby_chat = dynamic_cast(mConversationsWidgets[LLUUID()]); + if (nearby_chat) + { + nearby_chat->setOpen(TRUE); + } + } +} + // EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index ba2d085858..75fed18502 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -138,6 +138,7 @@ private: void moderateVoiceAllParticipants(bool unmute); void moderateVoiceParticipant(const LLUUID& avatar_id, bool unmute); void toggleAllowTextChat(const LLUUID& participant_uuid); + void openNearbyChat(); LLButton* mExpandCollapseBtn; LLLayoutPanel* mMessagesPane; -- cgit v1.2.3 From a9f8b945519eece7943694f7ac8c200828e5adfa Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 24 Oct 2012 10:51:29 -0700 Subject: CHUI-363: Problem: Nearby chat is a set to be a null converstation. Because of this, when the voice indicator was set to only show for active conversations...voice indicators inside null conversations were not being turned toggled. Resolution: Now will adjust the speaker indicator even if it exists in a null (nearby chat) conversation. --- indra/newview/llspeakingindicatormanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp index 9b38bf22ff..900379ae1e 100644 --- a/indra/newview/llspeakingindicatormanager.cpp +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -241,7 +241,7 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea BOOL switch_current_on = switch_on; // we should show indicator for specified voice session only if this is current channel. EXT-5562. - if (switch_current_on && indicator->getTargetSessionID().notNull()) + if (switch_current_on) { switch_current_on = indicator->getTargetSessionID() == session_id; LL_DEBUGS("SpeakingIndicator") << "Session: " << session_id << ", target: " << indicator->getTargetSessionID() << ", the same? = " << switch_current_on << LL_ENDL; -- cgit v1.2.3 From b77e2f17aa9755120032ee977d34e9e923cba0be Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 24 Oct 2012 16:02:58 -0700 Subject: CHUI-449: Problem: When a toast was clicked, the conversation floater was displayed without selecting the conversation line item. Resolution: Added a function that will show the conversation floater container and then trigger selecting the conversation line item. When the conversation line item is selecting this implicitly will cause the correct conversation floater to be displayed. --- indra/newview/llconversationview.cpp | 27 ++++++++++----------------- indra/newview/llimfloatercontainer.cpp | 6 ++++++ indra/newview/llimfloatercontainer.h | 2 ++ indra/newview/llimview.cpp | 3 ++- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 9144f402b4..92493194b8 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -437,29 +437,22 @@ void LLConversationViewParticipant::selectItem() LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance(); LLFloater* session_floater; - //Only execute when switching floaters (conversations) - if(vmi && vmi->getUUID() != container->getSelectedSession()) + if(vmi) { - //When null, show the nearby chat conversation floater - if(vmi->getUUID().isNull()) + session_floater = LLIMConversation::getConversation(vmi->getUUID()); + + //Only execute when switching floaters (conversations) + if(vmi->getUUID() != container->getSelectedSession()) { - LLNearbyChat* nearbyChat = LLFloaterReg::findTypedInstance("nearby_chat"); - nearbyChat->show(); + container->selectFloater(session_floater); + // Store the active session + container->setSelectedSession(vmi->getUUID()); } - //Otherwise, show the IM conversation floater + //Focus the current conversation floater (it is already visible so just focus it) else { - LLIMFloater::show(vmi->getUUID()); + session_floater->setFocus(TRUE); } - - // Store the active session - container->setSelectedSession(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(); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 7821f2ee0d..0538a286ce 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -1089,6 +1089,12 @@ bool LLIMFloaterContainer::checkContextMenuItem(const LLSD& userdata) return false; } +void LLIMFloaterContainer::showConversation(const LLUUID& session_id) +{ + setVisibleAndFrontmost(false); + setConvItemSelect(session_id); +} + //Will select only the conversation item void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id) { diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 75fed18502..b884ad5d4b 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -65,6 +65,8 @@ public: /*virtual*/ void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); + + void showConversation(const LLUUID& session_id); void setConvItemSelect(const LLUUID& session_id); void setItemSelect(const LLUUID& session_id); /*virtual*/ void tabClose(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 4c5631d5e1..d5f1e81933 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -49,6 +49,7 @@ #include "llcallingcard.h" #include "llchat.h" #include "llimfloater.h" +#include "llimfloatercontainer.h" #include "llgroupiconctrl.h" #include "llmd5.h" #include "llmutelist.h" @@ -108,7 +109,7 @@ static void on_avatar_name_cache_toast(const LLUUID& agent_id, args["FROM"] = av_name.getCompleteName(); args["FROM_ID"] = msg["from_id"]; args["SESSION_ID"] = msg["session_id"]; - LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLIMFloater::show, msg["session_id"].asUUID())); + LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLIMFloaterContainer::showConversation, LLIMFloaterContainer::getInstance(), msg["session_id"].asUUID())); } void toast_callback(const LLSD& msg){ -- cgit v1.2.3 From 63548b973e6de392f2bf209b3405b1dde78bda03 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 25 Oct 2012 11:43:18 -0700 Subject: CHUI-449: Got rid of a function called setItemSelect(), I wrote this code and it doesn't have a purpose anymore since I can use setConvItemSelect() instead. Also now torn off, minimized conversations are selected when clicking a toast for that conversation. Resolution: Adjusted setConvItemSelect() to be less strict when trying to select an item, now as long as the function is called it will attempt to select the conversation line item. --- indra/newview/llconversationview.cpp | 8 +++----- indra/newview/llimfloatercontainer.cpp | 27 ++------------------------- indra/newview/llimfloatercontainer.h | 1 - 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 92493194b8..de0c65e24f 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -448,11 +448,9 @@ void LLConversationViewParticipant::selectItem() // Store the active session container->setSelectedSession(vmi->getUUID()); } - //Focus the current conversation floater (it is already visible so just focus it) - else - { - session_floater->setFocus(TRUE); - } + + //Redirect focus to the conversation floater + session_floater->setFocus(TRUE); } LLFolderViewItem::selectItem(); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 0538a286ce..ebb732b995 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -104,7 +104,7 @@ void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::str void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) { - setItemSelect(session_id); + setConvItemSelect(session_id); } void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id) @@ -1099,35 +1099,12 @@ void LLIMFloaterContainer::showConversation(const LLUUID& session_id) void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id) { LLFolderViewItem* widget = mConversationsWidgets[session_id]; - if (widget && mSelectedSession != session_id) + if (widget) { - mSelectedSession = session_id; (widget->getRoot())->setSelection(widget, FALSE, FALSE); } } -//Will select the conversation/participant item -void LLIMFloaterContainer::setItemSelect(const LLUUID& session_id) -{ - - if(mConversationsRoot->getCurSelectedItem() && mConversationsRoot->getCurSelectedItem()->getParentFolder()) - { - //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); - - // Scroll to selected item - mConversationsRoot->scrollToShowSelection(); - } - } -} - void LLIMFloaterContainer::setTimeNow(const LLUUID& session_id, const LLUUID& participant_id) { diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index b884ad5d4b..e69359321a 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -68,7 +68,6 @@ public: void showConversation(const LLUUID& session_id); void setConvItemSelect(const LLUUID& session_id); - void setItemSelect(const LLUUID& session_id); /*virtual*/ void tabClose(); static LLFloater* getCurrentVoiceFloater(); -- cgit v1.2.3 From 7127ea071922ee703cab56439a379f475cd5e4e7 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 25 Oct 2012 14:17:10 -0700 Subject: CHUI-449: Post code review with Merov, adjusted setConvItemSelect() fuction to be called selectConversation(). --- indra/newview/llimfloatercontainer.cpp | 8 ++++---- indra/newview/llimfloatercontainer.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index ebb732b995..bd7d570154 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -104,7 +104,7 @@ void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::str void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) { - setConvItemSelect(session_id); + selectConversation(session_id); } void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id) @@ -1092,11 +1092,11 @@ bool LLIMFloaterContainer::checkContextMenuItem(const LLSD& userdata) void LLIMFloaterContainer::showConversation(const LLUUID& session_id) { setVisibleAndFrontmost(false); - setConvItemSelect(session_id); + selectConversation(session_id); } //Will select only the conversation item -void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id) +void LLIMFloaterContainer::selectConversation(const LLUUID& session_id) { LLFolderViewItem* widget = mConversationsWidgets[session_id]; if (widget) @@ -1210,7 +1210,7 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid, bool isWi if (isWidgetSelected) { - setConvItemSelect(uuid); + selectConversation(uuid); } // set the widget to minimized mode if conversations pane is collapsed diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index e69359321a..7d13b37b31 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -67,7 +67,7 @@ public: LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); void showConversation(const LLUUID& session_id); - void setConvItemSelect(const LLUUID& session_id); + void selectConversation(const LLUUID& session_id); /*virtual*/ void tabClose(); static LLFloater* getCurrentVoiceFloater(); -- cgit v1.2.3 From 8f1049b2f8659b039752ee23017c1f30fa6d2725 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 26 Oct 2012 15:22:31 +0300 Subject: CHUI-457 FIXED Check that selected participant is not self before performing actions. --- indra/newview/llimfloatercontainer.cpp | 112 +++++++++++++++++---------------- 1 file changed, 57 insertions(+), 55 deletions(-) diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index bd7d570154..b98558c47b 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -825,62 +825,64 @@ void LLIMFloaterContainer::doToParticipants(const std::string& command, uuid_vec if(selectedIDS.size() > 0) { const LLUUID& userID = selectedIDS.front(); - - if ("view_profile" == command) - { - LLAvatarActions::showProfile(userID); - } - else if("im" == command) - { - LLAvatarActions::startIM(userID); - } - else if("offer_teleport" == command) - { - LLAvatarActions::offerTeleport(selectedIDS); - } - else if("voice_call" == command) - { - LLAvatarActions::startCall(userID); - } - else if("chat_history" == command) - { - LLAvatarActions::viewChatHistory(userID); - } - else if("add_friend" == command) - { - LLAvatarActions::requestFriendshipDialog(userID); - } - else if("remove_friend" == command) - { - LLAvatarActions::removeFriendDialog(userID); - } - else if("invite_to_group" == command) - { - LLAvatarActions::inviteToGroup(userID); - } - else if("map" == command) - { - LLAvatarActions::showOnMap(userID); - } - else if("share" == command) - { - LLAvatarActions::share(userID); - } - else if("pay" == command) + if(gAgent.getID() != userID) { - LLAvatarActions::pay(userID); - } - else if("block_unblock" == command) - { - LLAvatarActions::toggleBlock(userID); - } - else if("selected" == command || "mute_all" == command || "unmute_all" == command) - { - moderateVoice(command, userID); - } - else if ("toggle_allow_text_chat" == command) - { - toggleAllowTextChat(userID); + if ("view_profile" == command) + { + LLAvatarActions::showProfile(userID); + } + else if("im" == command) + { + LLAvatarActions::startIM(userID); + } + else if("offer_teleport" == command) + { + LLAvatarActions::offerTeleport(selectedIDS); + } + else if("voice_call" == command) + { + LLAvatarActions::startCall(userID); + } + else if("chat_history" == command) + { + LLAvatarActions::viewChatHistory(userID); + } + else if("add_friend" == command) + { + LLAvatarActions::requestFriendshipDialog(userID); + } + else if("remove_friend" == command) + { + LLAvatarActions::removeFriendDialog(userID); + } + else if("invite_to_group" == command) + { + LLAvatarActions::inviteToGroup(userID); + } + else if("map" == command) + { + LLAvatarActions::showOnMap(userID); + } + else if("share" == command) + { + LLAvatarActions::share(userID); + } + else if("pay" == command) + { + LLAvatarActions::pay(userID); + } + else if("block_unblock" == command) + { + LLAvatarActions::toggleBlock(userID); + } + else if("selected" == command || "mute_all" == command || "unmute_all" == command) + { + moderateVoice(command, userID); + } + else if ("toggle_allow_text_chat" == command) + { + toggleAllowTextChat(userID); + } } } } -- cgit v1.2.3 From a815585fd7de0f5aba60739127f473fd9d22ccfc Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Fri, 26 Oct 2012 19:33:31 +0300 Subject: CHUI-439 (Conversation floater is automatically unminimized when a selected user is removed from nearby chat participant list after teleport) CHUI-438 (Conversation remains transparent after teleport with a participant selected in nearby chat) --- indra/llui/llfolderviewitem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 0b04288950..4825fc613c 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -1473,6 +1473,8 @@ void LLFolderViewFolder::destroyView() // doesn't delete it. void LLFolderViewFolder::extractItem( LLFolderViewItem* item ) { + if (item->isSelected()) + getRoot()->clearSelection(); items_t::iterator it = std::find(mItems.begin(), mItems.end(), item); if(it == mItems.end()) { -- cgit v1.2.3 From 83562e059fdcf9f732bc8effba99d1e95d39cd36 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 26 Oct 2012 11:36:14 -0700 Subject: CHUI-383: Now a new conversation will not take focus. Instead a toast will appear. Problem: Each time a conversation was added, code would execute to add the conversation floater AND select the conversation. Resolution: This is no longer the expected behavior so adjusted LLIMFloater::addToHost() to only add a floater and not select/show the floater. If selection and/or showing is needed it seems to make sense that this is done outside LLIMFloater:addToHost(). --- indra/newview/llimfloater.cpp | 17 ++--------------- indra/newview/llimfloater.h | 2 +- indra/newview/llimfloatercontainer.cpp | 21 ++++++++++----------- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index e4032738a7..1af5def5f0 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -582,7 +582,7 @@ void LLIMFloater::onParticipantsListChanged(LLUICtrl* ctrl) } } -void LLIMFloater::addToHost(const LLUUID& session_id, const bool force) +void LLIMFloater::addToHost(const LLUUID& session_id) { if (!LLIMConversation::isChatMultiTab() || !gIMMgr->hasSession(session_id)) { @@ -607,20 +607,7 @@ void LLIMFloater::addToHost(const LLUUID& session_id, const bool force) LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; if (floater_container) { - floater_container->addFloater(floater, TRUE, i_pt); - } - } - - if (force) - { - if (floater_container && floater_container->getVisible()) - { - floater->openFloater(floater->getKey()); - floater->setVisible(TRUE); - } - else - { - floater->setVisible(FALSE); + floater_container->addFloater(floater, FALSE, i_pt); } } } diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index 26daf00afd..8a0d6f10e0 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -72,7 +72,7 @@ public: static LLIMFloater* findInstance(const LLUUID& session_id); static LLIMFloater* getInstance(const LLUUID& session_id); - static void addToHost(const LLUUID& session_id, const bool force = false); + static void addToHost(const LLUUID& session_id); // LLFloater overrides /*virtual*/ void onClose(bool app_quitting); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index bd7d570154..71487eb382 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -98,8 +98,8 @@ 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, true); + LLIMFloater::addToHost(session_id); + addConversationListItem(session_id); } void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) @@ -109,8 +109,8 @@ void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std: void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id) { - LLIMFloater::addToHost(session_id, true); - addConversationListItem(session_id, true); + LLIMFloater::addToHost(session_id); + addConversationListItem(session_id); } void LLIMFloaterContainer::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) @@ -1208,16 +1208,15 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid, bool isWi current_participant_model++; } - if (isWidgetSelected) - { - selectConversation(uuid); - } - // set the widget to minimized mode if conversations pane is collapsed widget->toggleMinimizedMode(mConversationsPane->isCollapsed()); - // scroll to newly added item - mConversationsRoot->scrollToShowSelection(); + if (isWidgetSelected) + { + selectConversation(uuid); + // scroll to newly added item + mConversationsRoot->scrollToShowSelection(); + } return; } -- cgit v1.2.3 From 1a1a0b91c0c4400ec3febac183124314f9226127 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 26 Oct 2012 16:49:22 -0700 Subject: CHUI-383: Realized that prior changes for this bug caused a regress. The regress was using the people panel or a notecard to start a im/call with a user. When doing this the conversation line item would not be focused. Resolution: Changed all calls to LLIMFloater::show() to LLIMFloaterContainer::showConversation(), which will first select the conversation line item and then show the corresponding conversation floater. --- indra/newview/llavataractions.cpp | 6 +++--- indra/newview/llchiclet.cpp | 3 ++- indra/newview/llgroupactions.cpp | 4 ++-- indra/newview/llimfloatercontainer.cpp | 2 +- indra/newview/llinventorybridge.cpp | 4 ++-- indra/newview/llinventorypanel.cpp | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 7322b3bb0b..13262efb3b 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -56,6 +56,7 @@ #include "llinventorybridge.h" #include "llinventorymodel.h" // for gInventory.findCategoryUUIDForType #include "llinventorypanel.h" +#include "llimfloatercontainer.h" #include "llimview.h" // for gIMMgr #include "llmutelist.h" #include "llnotificationsutil.h" // for LLNotificationsUtil @@ -67,7 +68,6 @@ #include "llviewerobjectlist.h" #include "llviewermessage.h" // for handle_lure #include "llviewerregion.h" -#include "llimfloater.h" #include "lltrans.h" #include "llcallingcard.h" #include "llslurl.h" // IDEVO @@ -184,7 +184,7 @@ static void on_avatar_name_cache_start_im(const LLUUID& agent_id, LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, agent_id); if (session_id != LLUUID::null) { - LLIMFloater::show(session_id); + LLIMFloaterContainer::getInstance()->showConversation(session_id); } make_ui_sound("UISndStartIM"); } @@ -302,7 +302,7 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids, const LLUUID& float return; } - LLIMFloater::show(session_id); + LLIMFloaterContainer::getInstance()->showConversation(session_id); make_ui_sound("UISndStartIM"); } diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 17181edffc..e328186fd6 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -34,6 +34,7 @@ #include "llgroupactions.h" #include "lliconctrl.h" #include "llimfloater.h" +#include "llimfloatercontainer.h" #include "llimview.h" #include "llfloaterreg.h" #include "lllocalcliprect.h" @@ -1196,7 +1197,7 @@ void LLChicletPanel::onCurrentVoiceChannelChanged(const LLUUID& session_id) chiclet->setShowSpeaker(true); if (gSavedSettings.getBOOL("OpenIMOnVoice")) { - LLIMFloater::show(chiclet->getSessionId()); + LLIMFloaterContainer::getInstance()->showConversation(session_id); } } } diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 623ebb76f2..15eca39bce 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -36,10 +36,10 @@ #include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" #include "llgroupmgr.h" +#include "llimfloatercontainer.h" #include "llimview.h" // for gIMMgr #include "llnotificationsutil.h" #include "llstatusbar.h" // can_afford_transaction() -#include "llimfloater.h" #include "groupchatlistener.h" // @@ -335,7 +335,7 @@ LLUUID LLGroupActions::startIM(const LLUUID& group_id) group_id); if (session_id != LLUUID::null) { - LLIMFloater::show(session_id); + LLIMFloaterContainer::getInstance()->showConversation(session_id); } make_ui_sound("UISndStartIM"); return session_id; diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 6377ffeecf..4d2201ebb9 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -128,7 +128,7 @@ void LLIMFloaterContainer::onCurrentChannelChanged(const LLUUID& session_id) { if (session_id != LLUUID::null) { - LLIMFloater::show(session_id); + LLIMFloaterContainer::getInstance()->showConversation(session_id); } } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 28c2edbe84..5d8d82b226 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -46,7 +46,7 @@ #include "llfriendcard.h" #include "llgesturemgr.h" #include "llgiveinventory.h" -#include "llimfloater.h" +#include "llimfloatercontainer.h" #include "llimview.h" #include "llclipboard.h" #include "llinventorydefines.h" @@ -4704,7 +4704,7 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act LLUUID session_id = gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID()); if (session_id != LLUUID::null) { - LLIMFloater::show(session_id); + LLIMFloaterContainer::getInstance()->showConversation(session_id); } } } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index a8d99ad7de..dafc71b59c 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -39,7 +39,7 @@ #include "llfloatersidepanelcontainer.h" #include "llfolderview.h" #include "llfolderviewitem.h" -#include "llimfloater.h" +#include "llimfloatercontainer.h" #include "llimview.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" @@ -1087,7 +1087,7 @@ bool LLInventoryPanel::beginIMSession() LLUUID session_id = gIMMgr->addSession(name, type, members[0], members); if (session_id != LLUUID::null) { - LLIMFloater::show(session_id); + LLIMFloaterContainer::getInstance()->showConversation(session_id); } return true; -- cgit v1.2.3