summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloater.cpp
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2009-10-16 16:42:45 -0700
committerMark Palange (Mani) <palange@lindenlab.com>2009-10-16 16:42:45 -0700
commit3e10fa4d51a23bf6f1ced23e8d90c636d84fa5db (patch)
treed4991e4c1a9dd934f48d33804e55eb8ffa085679 /indra/newview/llimfloater.cpp
parente9f7205ba9f4dfb3422759218609b62d61972722 (diff)
parentf20e9521a9b70f4e83cbb6888feae08a70681ea7 (diff)
merge from latest svn/viewer-2-0 to hg/viewer-2-0
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();
+}