summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2009-11-30 15:35:48 +0200
committerYuri Chebotarev <ychebotarev@productengine.com>2009-11-30 15:35:48 +0200
commit9e0e0e4d54c73288a159beae3a654771a75f3714 (patch)
tree30a0b9d4add0a9b0ca39ecb0c41c3cae22572fda
parentd5152b3ea7acfefc56d648d1581fc541fd7d2ea6 (diff)
no ticket. addition to "(EXT-2894)- Add support for the viewer 1.23 chat history style (widget-less)"
change all messages style when chaning chat style in preference. --HG-- branch : product-engine
-rw-r--r--indra/newview/llfloaterpreference.cpp3
-rw-r--r--indra/newview/llnearbychat.cpp26
-rw-r--r--indra/newview/llnearbychat.h8
3 files changed, 35 insertions, 2 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 83c784c1f7..5128a7b861 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -106,6 +106,7 @@
#include "llviewermedia.h"
#include "llpluginclassmedia.h"
#include "llteleporthistorystorage.h"
+#include "llnearbychat.h"
#include <boost/regex.hpp>
@@ -361,6 +362,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
BOOL LLFloaterPreference::postBuild()
{
gSavedSettings.getControl("PlainTextChatHistory")->getSignal()->connect(boost::bind(&LLIMFloater::processChatHistoryStyleUpdate, _2));
+
+ gSavedSettings.getControl("PlainTextChatHistory")->getSignal()->connect(boost::bind(&LLNearbyChat::processChatHistoryStyleUpdate, _2));
LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core");
if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 8f1dec1431..ee3be0a5e3 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -57,6 +57,7 @@
#include "lltrans.h"
#include "llbottomtray.h"
#include "llnearbychatbar.h"
+#include "llfloaterreg.h"
static const S32 RESIZE_BAR_THICKNESS = 3;
@@ -145,7 +146,7 @@ std::string appendTime()
return timeStr;
}
-void LLNearbyChat::addMessage(const LLChat& chat)
+void LLNearbyChat::addMessage(const LLChat& chat,bool archive)
{
if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
{
@@ -207,6 +208,13 @@ void LLNearbyChat::addMessage(const LLChat& chat)
mChatHistory->appendMessage(chat,use_plain_text_chat_history);
}
}
+
+ if(archive)
+ {
+ mMessageArchive.push_back(chat);
+ if(mMessageArchive.size()>200)
+ mMessageArchive.erase(mMessageArchive.begin());
+ }
}
void LLNearbyChat::onNearbySpeakers()
@@ -256,3 +264,19 @@ void LLNearbyChat::getAllowedRect(LLRect& rect)
{
rect = gViewerWindow->getWorldViewRectScaled();
}
+
+void LLNearbyChat::updateChatHistoryStyle()
+{
+ mChatHistory->clear();
+ for(std::vector<LLChat>::iterator it = mMessageArchive.begin();it!=mMessageArchive.end();++it)
+ {
+ addMessage(*it,false);
+ }
+}
+//static
+void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue)
+{
+ LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
+ if(nearby_chat)
+ nearby_chat->updateChatHistoryStyle();
+}
diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h
index efcaf4263b..1cbc2a3478 100644
--- a/indra/newview/llnearbychat.h
+++ b/indra/newview/llnearbychat.h
@@ -47,7 +47,7 @@ public:
~LLNearbyChat();
BOOL postBuild ();
- void addMessage (const LLChat& message);
+ void addMessage (const LLChat& message,bool archive = true);
void onNearbyChatContextMenuItemClicked(const LLSD& userdata);
bool onNearbyChatCheckContextMenuItem(const LLSD& userdata);
@@ -57,6 +57,10 @@ public:
virtual void setRect (const LLRect &rect);
+ virtual void updateChatHistoryStyle();
+
+ static void processChatHistoryStyleUpdate(const LLSD& newvalue);
+
private:
virtual void applySavedVariables();
@@ -68,6 +72,8 @@ private:
private:
LLHandle<LLView> mPopupMenuHandle;
LLChatHistory* mChatHistory;
+
+ std::vector<LLChat> mMessageArchive;
};
#endif