diff options
| author | AlexanderP ProductEngine <apaschenko@productengine.com> | 2012-08-22 18:27:29 +0300 |
|---|---|---|
| committer | AlexanderP ProductEngine <apaschenko@productengine.com> | 2012-08-22 18:27:29 +0300 |
| commit | 14708a3ace184b0654ca7923732be6e06962d583 (patch) | |
| tree | 910de7b50613b61a868fd11ccd30afed7a1ab417 /indra/newview/llimconversation.cpp | |
| parent | 31d69a6bc5a81dc3e844138033e41e339dce3aa1 (diff) | |
CHUI_310 make NearbyChat a singletone
Diffstat (limited to 'indra/newview/llimconversation.cpp')
| -rw-r--r-- | indra/newview/llimconversation.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index ee7f58b01f..2212673d3a 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -81,13 +81,35 @@ LLIMConversation::~LLIMConversation() //static LLIMConversation* LLIMConversation::findConversation(const LLUUID& uuid) { - return LLFloaterReg::findTypedInstance<LLIMConversation>(uuid.isNull()? "chat_bar" : "impanel", LLSD(uuid)); + LLIMConversation* conv; + + if (uuid.isNull()) + { + conv = LLFloaterReg::findTypedInstance<LLIMConversation>("nearby_chat"); + } + else + { + conv = LLFloaterReg::findTypedInstance<LLIMConversation>("impanel", LLSD(uuid)); + } + + return conv; }; //static LLIMConversation* LLIMConversation::getConversation(const LLUUID& uuid) { - return LLFloaterReg::getTypedInstance<LLIMConversation>(uuid.isNull()? "chat_bar" : "impanel", LLSD(uuid)); + LLIMConversation* conv; + + if (uuid.isNull()) + { + conv = LLFloaterReg::getTypedInstance<LLIMConversation>("nearby_chat"); + } + else + { + conv = LLFloaterReg::getTypedInstance<LLIMConversation>("impanel", LLSD(uuid)); + } + + return conv; }; @@ -336,15 +358,15 @@ void LLIMConversation::processChatHistoryStyleUpdate() } } - LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - if (nearby_chat) + if (LLNearbyChat::instanceExists()) { - nearby_chat->reloadMessages(); + LLNearbyChat::instance().reloadMessages(); } } void LLIMConversation::updateCallBtnState(bool callIsActive) { +llwarns<<(this->getName())<<llendl; getChild<LLButton>("voice_call_btn")->setImageOverlay( callIsActive? getString("call_btn_stop") : getString("call_btn_start")); enableDisableCallBtn(); |
