summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimfloater.cpp')
-rw-r--r--indra/newview/llimfloater.cpp60
1 files changed, 49 insertions, 11 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 3e449e2c82..680106c7bb 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -40,9 +40,11 @@
#include "llbottomtray.h"
#include "llchannelmanager.h"
#include "llchiclet.h"
+#include "llfloaterchat.h"
#include "llfloaterreg.h"
#include "llimview.h"
#include "lllineeditor.h"
+#include "lllogchat.h"
#include "llpanelimcontrolpanel.h"
#include "llscreenchannel.h"
#include "lltrans.h"
@@ -90,16 +92,6 @@ void LLIMFloater::onClose(bool app_quitting)
gIMMgr->removeSession(mSessionID);
}
-void LLIMFloater::setMinimized(BOOL minimize)
-{
- if(!isDocked())
- {
- setVisible(!minimize);
- }
-
- LLFloater::setMinimized(minimize);
-}
-
/* static */
void LLIMFloater::newIMCallback(const LLSD& data){
@@ -203,6 +195,12 @@ BOOL LLIMFloater::postBuild()
setTitle(LLIMModel::instance().getName(mSessionID));
setDocked(true);
+ if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
+ {
+ LLLogChat::loadHistory(getTitle(), &chatFromLogFile, (void *)this);
+ }
+
+
return LLDockableFloater::postBuild();
}
@@ -316,13 +314,19 @@ void LLIMFloater::setVisible(BOOL visible)
bool LLIMFloater::toggle(const LLUUID& session_id)
{
LLIMFloater* floater = LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", session_id);
- if (floater && floater->getVisible())
+ if (floater && floater->getVisible() && floater->isDocked())
{
// clicking on chiclet to close floater just hides it to maintain existing
// scroll/text entry state
floater->setVisible(false);
return false;
}
+ else if(floater && !floater->isDocked())
+ {
+ floater->setVisible(TRUE);
+ floater->setFocus(TRUE);
+ return true;
+ }
else
{
// ensure the list of messages is updated when floater is made visible
@@ -419,3 +423,37 @@ void LLIMFloater::setTyping(BOOL typing)
{
}
+void LLIMFloater::chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata)
+{
+ if (!userdata) return;
+
+ LLIMFloater* self = (LLIMFloater*) userdata;
+ std::string message = line;
+ S32 im_log_option = gSavedPerAccountSettings.getS32("IMLogOptions");
+ switch (type)
+ {
+ case LLLogChat::LOG_EMPTY:
+ // add warning log enabled message
+ if (im_log_option!=LOG_CHAT)
+ {
+ message = LLTrans::getString("IM_logging_string");
+ }
+ break;
+ case LLLogChat::LOG_END:
+ // add log end message
+ if (im_log_option!=LOG_CHAT)
+ {
+ message = LLTrans::getString("IM_logging_string");
+ }
+ break;
+ case LLLogChat::LOG_LINE:
+ // just add normal lines from file
+ break;
+ default:
+ // nothing
+ break;
+ }
+
+ self->mHistoryEditor->appendText(message, true, LLStyle::Params().color(LLUIColorTable::instance().getColor("ChatHistoryTextColor")));
+ self->mHistoryEditor->blockUndo();
+}