From 11ef9f3d41a2e628e1ded8dcb0a306fe328ae0ce Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 23 Nov 2009 16:29:10 +0200 Subject: Work on normal task EXT-2640 (Create a tabbed IM multifloater) - disabled Transient & Dockable functionality of IM Floaters to do not have collisions with multifloater - remove debug attributes in xml --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 4a487bd5a7..d789139aa8 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -53,6 +53,10 @@ #include "lltransientfloatermgr.h" #include "llinventorymodel.h" +#ifdef USE_IM_CONTAINER + #include "llimfloatercontainer.h" // to replace separate IM Floaters with multifloater container +#endif + LLIMFloater::LLIMFloater(const LLUUID& session_id) @@ -257,7 +261,11 @@ BOOL LLIMFloater::postBuild() //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" //see LLFloaterIMPanel for how it is done (IB) +#ifdef USE_IM_CONTAINER + return LLFloater::postBuild(); +#else return LLDockableFloater::postBuild(); +#endif } // virtual @@ -318,6 +326,7 @@ void LLIMFloater::onSlide() //static LLIMFloater* LLIMFloater::show(const LLUUID& session_id) { +#ifndef USE_IM_CONTAINER //hide all LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); @@ -329,12 +338,23 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) floater->setVisible(false); } } +#endif LLIMFloater* floater = LLFloaterReg::showTypedInstance("impanel", session_id); floater->updateMessages(); floater->mInputEditor->setFocus(TRUE); +#ifdef USE_IM_CONTAINER + +// LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; + // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists + LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; + + // *TODO: mantipov: validate if floater was torn off. In this case it's no necessary to show container + LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance("im_container"); + floater_container->addFloater(floater, TRUE, i_pt); +#else if (floater->getDockControl() == NULL) { LLChiclet* chiclet = @@ -352,6 +372,7 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) floater->setDockControl(new LLDockControl(chiclet, floater, floater->getDockTongue(), LLDockControl::TOP, boost::bind(&LLIMFloater::getAllowedRect, floater, _1))); } +#endif return floater; } @@ -368,7 +389,9 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock) (LLNotificationsUI::LLChannelManager::getInstance()-> findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); +#ifndef USE_IM_CONTAINER LLTransientDockableFloater::setDocked(docked, pop_on_undock); +#endif // update notification channel state if(channel) @@ -394,6 +417,7 @@ void LLIMFloater::setVisible(BOOL visible) //static bool LLIMFloater::toggle(const LLUUID& session_id) { +#ifndef USE_IM_CONTAINER LLIMFloater* floater = LLFloaterReg::findTypedInstance("impanel", session_id); if (floater && floater->getVisible() && floater->isDocked()) { @@ -409,6 +433,7 @@ bool LLIMFloater::toggle(const LLUUID& session_id) return true; } else +#endif { // ensure the list of messages is updated when floater is made visible show(session_id); -- cgit v1.2.3 From fb3b6145a880119999b66312275b1448da8a7e14 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 23 Nov 2009 17:47:40 +0200 Subject: Work on normal task EXT-2640 (Create a tabbed IM multifloater) - disable adding torn off IM Floaters into container when chiclet is clicked --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index d789139aa8..38a9fec192 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -326,7 +326,11 @@ void LLIMFloater::onSlide() //static LLIMFloater* LLIMFloater::show(const LLUUID& session_id) { -#ifndef USE_IM_CONTAINER +#ifdef USE_IM_CONTAINER + LLIMFloater* target_floater = findInstance(session_id); + bool not_existed = NULL == target_floater; + +#else //hide all LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); @@ -346,14 +350,16 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) floater->mInputEditor->setFocus(TRUE); #ifdef USE_IM_CONTAINER + // do not add existed floaters to avoid adding torn off instances + if (not_existed) + { + // LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; + // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists + LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; -// LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; - // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists - LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; - - // *TODO: mantipov: validate if floater was torn off. In this case it's no necessary to show container - LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance("im_container"); - floater_container->addFloater(floater, TRUE, i_pt); + LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance("im_container"); + floater_container->addFloater(floater, TRUE, i_pt); + } #else if (floater->getDockControl() == NULL) { -- cgit v1.2.3 From 9e403da7b0fd013371e73820b8aa70820f4f620b Mon Sep 17 00:00:00 2001 From: Sergey Borushevsky Date: Mon, 23 Nov 2009 20:34:06 +0200 Subject: Implemented major sub-task EXT-2517 (Add support for the viewer 1.23 chat history style (widget-less)) --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 66 +++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 37 deletions(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 38a9fec192..795770d3db 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -110,10 +110,10 @@ void LLIMFloater::onFocusReceived() // virtual void LLIMFloater::onClose(bool app_quitting) { + if (!gIMMgr->hasSession(mSessionID)) return; + setTyping(false); - // SJB: We want the close button to hide the session window, not end it - // *NOTE: Yhis is functional, but not ideal - it's still closing the floater; we really want to change the behavior of the X button instead. - //gIMMgr->leaveSession(mSessionID); + gIMMgr->leaveSession(mSessionID); } /* static */ @@ -385,7 +385,7 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) void LLIMFloater::getAllowedRect(LLRect& rect) { - rect = gViewerWindow->getWorldViewRectScaled(); + rect = gViewerWindow->getWorldViewRectRaw(); } void LLIMFloater::setDocked(bool docked, bool pop_on_undock) @@ -482,6 +482,8 @@ void LLIMFloater::sessionInitReplyReceived(const LLUUID& im_session_id) void LLIMFloater::updateMessages() { + bool use_plain_text_chat_history = gSavedSettings.getBOOL("PlainTextChatHistory"); + std::list messages; LLIMModel::instance().getMessages(mSessionID, messages, mLastMessageIndex+1); @@ -507,39 +509,7 @@ void LLIMFloater::updateMessages() chat.mText = message; chat.mTimeStr = time; - //Handle IRC styled /me messages. - std::string prefix = message.substr(0, 4); - if (prefix == "/me " || prefix == "/me'") - { - - LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); - LLViewerChat::getChatColor(chat,txt_color); - LLFontGL* fontp = LLViewerChat::getChatFont(); - std::string font_name = LLFontGL::nameFromFont(fontp); - std::string font_size = LLFontGL::sizeFromFont(fontp); - LLStyle::Params append_style_params; - append_style_params.color(txt_color); - append_style_params.readonly_color(txt_color); - append_style_params.font.name(font_name); - append_style_params.font.size(font_size); - - if (from.size() > 0) - { - append_style_params.font.style = "ITALIC"; - chat.mText = from; - mChatHistory->appendWidgetMessage(chat, append_style_params); - } - - message = message.substr(3); - append_style_params.font.style = "ITALIC"; - mChatHistory->appendText(message, FALSE, append_style_params); - } - else - { - chat.mText = message; - mChatHistory->appendWidgetMessage(chat); - } - + mChatHistory->appendMessage(chat, use_plain_text_chat_history); mLastMessageIndex = msg["index"].asInteger(); } } @@ -670,6 +640,28 @@ void LLIMFloater::processAgentListUpdates(const LLSD& body) } } +void LLIMFloater::updateChatHistoryStyle() +{ + mChatHistory->clear(); + mLastMessageIndex = -1; + updateMessages(); +} + +void LLIMFloater::processChatHistoryStyleUpdate(const LLSD& newvalue) +{ + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); + iter != inst_list.end(); ++iter) + { + LLIMFloater* floater = dynamic_cast(*iter); + if (floater) + { + floater->updateChatHistoryStyle(); + } + } + +} + void LLIMFloater::processSessionUpdate(const LLSD& session_update) { // *TODO : verify following code when moderated mode will be implemented -- cgit v1.2.3