diff options
Diffstat (limited to 'indra/newview/llfloaterchat.cpp')
-rw-r--r-- | indra/newview/llfloaterchat.cpp | 74 |
1 files changed, 19 insertions, 55 deletions
diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 61ef3abda6..8fcb7b985f 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -63,7 +63,6 @@ #include "llviewerwindow.h" #include "llviewercontrol.h" #include "lluictrlfactory.h" -#include "llchatbar.h" #include "lllogchat.h" #include "lltexteditor.h" #include "lltextparser.h" @@ -87,6 +86,7 @@ const F32 INSTANT_MSG_SIZE = 8.0f; const F32 CHAT_MSG_SIZE = 8.0f; + // // Global statics // @@ -96,7 +96,7 @@ LLColor4 get_text_color(const LLChat& chat); // Member Functions // LLFloaterChat::LLFloaterChat(const LLSD& seed) - : LLFloater(), + : LLFloater(seed), mPanel(NULL) { mFactoryMap["chat_panel"] = LLCallbackMap(createChatPanel, NULL); @@ -110,11 +110,6 @@ LLFloaterChat::~LLFloaterChat() // Children all cleaned up by default view destructor. } -void LLFloaterChat::setVisible(BOOL visible) -{ - LLFloater::setVisible( visible ); -} - void LLFloaterChat::draw() { // enable say and shout only when text available @@ -133,14 +128,11 @@ void LLFloaterChat::draw() BOOL LLFloaterChat::postBuild() { + // Hide the chat overlay when our history is visible. + mVisibleSignal.connect(boost::bind(&LLFloaterChat::updateConsoleVisibility, this)); + mPanel = (LLPanelActiveSpeakers*)getChild<LLPanel>("active_speakers_panel"); - LLChatBar* chat_barp = findChild<LLChatBar>("chat_panel", TRUE); - if (chat_barp) - { - chat_barp->setGestureCombo(getChild<LLComboBox>( "Gesture")); - } - childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes childSetVisible("Chat History Editor with mute",FALSE); childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this); @@ -148,34 +140,6 @@ BOOL LLFloaterChat::postBuild() return TRUE; } -// public virtual -void LLFloaterChat::onClose(bool app_quitting) -{ - if (getHost()) - { - getHost()->setVisible(FALSE); - } - else - { - setVisible(FALSE); - } -} - -void LLFloaterChat::onVisibilityChange(BOOL new_visibility) -{ - // Hide the chat overlay when our history is visible. - updateConsoleVisibility(); - - LLFloater::onVisibilityChange(new_visibility); -} - -void LLFloaterChat::setMinimized(BOOL minimized) -{ - LLFloater::setMinimized(minimized); - updateConsoleVisibility(); -} - - void LLFloaterChat::updateConsoleVisibility() { // determine whether we should show console due to not being visible @@ -218,7 +182,7 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& void log_chat_text(const LLChat& chat) { std::string histstr; - if (gSavedPerAccountSettings.getBOOL("LogChatTimestamp")) + if (gSavedPerAccountSettings.getBOOL("LogTimestamp")) histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + chat.mText; else histstr = chat.mText; @@ -228,7 +192,7 @@ void log_chat_text(const LLChat& chat) // static void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) { - if ( gSavedPerAccountSettings.getBOOL("LogChat") && log_to_file) + if ( (gSavedPerAccountSettings.getS32("IMLogOptions")!=LOG_IM) && log_to_file) { log_chat_text(chat); } @@ -368,11 +332,11 @@ void LLFloaterChat::addChat(const LLChat& chat, F32 size = CHAT_MSG_SIZE; if (chat.mSourceType == CHAT_SOURCE_SYSTEM) { - text_color = gSavedSkinSettings.getColor("SystemChatColor"); + text_color = LLUIColorTable::instance().getColor("SystemChatColor"); } else if(from_instant_message) { - text_color = gSavedSkinSettings.getColor("IMChatColor"); + text_color = LLUIColorTable::instance().getColor("IMChatColor"); size = INSTANT_MSG_SIZE; } // We display anything if it's not an IM. If it's an IM, check pref... @@ -382,7 +346,7 @@ void LLFloaterChat::addChat(const LLChat& chat, } } - if(from_instant_message && gSavedPerAccountSettings.getBOOL("LogChatIM")) + if(from_instant_message && (gSavedPerAccountSettings.getS32("IMLogOptions")== LOG_BOTH_TOGETHER)) log_chat_text(chat); if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory")) @@ -453,37 +417,37 @@ LLColor4 get_text_color(const LLChat& chat) switch(chat.mSourceType) { case CHAT_SOURCE_SYSTEM: - text_color = gSavedSkinSettings.getColor4("SystemChatColor"); + text_color = LLUIColorTable::instance().getColor("SystemChatColor"); break; case CHAT_SOURCE_AGENT: if (chat.mFromID.isNull()) { - text_color = gSavedSkinSettings.getColor4("SystemChatColor"); + text_color = LLUIColorTable::instance().getColor("SystemChatColor"); } else { if(gAgent.getID() == chat.mFromID) { - text_color = gSavedSkinSettings.getColor4("UserChatColor"); + text_color = LLUIColorTable::instance().getColor("UserChatColor"); } else { - text_color = gSavedSkinSettings.getColor4("AgentChatColor"); + text_color = LLUIColorTable::instance().getColor("AgentChatColor"); } } break; case CHAT_SOURCE_OBJECT: if (chat.mChatType == CHAT_TYPE_DEBUG_MSG) { - text_color = gSavedSkinSettings.getColor4("ScriptErrorColor"); + text_color = LLUIColorTable::instance().getColor("ScriptErrorColor"); } else if ( chat.mChatType == CHAT_TYPE_OWNER ) { - text_color = gSavedSkinSettings.getColor4("llOwnerSayChatColor"); + text_color = LLUIColorTable::instance().getColor("llOwnerSayChatColor"); } else { - text_color = gSavedSkinSettings.getColor4("ObjectChatColor"); + text_color = LLUIColorTable::instance().getColor("ObjectChatColor"); } break; default: @@ -558,6 +522,6 @@ void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) //static LLFloaterChat* LLFloaterChat::getInstance() { - LLFloater* inst = LLFloaterReg::getInstance("chat", LLSD()) ; - return dynamic_cast<LLFloaterChat*>(inst); + return LLFloaterReg::getTypedInstance<LLFloaterChat>("chat", LLSD()) ; + } |