From 4ea73df484d22815026367771f9d728d755f6274 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 23 Aug 2012 11:32:20 -0700 Subject: CHUI-282 : WIP : Further separate view from model for llconversation items --- indra/newview/llconversationmodel.cpp | 14 -------------- indra/newview/llconversationmodel.h | 2 -- indra/newview/llconversationview.cpp | 13 +++++++++++++ indra/newview/llconversationview.h | 1 + indra/newview/llimfloatercontainer.cpp | 6 +++--- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 42ed7603d1..832dc3c3e4 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -28,7 +28,6 @@ #include "llviewerprecompiledheaders.h" #include "llconversationmodel.h" -#include "llimconversation.h" // Conversation items LLConversationItem::LLConversationItem(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) : @@ -45,20 +44,7 @@ LLConversationItem::LLConversationItem(LLFolderViewModelInterface& root_view_mod { } - // Virtual action callbacks -void LLConversationItem::setVisibleIfDetached(BOOL visible) -{ - // Do this only if the conversation floater has been torn off (i.e. no multi floater host) and is not minimized - // Note: minimized dockable floaters are brought to front hence unminimized when made visible and we don't want that here - LLFloater* session_floater = LLIMConversation::getConversation(mUUID); - - if (session_floater && !session_floater->getHost() && !session_floater->isMinimized()) - { - session_floater->setVisible(visible); - } -} - void LLConversationItem::performAction(LLInventoryModel* model, std::string action) { } diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 1ce70d754b..cb03128cac 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -88,8 +88,6 @@ public: virtual void selectItem(void) { } virtual void showProperties(void); - void setVisibleIfDetached(BOOL visible); - // This method will be called to determine if a drop can be // performed, and will set drop to TRUE if a drop is // requested. diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 464d061a82..6cc911ecef 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -62,4 +62,17 @@ void LLConversationViewSession::selectItem() session_floater->setFocus(TRUE); } +void LLConversationViewSession::setVisibleIfDetached(BOOL visible) +{ + // Do this only if the conversation floater has been torn off (i.e. no multi floater host) and is not minimized + // Note: minimized dockable floaters are brought to front hence unminimized when made visible and we don't want that here + LLConversationItem* item = dynamic_cast(mViewModelItem); + LLFloater* session_floater = LLIMConversation::getConversation(item->getUUID()); + + if (session_floater && !session_floater->getHost() && !session_floater->isMinimized()) + { + session_floater->setVisible(visible); + } +} + // EOF diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index 743efb6384..6a51e719c8 100644 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -52,6 +52,7 @@ protected: public: virtual ~LLConversationViewSession( void ) { } virtual void selectItem(); + void setVisibleIfDetached(BOOL visible); }; #endif // LL_LLCONVERSATIONVIEW_H diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 29878cfc9e..38ac3eb9e4 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -328,10 +328,10 @@ void LLIMFloaterContainer::setVisible(BOOL visible) // We need to show/hide all the associated conversations that have been torn off // (and therefore, are not longer managed by the multifloater), // so that they show/hide with the conversations manager. - conversations_items_map::iterator item_it = mConversationsItems.begin(); - for (;item_it != mConversationsItems.end(); ++item_it) + conversations_widgets_map::iterator item_it = mConversationsWidgets.begin(); + for (;item_it != mConversationsWidgets.end(); ++item_it) { - LLConversationItem* item = item_it->second; + LLConversationViewSession* item = dynamic_cast(item_it->second); item->setVisibleIfDetached(visible); } -- cgit v1.2.3