summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-08-29 19:19:42 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2012-08-29 19:19:42 -0700
commit73eec0321f79bb7ceeb2b2027e63660158413e5e (patch)
treee264a8962c34f0768bed34500d4af1af8a0eba27
parentbe61b5be2f4089e12ca25ca1ece13bd0fdaea543 (diff)
parent01a154809d650f7905aaa208150a1070b19e5c2b (diff)
merging in latest changes
-rw-r--r--indra/llcommon/llmemory.h2
-rw-r--r--indra/llmath/tests/alignment_test.cpp4
-rw-r--r--indra/llui/llfolderviewmodel.h9
-rw-r--r--indra/newview/app_settings/settings.xml11
-rwxr-xr-xindra/newview/llagent.cpp4
-rw-r--r--indra/newview/llcallfloater.cpp2
-rw-r--r--indra/newview/llcallfloater.h2
-rw-r--r--indra/newview/llchatitemscontainerctrl.cpp4
-rw-r--r--indra/newview/llconversationmodel.cpp99
-rw-r--r--indra/newview/llconversationmodel.h42
-rw-r--r--indra/newview/llfirstuse.cpp2
-rw-r--r--indra/newview/llfloaterconversationpreview.cpp95
-rw-r--r--indra/newview/llfloaterconversationpreview.h7
-rw-r--r--indra/newview/llfloatertranslationsettings.cpp2
-rw-r--r--indra/newview/llgesturemgr.cpp2
-rw-r--r--indra/newview/llimconversation.cpp35
-rw-r--r--indra/newview/llimconversation.h2
-rw-r--r--indra/newview/llimfloatercontainer.cpp6
-rw-r--r--indra/newview/llimview.cpp9
-rw-r--r--indra/newview/lllogchat.cpp6
-rw-r--r--indra/newview/lllogchat.h4
-rw-r--r--indra/newview/llnearbychat.cpp43
-rw-r--r--indra/newview/llnearbychat.h8
-rw-r--r--indra/newview/llnearbychathandler.cpp6
-rw-r--r--indra/newview/llnotificationhandlerutil.cpp5
-rw-r--r--indra/newview/llnotificationtiphandler.cpp3
-rw-r--r--indra/newview/llparticipantlist.cpp314
-rw-r--r--indra/newview/llparticipantlist.h4
-rw-r--r--indra/newview/llstartup.cpp1
-rw-r--r--indra/newview/lltoastimpanel.cpp4
-rw-r--r--indra/newview/lltoastimpanel.h2
-rw-r--r--indra/newview/llviewerfloaterreg.cpp2
-rw-r--r--indra/newview/llviewergesture.cpp2
-rw-r--r--indra/newview/llviewerkeyboard.cpp2
-rwxr-xr-xindra/newview/llviewermessage.cpp9
-rwxr-xr-xindra/newview/llviewerwindow.cpp62
-rw-r--r--indra/newview/skins/default/xui/da/panel_nearby_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/de/floater_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/de/panel_nearby_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/en/floater_conversation_preview.xml12
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml4
-rw-r--r--indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/es/floater_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/es/panel_nearby_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/fr/floater_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/fr/panel_nearby_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/it/floater_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/it/panel_nearby_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/ja/floater_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/ja/panel_nearby_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/pl/panel_nearby_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/pt/floater_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/pt/panel_nearby_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/ru/floater_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/ru/panel_nearby_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/tr/floater_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/tr/panel_nearby_chat_bar.xml2
-rw-r--r--indra/newview/skins/default/xui/zh/panel_nearby_chat_bar.xml2
59 files changed, 562 insertions, 312 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h
index 9dd776ff57..08e2a2caa6 100644
--- a/indra/llcommon/llmemory.h
+++ b/indra/llcommon/llmemory.h
@@ -65,6 +65,8 @@ inline void* ll_aligned_realloc_16(void* ptr, size_t size) // returned hunk MUST
#elif defined(LL_DARWIN)
return realloc(ptr,size); // default osx malloc is 16 byte aligned.
#else
+ // The realloc alignment test is skipped on Linux because the ll_aligned_realloc_16()
+ // function is not implemented to ensure alignment (see alignment_test.cpp)
return realloc(ptr,size); // FIXME not guaranteed to be aligned.
#endif
}
diff --git a/indra/llmath/tests/alignment_test.cpp b/indra/llmath/tests/alignment_test.cpp
index ac0c45ae6f..49c668d737 100644
--- a/indra/llmath/tests/alignment_test.cpp
+++ b/indra/llmath/tests/alignment_test.cpp
@@ -78,8 +78,12 @@ void alignment_test_object_t::test<1>()
align_ptr = ll_aligned_malloc_16(sizeof(MyVector4a));
ensure("ll_aligned_malloc_16 failed", is_aligned(align_ptr,16));
+#if !LL_LINUX
+ // Skipping realloc alignment test on Linux because the ll_aligned_realloc_16()
+ // function is not implemented to ensure alignment on Linux (see llmemory.h)
align_ptr = ll_aligned_realloc_16(align_ptr,2*sizeof(MyVector4a));
ensure("ll_aligned_realloc_16 failed", is_aligned(align_ptr,16));
+#endif // LL_LINUX
ll_aligned_free_16(align_ptr);
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index 41660c6e1e..16d9c86fd7 100644
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -262,6 +262,15 @@ public:
child->setParent(NULL);
dirtyFilter();
}
+
+ virtual void clearChildren()
+ {
+ // As this is cleaning the whole list of children wholesale, we do need to delete the pointed objects
+ // This is different and not equivalent to calling removeChild() on each child
+ std::for_each(mChildren.begin(), mChildren.end(), DeletePointer());
+ mChildren.clear();
+ dirtyFilter();
+ }
void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0)
{
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 61bc58b1df..ab1ea6bdbc 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1639,6 +1639,17 @@
<key>Value</key>
<string />
</map>
+ <key>ConversationHistoryPageSize</key>
+ <map>
+ <key>Comment</key>
+ <string>Chat history of conversation opened from call log is displayed by pages. So this is number of entries per page.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>100</integer>
+ </map>
<key>NearbyChatIsNotTornOff</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index f187318c0f..be6901c36a 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -1911,7 +1911,7 @@ void LLAgent::startTyping()
{
sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_START);
}
- LLNearbyChat::getInstance()->sendChatFromViewer("", CHAT_TYPE_START, FALSE);
+ (LLNearbyChat::instance()).sendChatFromViewer("", CHAT_TYPE_START, FALSE);
}
//-----------------------------------------------------------------------------
@@ -1923,7 +1923,7 @@ void LLAgent::stopTyping()
{
clearRenderState(AGENT_STATE_TYPING);
sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_STOP);
- LLNearbyChat::getInstance()->sendChatFromViewer("", CHAT_TYPE_STOP, FALSE);
+ (LLNearbyChat::instance()).sendChatFromViewer("", CHAT_TYPE_STOP, FALSE);
}
}
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index f2375bfa4f..38b755004c 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -334,7 +334,7 @@ void LLCallFloater::refreshParticipantList()
if (!non_avatar_caller)
{
llassert(mParticipants == NULL); // check for possible memory leak
- mParticipants = new LLParticipantList(mSpeakerManager, mAvatarList, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT, false);
+ mParticipants = new LLParticipantList(mSpeakerManager, mAvatarList, mConversationViewModel, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT, false);
mParticipants->setValidateSpeakerCallback(boost::bind(&LLCallFloater::validateSpeaker, this, _1));
const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder");
mParticipants->setSortOrder(LLParticipantList::EParticipantSortOrder(speaker_sort_order));
diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h
index 00a3f76e56..181c92276d 100644
--- a/indra/newview/llcallfloater.h
+++ b/indra/newview/llcallfloater.h
@@ -31,6 +31,7 @@
#include "lltransientdockablefloater.h"
#include "llvoicechannel.h"
#include "llvoiceclient.h"
+#include "llconversationmodel.h"
class LLAvatarList;
class LLAvatarListItem;
@@ -228,6 +229,7 @@ private:
LLSpeakerMgr* mSpeakerManager;
LLParticipantList* mParticipants;
LLAvatarList* mAvatarList;
+ LLConversationViewModel mConversationViewModel;
LLNonAvatarCaller* mNonAvatarCaller;
EVoiceControls mVoiceType;
LLPanel* mAgentPanel;
diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index 61772b4bb7..e6340e0fa3 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -323,12 +323,12 @@ BOOL LLNearbyChatToastPanel::handleMouseUp (S32 x, S32 y, MASK mask)
return TRUE;
else
{
- LLNearbyChat::getInstance()->showHistory();
+ LLNearbyChat::instance().showHistory();
return FALSE;
}
}
- LLNearbyChat::getInstance()->showHistory();
+ LLNearbyChat::instance().showHistory();
return LLPanel::handleMouseUp(x,y,mask);
}
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index f54e6d2d48..d7f9093a4a 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -40,6 +40,13 @@ LLConversationItem::LLConversationItem(std::string display_name, const LLUUID& u
{
}
+LLConversationItem::LLConversationItem(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
+ LLFolderViewModelItemCommon(root_view_model),
+ mName(""),
+ mUUID(uuid)
+{
+}
+
LLConversationItem::LLConversationItem(LLFolderViewModelInterface& root_view_model) :
LLFolderViewModelItemCommon(root_view_model),
mName(""),
@@ -81,13 +88,87 @@ bool LLConversationSort::operator()(const LLConversationItem* const& a, const LL
//
LLConversationItemSession::LLConversationItemSession(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
- LLConversationItem(display_name,uuid,root_view_model)
+ LLConversationItem(display_name,uuid,root_view_model),
+ mIsLoaded(false)
+{
+}
+
+LLConversationItemSession::LLConversationItemSession(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
+ LLConversationItem(uuid,root_view_model)
+{
+}
+
+void LLConversationItemSession::addParticipant(LLConversationItemParticipant* participant)
{
+ addChild(participant);
+ mIsLoaded = true;
}
-LLConversationItemSession::LLConversationItemSession(LLFolderViewModelInterface& root_view_model) :
- LLConversationItem(root_view_model)
+void LLConversationItemSession::removeParticipant(LLConversationItemParticipant* participant)
{
+ removeChild(participant);
+}
+
+void LLConversationItemSession::removeParticipant(const LLUUID& participant_id)
+{
+ LLConversationItemParticipant* participant = findParticipant(participant_id);
+ if (participant)
+ {
+ removeParticipant(participant);
+ }
+}
+
+void LLConversationItemSession::clearParticipants()
+{
+ clearChildren();
+ mIsLoaded = false;
+}
+
+LLConversationItemParticipant* LLConversationItemSession::findParticipant(const LLUUID& participant_id)
+{
+ // This is *not* a general tree parsing algorithm. It assumes that a session contains only
+ // items (LLConversationItemParticipant) that have themselve no children.
+ LLConversationItemParticipant* participant = NULL;
+ child_list_t::iterator iter;
+ for (iter = mChildren.begin(); iter != mChildren.end(); iter++)
+ {
+ participant = dynamic_cast<LLConversationItemParticipant*>(*iter);
+ if (participant->hasSameValue(participant_id))
+ {
+ break;
+ }
+ }
+ return (iter == mChildren.end() ? NULL : participant);
+}
+
+void LLConversationItemSession::setParticipantIsMuted(const LLUUID& participant_id, bool is_muted)
+{
+ LLConversationItemParticipant* participant = findParticipant(participant_id);
+ if (participant)
+ {
+ participant->setIsMuted(is_muted);
+ }
+}
+
+void LLConversationItemSession::setParticipantIsModerator(const LLUUID& participant_id, bool is_moderator)
+{
+ LLConversationItemParticipant* participant = findParticipant(participant_id);
+ if (participant)
+ {
+ participant->setIsModerator(is_moderator);
+ }
+}
+
+void LLConversationItemSession::dumpDebugData()
+{
+ llinfos << "Merov debug : session, uuid = " << mUUID << ", name = " << mName << ", is loaded = " << mIsLoaded << llendl;
+ LLConversationItemParticipant* participant = NULL;
+ child_list_t::iterator iter;
+ for (iter = mChildren.begin(); iter != mChildren.end(); iter++)
+ {
+ participant = dynamic_cast<LLConversationItemParticipant*>(*iter);
+ participant->dumpDebugData();
+ }
}
//
@@ -95,13 +176,19 @@ LLConversationItemSession::LLConversationItemSession(LLFolderViewModelInterface&
//
LLConversationItemParticipant::LLConversationItemParticipant(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
- LLConversationItem(display_name,uuid,root_view_model)
+ LLConversationItem(display_name,uuid,root_view_model),
+ mIsMuted(false),
+ mIsModerator(false)
{
}
-LLConversationItemParticipant::LLConversationItemParticipant(LLFolderViewModelInterface& root_view_model) :
- LLConversationItem(root_view_model)
+LLConversationItemParticipant::LLConversationItemParticipant(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
+ LLConversationItem(uuid,root_view_model)
{
}
+void LLConversationItemParticipant::dumpDebugData()
+{
+ llinfos << "Merov debug : participant, uuid = " << mUUID << ", name = " << mName << ", muted = " << mIsMuted << ", moderator = " << mIsModerator << llendl;
+}
// EOF
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index fc2c600364..af3756c45d 100644
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -33,6 +33,8 @@
// Implementation of conversations list
class LLConversationItem;
+class LLConversationItemSession;
+class LLConversationItemParticipant;
typedef std::map<LLUUID, LLConversationItem*> conversations_items_map;
typedef std::map<LLUUID, LLFolderViewItem*> conversations_widgets_map;
@@ -43,6 +45,7 @@ class LLConversationItem : public LLFolderViewModelItemCommon
{
public:
LLConversationItem(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
+ LLConversationItem(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
LLConversationItem(LLFolderViewModelInterface& root_view_model);
virtual ~LLConversationItem() {}
@@ -99,25 +102,54 @@ public:
// bool hasSameValues(std::string name, const LLUUID& uuid) { return ((name == mName) && (uuid == mUUID)); }
bool hasSameValue(const LLUUID& uuid) { return (uuid == mUUID); }
-private:
- std::string mName;
- const LLUUID mUUID;
+
+protected:
+ std::string mName; // Name of the session or the participant
+ LLUUID mUUID; // UUID of the session or the participant
};
class LLConversationItemSession : public LLConversationItem
{
public:
LLConversationItemSession(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
- LLConversationItemSession(LLFolderViewModelInterface& root_view_model);
+ LLConversationItemSession(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
virtual ~LLConversationItemSession() {}
+
+ void setSessionID(const LLUUID& session_id) { mUUID = session_id; }
+ void addParticipant(LLConversationItemParticipant* participant);
+ void removeParticipant(LLConversationItemParticipant* participant);
+ void removeParticipant(const LLUUID& participant_id);
+ void clearParticipants();
+ LLConversationItemParticipant* findParticipant(const LLUUID& participant_id);
+
+ void setParticipantIsMuted(const LLUUID& participant_id, bool is_muted);
+ void setParticipantIsModerator(const LLUUID& participant_id, bool is_moderator);
+
+ bool isLoaded() { return mIsLoaded; }
+
+ void dumpDebugData();
+
+private:
+ bool mIsLoaded; // true if at least one participant has been added to the session, false otherwise
};
class LLConversationItemParticipant : public LLConversationItem
{
public:
LLConversationItemParticipant(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
- LLConversationItemParticipant(LLFolderViewModelInterface& root_view_model);
+ LLConversationItemParticipant(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
virtual ~LLConversationItemParticipant() {}
+
+ bool isMuted() { return mIsMuted; }
+ bool isModerator() {return mIsModerator; }
+ void setIsMuted(bool is_muted) { mIsMuted = is_muted; }
+ void setIsModerator(bool is_moderator) { mIsModerator = is_moderator; }
+
+ void dumpDebugData();
+
+private:
+ bool mIsMuted; // default is false
+ bool mIsModerator; // default is false
};
// We don't want to ever filter conversations but we need to declare that class to create a conversation view model.
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index a9f52282a5..e2850f5181 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -74,7 +74,7 @@ void LLFirstUse::resetFirstUse()
// static
void LLFirstUse::otherAvatarChatFirst(bool enable)
{
- firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "chat_bar").with("direction", "top_right").with("distance", 24));
+ firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "nearby_chat").with("direction", "top_right").with("distance", 24));
}
// static
diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp
index e8554bb066..ae6f1441eb 100644
--- a/indra/newview/llfloaterconversationpreview.cpp
+++ b/indra/newview/llfloaterconversationpreview.cpp
@@ -33,12 +33,15 @@
LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_id)
: LLFloater(session_id),
mChatHistory(NULL),
- mSessionID(session_id.asUUID())
+ mSessionID(session_id.asUUID()),
+ mCurrentPage(0),
+ mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize"))
{}
BOOL LLFloaterConversationPreview::postBuild()
{
mChatHistory = getChild<LLChatHistory>("chat_history");
+ getChild<LLUICtrl>("more_history")->setCommitCallback(boost::bind(&LLFloaterConversationPreview::onMoreHistoryBtnClick, this));
const LLConversation* conv = LLConversationLog::instance().getConversation(mSessionID);
if (conv)
@@ -52,6 +55,11 @@ BOOL LLFloaterConversationPreview::postBuild()
getChild<LLLineEditor>("description")->setValue(name);
}
+ std::string file = conv->getHistoryFileName();
+ LLLogChat::loadChatHistory(file, mMessages, true);
+
+ mCurrentPage = mMessages.size() / mPageSize;
+
return LLFloater::postBuild();
}
@@ -62,51 +70,64 @@ void LLFloaterConversationPreview::draw()
void LLFloaterConversationPreview::onOpen(const LLSD& session_id)
{
- const LLConversation* conv = LLConversationLog::instance().getConversation(session_id);
- if (!conv)
+ showHistory();
+}
+
+void LLFloaterConversationPreview::showHistory()
+{
+ if (!mMessages.size())
{
return;
}
- std::list<LLSD> messages;
- std::string file = conv->getHistoryFileName();
- LLLogChat::loadAllHistory(file, messages);
- if (messages.size())
+ mChatHistory->clear();
+
+ std::ostringstream message;
+ std::list<LLSD>::const_iterator iter = mMessages.begin();
+
+ int delta = 0;
+ if (mCurrentPage)
{
- std::ostringstream message;
- std::list<LLSD>::const_iterator iter = messages.begin();
- for (; iter != messages.end(); ++iter)
- {
- LLSD msg = *iter;
-
- std::string time = msg["time"].asString();
- LLUUID from_id = msg["from_id"].asUUID();
- std::string from = msg["from"].asString();
- std::string message = msg["message"].asString();
- bool is_history = msg["is_history"].asBoolean();
-
- LLChat chat;
- chat.mFromID = from_id;
- chat.mSessionID = session_id;
- chat.mFromName = from;
- chat.mTimeStr = time;
- chat.mChatStyle = is_history ? CHAT_STYLE_HISTORY : chat.mChatStyle;
- chat.mText = message;
-
- appendMessage(chat);
- }
+ // stinson 08/28/2012 : This operation could be simplified using integer math with the mod (%) operator.
+ // e.g. The following code should give the same output.
+ // int remainder = mMessages.size() % mPageSize;
+ // delta = (remainder == 0) ? 0 : (mPageSize - remainder);
+ // Though without examining further, the remainder might be a more appropriate value.
+ double num_of_pages = static_cast<double>(mMessages.size()) / static_cast<double>(mPageSize);
+ delta = static_cast<int>((ceil(num_of_pages) - num_of_pages) * static_cast<double>(mPageSize));
}
-}
-void LLFloaterConversationPreview::appendMessage(const LLChat& chat)
-{
- if (!chat.mMuted)
+ std::advance(iter, (mCurrentPage * mPageSize) - delta);
+
+ for (int msg_num = 0; (iter != mMessages.end() && msg_num < mPageSize); ++iter, ++msg_num)
{
- LLSD args;
- args["use_plain_text_chat_history"] = true;
- args["show_time"] = true;
- args["show_names_for_p2p_conv"] = true;
+ LLSD msg = *iter;
+
+ std::string time = msg["time"].asString();
+ LLUUID from_id = msg["from_id"].asUUID();
+ std::string from = msg["from"].asString();
+ std::string message = msg["message"].asString();
+ bool is_history = msg["is_history"].asBoolean();
+
+ LLChat chat;
+ chat.mFromID = from_id;
+ chat.mSessionID = mSessionID;
+ chat.mFromName = from;
+ chat.mTimeStr = time;
+ chat.mChatStyle = is_history ? CHAT_STYLE_HISTORY : chat.mChatStyle;
+ chat.mText = message;
mChatHistory->appendMessage(chat);
}
+
+}
+
+void LLFloaterConversationPreview::onMoreHistoryBtnClick()
+{
+ if (--mCurrentPage < 0)
+ {
+ return;
+ }
+
+ showHistory();
}
diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h
index cfc7c34485..5105ef3702 100644
--- a/indra/newview/llfloaterconversationpreview.h
+++ b/indra/newview/llfloaterconversationpreview.h
@@ -42,10 +42,15 @@ public:
virtual void onOpen(const LLSD& session_id);
private:
- void appendMessage(const LLChat& chat);
+ void onMoreHistoryBtnClick();
+ void showHistory();
LLChatHistory* mChatHistory;
LLUUID mSessionID;
+ int mCurrentPage;
+ int mPageSize;
+
+ std::list<LLSD> mMessages;
};
#endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */
diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp
index bb01ce5a7e..b5b86dadc2 100644
--- a/indra/newview/llfloatertranslationsettings.cpp
+++ b/indra/newview/llfloatertranslationsettings.cpp
@@ -293,6 +293,6 @@ void LLFloaterTranslationSettings::onBtnOK()
gSavedSettings.setString("TranslationService", getSelectedService());
gSavedSettings.setString("BingTranslateAPIKey", getEnteredBingKey());
gSavedSettings.setString("GoogleTranslateAPIKey", getEnteredGoogleKey());
- LLNearbyChat::getInstance()->showTranslationCheckbox(LLTranslate::isTranslationConfigured());
+ LLNearbyChat::instance().showTranslationCheckbox(LLTranslate::isTranslationConfigured());
closeFloater(false);
}
diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp
index 26b63bdacb..0377337af6 100644
--- a/indra/newview/llgesturemgr.cpp
+++ b/indra/newview/llgesturemgr.cpp
@@ -997,7 +997,7 @@ void LLGestureMgr::runStep(LLMultiGesture* gesture, LLGestureStep* step)
const BOOL animate = FALSE;
- LLNearbyChat::getInstance()->sendChatFromViewer(chat_text, CHAT_TYPE_NORMAL, animate);
+ LLNearbyChat::instance().sendChatFromViewer(chat_text, CHAT_TYPE_NORMAL, animate);
gesture->mCurrentStep++;
break;
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index ee7f58b01f..7bb29be27b 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;
};
@@ -165,7 +187,7 @@ void LLIMConversation::buildParticipantList()
if (mIsNearbyChat)
{
LLLocalSpeakerMgr* speaker_manager = LLLocalSpeakerMgr::getInstance();
- mParticipantList = new LLParticipantList(speaker_manager, getChild<LLAvatarList>("speakers_list"), true, false);
+ mParticipantList = new LLParticipantList(speaker_manager, getChild<LLAvatarList>("speakers_list"), mConversationViewModel, true, false);
}
else
{
@@ -174,7 +196,7 @@ void LLIMConversation::buildParticipantList()
if(!mIsP2PChat && mSessionID.notNull() && speaker_manager)
{
delete mParticipantList; // remove the old list and create a new one if the session id has changed
- mParticipantList = new LLParticipantList(speaker_manager, getChild<LLAvatarList>("speakers_list"), true, false);
+ mParticipantList = new LLParticipantList(speaker_manager, getChild<LLAvatarList>("speakers_list"), mConversationViewModel, true, false);
}
}
updateHeaderAndToolbar();
@@ -336,10 +358,9 @@ void LLIMConversation::processChatHistoryStyleUpdate()
}
}
- LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
- if (nearby_chat)
+ if (LLNearbyChat::instanceExists())
{
- nearby_chat->reloadMessages();
+ LLNearbyChat::instance().reloadMessages();
}
}
diff --git a/indra/newview/llimconversation.h b/indra/newview/llimconversation.h
index f21be94ee2..26151ad1be 100644
--- a/indra/newview/llimconversation.h
+++ b/indra/newview/llimconversation.h
@@ -33,6 +33,7 @@
#include "lltransientdockablefloater.h"
#include "llviewercontrol.h"
#include "lleventtimer.h"
+#include "llconversationmodel.h"
class LLPanelChatControlPanel;
class LLChatEntry;
@@ -104,6 +105,7 @@ protected:
LLLayoutPanel* mParticipantListPanel;
LLParticipantList* mParticipantList;
LLUUID mSessionID;
+ LLConversationViewModel mConversationViewModel;
LLChatHistory* mChatHistory;
LLChatEntry* mInputEditor;
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index bfe4afe80b..fe00f70a28 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -315,13 +315,13 @@ void LLIMFloaterContainer::setVisible(BOOL visible)
if (visible)
{
// Make sure we have the Nearby Chat present when showing the conversation container
- LLIMConversation* nearby_chat = LLIMConversation::findConversation(LLUUID::null);
+ LLIMConversation* nearby_chat = LLFloaterReg::findTypedInstance<LLIMConversation>("nearby_chat");
if (nearby_chat == NULL)
{
// If not found, force the creation of the nearby chat conversation panel
// *TODO: find a way to move this to XML as a default panel or something like that
- LLSD name("chat_bar");
- LLFloaterReg::toggleInstanceOrBringToFront(name, LLSD(LLUUID::null));
+ LLSD name("nearby_chat");
+ LLFloaterReg::toggleInstanceOrBringToFront(name);
}
}
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index d88a558125..effcc9a826 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -263,7 +263,7 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
std::list<LLSD> chat_history;
//involves parsing of a chat history
- LLLogChat::loadAllHistory(mHistoryFileName, chat_history);
+ LLLogChat::loadChatHistory(mHistoryFileName, chat_history);
addMessagesFromHistory(chat_history);
}
@@ -2486,12 +2486,9 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess
LLChat chat(message);
chat.mSourceType = CHAT_SOURCE_SYSTEM;
-
- LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
-
- if(nearby_chat)
+ if (LLNearbyChat::instanceExists())
{
- nearby_chat->addMessage(chat);
+ LLNearbyChat::instance().addMessage(chat);
}
}
else // going to IM session
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index ebb5912ace..073f5f00c5 100644
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -387,7 +387,7 @@ void append_to_last_message(std::list<LLSD>& messages, const std::string& line)
}
// static
-void LLLogChat::loadAllHistory(const std::string& file_name, std::list<LLSD>& messages)
+void LLLogChat::loadChatHistory(const std::string& file_name, std::list<LLSD>& messages, bool load_all_history/*= false*/)
{
if (file_name.empty())
{
@@ -412,8 +412,8 @@ void LLLogChat::loadAllHistory(const std::string& file_name, std::list<LLSD>& me
S32 len;
bool firstline = TRUE;
- if (fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END))
- { //File is smaller than recall size. Get it all.
+ if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END))
+ { //We need to load the whole historyFile or it's smaller than recall size, so get it all.
firstline = FALSE;
if (fseek(fptr, 0, SEEK_SET))
{
diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h
index 27752452c9..95f83e64e5 100644
--- a/indra/newview/lllogchat.h
+++ b/indra/newview/lllogchat.h
@@ -50,12 +50,12 @@ public:
const LLUUID& from_id,
const std::string& line);
- /** @deprecated @see loadAllHistory() */
+ /** @deprecated @see loadChatHistory() */
static void loadHistory(const std::string& filename,
void (*callback)(ELogLineType, const LLSD&, void*),
void* userdata);
- static void loadAllHistory(const std::string& file_name, std::list<LLSD>& messages);
+ static void loadChatHistory(const std::string& file_name, std::list<LLSD>& messages, bool load_all_history = false);
private:
static std::string cleanFileName(std::string filename);
};
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index e1454fb5dc..f1518fe825 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -123,8 +123,8 @@ static LLChatTypeTrigger sChatTypeTriggers[] = {
};
-LLNearbyChat::LLNearbyChat(const LLSD& key)
-: LLIMConversation(key),
+LLNearbyChat::LLNearbyChat(const LLSD& llsd)
+: LLIMConversation(LLSD()),
//mOutputMonitor(NULL),
mSpeakerMgr(NULL),
mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT)
@@ -133,6 +133,7 @@ LLNearbyChat::LLNearbyChat(const LLSD& key)
setIsChrome(TRUE);
mKey = LLSD();
mSpeakerMgr = LLLocalSpeakerMgr::getInstance();
+ setName("nearby_chat");
}
//virtual
@@ -261,7 +262,7 @@ void LLNearbyChat::loadHistory()
do_not_log["do_not_log"] = true;
std::list<LLSD> history;
- LLLogChat::loadAllHistory("chat", history);
+ LLLogChat::loadChatHistory("chat", history);
std::list<LLSD>::const_iterator it = history.begin();
while (it != history.end())
@@ -379,11 +380,6 @@ void LLNearbyChat::onChatFontChange(LLFontGL* fontp)
}
}
-//static
-LLNearbyChat* LLNearbyChat::getInstance()
-{
- return LLFloaterReg::getTypedInstance<LLNearbyChat>("chat_bar", LLSD(LLUUID::null));
-}
void LLNearbyChat::show()
{
@@ -646,7 +642,10 @@ void LLNearbyChat::appendMessage(const LLChat& chat, const LLSD &args)
chat_args["show_time"] = gSavedSettings.getBOOL("IMShowTime");
chat_args["show_names_for_p2p_conv"] = true;
- mChatHistory->appendMessage(chat, chat_args);
+ if (mChatHistory)
+ {
+ mChatHistory->appendMessage(chat, chat_args);
+ }
}
}
@@ -781,22 +780,20 @@ void LLNearbyChat::sendChatFromViewer(const LLWString &wtext, EChatType type, BO
// static
void LLNearbyChat::startChat(const char* line)
{
- LLNearbyChat* cb = LLNearbyChat::getInstance();
-
- if (cb )
+ if (LLNearbyChat::instanceExists())
{
- cb->show();
- cb->setVisible(TRUE);
- cb->setFocus(TRUE);
- cb->mInputEditor->setFocus(TRUE);
+ (LLNearbyChat::instance()).show();
+ (LLNearbyChat::instance()).setVisible(TRUE);
+ (LLNearbyChat::instance()).setFocus(TRUE);
+ (LLNearbyChat::instance().mInputEditor)->setFocus(TRUE);
if (line)
{
std::string line_string(line);
- cb->mInputEditor->setText(line_string);
+ (LLNearbyChat::instance().mInputEditor)->setText(line_string);
}
- cb->mInputEditor->endOfDoc();
+ (LLNearbyChat::instance().mInputEditor)->endOfDoc();
}
}
@@ -804,14 +801,10 @@ void LLNearbyChat::startChat(const char* line)
// static
void LLNearbyChat::stopChat()
{
- LLNearbyChat* cb = LLNearbyChat::getInstance();
-
- if (cb)
+ if (LLNearbyChat::instanceExists())
{
- cb->mInputEditor->setFocus(FALSE);
-
- // stop typing animation
- gAgent.stopTyping();
+ (LLNearbyChat::instance().mInputEditor)->setFocus(FALSE);
+ gAgent.stopTyping();
}
}
diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h
index 7c58e3037e..379bfbee4b 100644
--- a/indra/newview/llnearbychat.h
+++ b/indra/newview/llnearbychat.h
@@ -35,17 +35,19 @@
#include "lloutputmonitorctrl.h"
#include "llspeakers.h"
#include "llscrollbar.h"
+#include "llsingleton.h"
#include "llviewerchat.h"
#include "llpanel.h"
class LLResizeBar;
class LLNearbyChat
- : public LLIMConversation
+ : public LLIMConversation,
+ public LLSingleton<LLNearbyChat>
{
public:
// constructor for inline chat-bars (e.g. hosted in chat history window)
- LLNearbyChat(const LLSD& key);
+ LLNearbyChat(const LLSD& key = LLSD());
~LLNearbyChat() {}
/*virtual*/ BOOL postBuild();
@@ -61,8 +63,6 @@ public:
void reloadMessages();
void removeScreenChat();
- static LLNearbyChat* getInstance();
-
void addToHost();
void show();
bool isChatVisible() const;
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index c97e3585e1..37f4cc4c19 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -487,8 +487,6 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg,
if(chat_msg.mText.empty())
return;//don't process empty messages
- LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
-
// Build notification data
LLSD chat;
chat["message"] = chat_msg.mText;
@@ -539,7 +537,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg,
}
}
- nearby_chat->addMessage(chat_msg, true, args);
+ LLNearbyChat::instance().addMessage(chat_msg, true, args);
if(chat_msg.mSourceType == CHAT_SOURCE_AGENT
&& chat_msg.mFromID.notNull()
@@ -555,7 +553,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg,
// Send event on to LLEventStream
sChatWatcher->post(chat);
- if( nearby_chat->isInVisibleChain()
+ if( LLNearbyChat::instance().isInVisibleChain()
|| ( chat_msg.mSourceType == CHAT_SOURCE_AGENT
&& gSavedSettings.getBOOL("UseChatBubbles") )
|| mChannel.isDead()
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index cba22b233b..db8e917435 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -181,14 +181,13 @@ void LLHandlerUtil::logGroupNoticeToIMGroup(
// static
void LLHandlerUtil::logToNearbyChat(const LLNotificationPtr& notification, EChatSourceType type)
{
- LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
- if(nearby_chat)
+ if (LLNearbyChat::instanceExists())
{
LLChat chat_msg(notification->getMessage());
chat_msg.mSourceType = type;
chat_msg.mFromName = SYSTEM_FROM;
chat_msg.mFromID = LLUUID::null;
- nearby_chat->addMessage(chat_msg);
+ LLNearbyChat::instance().addMessage(chat_msg);
}
}
diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp
index a420c0d2ed..67fc9b27dc 100644
--- a/indra/newview/llnotificationtiphandler.cpp
+++ b/indra/newview/llnotificationtiphandler.cpp
@@ -85,8 +85,7 @@ bool LLTipHandler::processNotification(const LLNotificationPtr& notification)
LLHandlerUtil::logToNearbyChat(notification, CHAT_SOURCE_SYSTEM);
// don't show toast if Nearby Chat is opened
- LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
- if (nearby_chat->isChatVisible())
+ if (LLNearbyChat::instance().isChatVisible())
{
return false;
}
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index 47518a365f..35c1a34a26 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -29,6 +29,8 @@
// common includes
#include "lltrans.h"
#include "llavataractions.h"
+#include "llavatarnamecache.h"
+#include "llavatarname.h"
#include "llagent.h"
#include "llimview.h"
@@ -50,11 +52,14 @@ static const LLAvatarItemAgentOnTopComparator AGENT_ON_TOP_NAME_COMPARATOR;
// helper function to update AvatarList Item's indicator in the voice participant list
static void update_speaker_indicator(const LLAvatarList* const avatar_list, const LLUUID& avatar_uuid, bool is_muted)
{
- LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(avatar_list->getItemByValue(avatar_uuid));
- if (item)
+ if (avatar_list)
{
- LLOutputMonitorCtrl* indicator = item->getChild<LLOutputMonitorCtrl>("speaking_indicator");
- indicator->setIsMuted(is_muted);
+ LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(avatar_list->getItemByValue(avatar_uuid));
+ if (item)
+ {
+ LLOutputMonitorCtrl* indicator = item->getChild<LLOutputMonitorCtrl>("speaking_indicator");
+ indicator->setIsMuted(is_muted);
+ }
}
}
@@ -200,9 +205,11 @@ private:
LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source,
LLAvatarList* avatar_list,
+ LLFolderViewModelInterface& root_view_model,
bool use_context_menu/* = true*/,
bool exclude_agent /*= true*/,
bool can_toggle_icons /*= true*/) :
+ LLConversationItemSession(data_source->getSessionID(), root_view_model),
mSpeakerMgr(data_source),
mAvatarList(avatar_list),
mParticipantListMenu(NULL),
@@ -224,29 +231,34 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source,
mSpeakerMgr->addListener(mSpeakerClearListener, "clear");
mSpeakerMgr->addListener(mSpeakerModeratorListener, "update_moderator");
- mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
- LL_DEBUGS("SpeakingIndicator") << "Set session for speaking indicators: " << mSpeakerMgr->getSessionID() << LL_ENDL;
- mAvatarList->setSessionID(mSpeakerMgr->getSessionID());
- mAvatarListDoubleClickConnection = mAvatarList->setItemDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, _1));
- mAvatarListRefreshConnection = mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2));
- // Set onAvatarListDoubleClicked as default on_return action.
- mAvatarListReturnConnection = mAvatarList->setReturnCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList));
-
- if (use_context_menu)
- {
- //mParticipantListMenu = new LLParticipantListMenu(*this);
- //mAvatarList->setContextMenu(mParticipantListMenu);
- mAvatarList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
- }
- else
+ setSessionID(mSpeakerMgr->getSessionID());
+
+ if (mAvatarList)
{
- mAvatarList->setContextMenu(NULL);
- }
+ mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
+ LL_DEBUGS("SpeakingIndicator") << "Set session for speaking indicators: " << mSpeakerMgr->getSessionID() << LL_ENDL;
+ mAvatarList->setSessionID(mSpeakerMgr->getSessionID());
+ mAvatarListDoubleClickConnection = mAvatarList->setItemDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, _1));
+ mAvatarListRefreshConnection = mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2));
+ // Set onAvatarListDoubleClicked as default on_return action.
+ mAvatarListReturnConnection = mAvatarList->setReturnCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList));
+
+ if (use_context_menu)
+ {
+ //mParticipantListMenu = new LLParticipantListMenu(*this);
+ //mAvatarList->setContextMenu(mParticipantListMenu);
+ mAvatarList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
+ }
+ else
+ {
+ mAvatarList->setContextMenu(NULL);
+ }
- if (use_context_menu && can_toggle_icons)
- {
- mAvatarList->setShowIcons("ParticipantListShowIcons");
- mAvatarListToggleIconsConnection = gSavedSettings.getControl("ParticipantListShowIcons")->getSignal()->connect(boost::bind(&LLAvatarList::toggleIcons, mAvatarList));
+ if (use_context_menu && can_toggle_icons)
+ {
+ mAvatarList->setShowIcons("ParticipantListShowIcons");
+ mAvatarListToggleIconsConnection = gSavedSettings.getControl("ParticipantListShowIcons")->getSignal()->connect(boost::bind(&LLAvatarList::toggleIcons, mAvatarList));
+ }
}
//Lets fill avatarList with existing speakers
@@ -272,10 +284,13 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source,
LLParticipantList::~LLParticipantList()
{
- mAvatarListDoubleClickConnection.disconnect();
- mAvatarListRefreshConnection.disconnect();
- mAvatarListReturnConnection.disconnect();
- mAvatarListToggleIconsConnection.disconnect();
+ if (mAvatarList)
+ {
+ mAvatarListDoubleClickConnection.disconnect();
+ mAvatarListRefreshConnection.disconnect();
+ mAvatarListReturnConnection.disconnect();
+ mAvatarListToggleIconsConnection.disconnect();
+ }
// It is possible Participant List will be re-created from LLCallFloater::onCurrentChannelChanged()
// See ticket EXT-3427
@@ -291,16 +306,22 @@ LLParticipantList::~LLParticipantList()
mParticipantListMenu = NULL;
}
- mAvatarList->setContextMenu(NULL);
- mAvatarList->setComparator(NULL);
+ if (mAvatarList)
+ {
+ mAvatarList->setContextMenu(NULL);
+ mAvatarList->setComparator(NULL);
+ }
delete mAvalineUpdater;
}
void LLParticipantList::setSpeakingIndicatorsVisible(BOOL visible)
{
- mAvatarList->setSpeakingIndicatorsVisible(visible);
-};
+ if (mAvatarList)
+ {
+ mAvatarList->setSpeakingIndicatorsVisible(visible);
+ }
+}
void LLParticipantList::onAvatarListDoubleClicked(LLUICtrl* ctrl)
{
@@ -321,81 +342,81 @@ void LLParticipantList::onAvatarListDoubleClicked(LLUICtrl* ctrl)
void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
{
LLAvatarList* list = dynamic_cast<LLAvatarList*>(ctrl);
- if (list)
+ const std::string moderator_indicator(LLTrans::getString("IM_moderator_label"));
+ const std::size_t moderator_indicator_len = moderator_indicator.length();
+
+ // Firstly remove moderators indicator
+ std::set<LLUUID>::const_iterator
+ moderator_list_it = mModeratorToRemoveList.begin(),
+ moderator_list_end = mModeratorToRemoveList.end();
+ for (;moderator_list_it != moderator_list_end; ++moderator_list_it)
{
- const std::string moderator_indicator(LLTrans::getString("IM_moderator_label"));
- const std::size_t moderator_indicator_len = moderator_indicator.length();
-
- // Firstly remove moderators indicator
- std::set<LLUUID>::const_iterator
- moderator_list_it = mModeratorToRemoveList.begin(),
- moderator_list_end = mModeratorToRemoveList.end();
- for (;moderator_list_it != moderator_list_end; ++moderator_list_it)
+ LLAvatarListItem* item = (list ? dynamic_cast<LLAvatarListItem*> (list->getItemByValue(*moderator_list_it)) : NULL);
+ if ( item )
{
- LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*> (list->getItemByValue(*moderator_list_it));
- if ( item )
+ std::string name = item->getAvatarName();
+ std::string tooltip = item->getAvatarToolTip();
+ size_t found = name.find(moderator_indicator);
+ if (found != std::string::npos)
{
- std::string name = item->getAvatarName();
- std::string tooltip = item->getAvatarToolTip();
- size_t found = name.find(moderator_indicator);
- if (found != std::string::npos)
- {
- name.erase(found, moderator_indicator_len);
- item->setAvatarName(name);
- }
- found = tooltip.find(moderator_indicator);
- if (found != tooltip.npos)
- {
- tooltip.erase(found, moderator_indicator_len);
- item->setAvatarToolTip(tooltip);
- }
+ name.erase(found, moderator_indicator_len);
+ item->setAvatarName(name);
+ }
+ found = tooltip.find(moderator_indicator);
+ if (found != tooltip.npos)
+ {
+ tooltip.erase(found, moderator_indicator_len);
+ item->setAvatarToolTip(tooltip);
}
}
+ setParticipantIsModerator(*moderator_list_it,false);
+ }
- mModeratorToRemoveList.clear();
+ mModeratorToRemoveList.clear();
- // Add moderators indicator
- moderator_list_it = mModeratorList.begin();
- moderator_list_end = mModeratorList.end();
- for (;moderator_list_it != moderator_list_end; ++moderator_list_it)
+ // Add moderators indicator
+ moderator_list_it = mModeratorList.begin();
+ moderator_list_end = mModeratorList.end();
+ for (;moderator_list_it != moderator_list_end; ++moderator_list_it)
+ {
+ LLAvatarListItem* item = (list ? dynamic_cast<LLAvatarListItem*> (list->getItemByValue(*moderator_list_it)) : NULL);
+ if ( item )
{
- LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*> (list->getItemByValue(*moderator_list_it));
- if ( item )
+ std::string name = item->getAvatarName();
+ std::string tooltip = item->getAvatarToolTip();
+ size_t found = name.find(moderator_indicator);
+ if (found == std::string::npos)
{
- std::string name = item->getAvatarName();
- std::string tooltip = item->getAvatarToolTip();
- size_t found = name.find(moderator_indicator);
- if (found == std::string::npos)
- {
- name += " ";
- name += moderator_indicator;
- item->setAvatarName(name);
- }
- found = tooltip.find(moderator_indicator);
- if (found == std::string::npos)
- {
- tooltip += " ";
- tooltip += moderator_indicator;
- item->setAvatarToolTip(tooltip);
- }
+ name += " ";
+ name += moderator_indicator;
+ item->setAvatarName(name);
+ }
+ found = tooltip.find(moderator_indicator);
+ if (found == std::string::npos)
+ {
+ tooltip += " ";
+ tooltip += moderator_indicator;
+ item->setAvatarToolTip(tooltip);
}
}
+ setParticipantIsModerator(*moderator_list_it,true);
+ }
- // update voice mute state of all items. See EXT-7235
- LLSpeakerMgr::speaker_list_t speaker_list;
+ // update voice mute state of all items. See EXT-7235
+ LLSpeakerMgr::speaker_list_t speaker_list;
- // Use also participants which are not in voice session now (the second arg is TRUE).
- // They can already have mModeratorMutedVoice set from the previous voice session
- // and LLSpeakerVoiceModerationEvent will not be sent when speaker manager is updated next time.
- mSpeakerMgr->getSpeakerList(&speaker_list, TRUE);
- for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++)
- {
- const LLPointer<LLSpeaker>& speakerp = *it;
+ // Use also participants which are not in voice session now (the second arg is TRUE).
+ // They can already have mModeratorMutedVoice set from the previous voice session
+ // and LLSpeakerVoiceModerationEvent will not be sent when speaker manager is updated next time.
+ mSpeakerMgr->getSpeakerList(&speaker_list, TRUE);
+ for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++)
+ {
+ const LLPointer<LLSpeaker>& speakerp = *it;
- if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
- {
- update_speaker_indicator(list, speakerp->mID, speakerp->mModeratorMutedVoice);
- }
+ if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
+ {
+ setParticipantIsMuted(speakerp->mID, speakerp->mModeratorMutedVoice);
+ update_speaker_indicator(list, speakerp->mID, speakerp->mModeratorMutedVoice);
}
}
}
@@ -413,30 +434,39 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
*/
void LLParticipantList::onAvalineCallerFound(const LLUUID& participant_id)
{
- LLPanel* item = mAvatarList->getItemByValue(participant_id);
-
- if (NULL == item)
+ if (mAvatarList)
{
- LL_WARNS("Avaline") << "Something wrong. Unable to find item for: " << participant_id << LL_ENDL;
- return;
- }
+ LLPanel* item = mAvatarList->getItemByValue(participant_id);
- if (typeid(*item) == typeid(LLAvalineListItem))
- {
- LL_DEBUGS("Avaline") << "Avaline caller has already correct class type for: " << participant_id << LL_ENDL;
- // item representing an Avaline caller has a correct type already.
- return;
- }
+ if (NULL == item)
+ {
+ LL_WARNS("Avaline") << "Something wrong. Unable to find item for: " << participant_id << LL_ENDL;
+ return;
+ }
+
+ if (typeid(*item) == typeid(LLAvalineListItem))
+ {
+ LL_DEBUGS("Avaline") << "Avaline caller has already correct class type for: " << participant_id << LL_ENDL;
+ // item representing an Avaline caller has a correct type already.
+ return;
+ }
- LL_DEBUGS("Avaline") << "remove item from the list and re-add it: " << participant_id << LL_ENDL;
+ LL_DEBUGS("Avaline") << "remove item from the list and re-add it: " << participant_id << LL_ENDL;
- // remove UUID from LLAvatarList::mIDs to be able add it again.
- uuid_vec_t& ids = mAvatarList->getIDs();
- uuid_vec_t::iterator pos = std::find(ids.begin(), ids.end(), participant_id);
- ids.erase(pos);
+ // remove UUID from LLAvatarList::mIDs to be able add it again.
+ uuid_vec_t& ids = mAvatarList->getIDs();
+ uuid_vec_t::iterator pos = std::find(ids.begin(), ids.end(), participant_id);
+ ids.erase(pos);
- // remove item directly
- mAvatarList->removeItem(item);
+ // remove item directly
+ mAvatarList->removeItem(item);
+ }
+
+ LLConversationItemParticipant* participant = findParticipant(participant_id);
+ if (participant)
+ {
+ removeParticipant(participant);
+ }
// re-add avaline caller with a correct class instance.
addAvatarIDExceptAgent(participant_id);
@@ -487,7 +517,7 @@ bool LLParticipantList::isHovered()
{
S32 x, y;
LLUI::getMousePositionScreen(&x, &y);
- return mAvatarList->calcScreenRect().pointInRect(x, y);
+ return (mAvatarList ? mAvatarList->calcScreenRect().pointInRect(x, y) : false);
}
bool LLParticipantList::onAddItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
@@ -506,21 +536,30 @@ bool LLParticipantList::onAddItemEvent(LLPointer<LLOldEvents::LLEvent> event, co
bool LLParticipantList::onRemoveItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
{
- uuid_vec_t& group_members = mAvatarList->getIDs();
- uuid_vec_t::iterator pos = std::find(group_members.begin(), group_members.end(), event->getValue().asUUID());
- if(pos != group_members.end())
+ LLUUID avatar_id = event->getValue().asUUID();
+ if (mAvatarList)
{
- group_members.erase(pos);
- mAvatarList->setDirty();
+ uuid_vec_t& group_members = mAvatarList->getIDs();
+ uuid_vec_t::iterator pos = std::find(group_members.begin(), group_members.end(), avatar_id);
+ if(pos != group_members.end())
+ {
+ group_members.erase(pos);
+ mAvatarList->setDirty();
+ }
}
+ removeParticipant(avatar_id);
return true;
}
bool LLParticipantList::onClearListEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
{
- uuid_vec_t& group_members = mAvatarList->getIDs();
- group_members.clear();
- mAvatarList->setDirty();
+ if (mAvatarList)
+ {
+ uuid_vec_t& group_members = mAvatarList->getIDs();
+ group_members.clear();
+ mAvatarList->setDirty();
+ }
+ clearParticipants();
return true;
}
@@ -560,6 +599,7 @@ bool LLParticipantList::onSpeakerMuteEvent(LLPointer<LLOldEvents::LLEvent> event
// update UI on confirmation of moderator mutes
if (event->getValue().asString() == "voice")
{
+ setParticipantIsMuted(speakerp->mID, speakerp->mModeratorMutedVoice);
update_speaker_indicator(mAvatarList, speakerp->mID, speakerp->mModeratorMutedVoice);
}
return true;
@@ -567,6 +607,7 @@ bool LLParticipantList::onSpeakerMuteEvent(LLPointer<LLOldEvents::LLEvent> event
void LLParticipantList::sort()
{
+ // *TODO : Merov : Need to plan for sort() for LLConversationModel
if ( !mAvatarList )
return;
@@ -599,21 +640,40 @@ void LLParticipantList::sort()
void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id)
{
if (mExcludeAgent && gAgent.getID() == avatar_id) return;
- if (mAvatarList->contains(avatar_id)) return;
+ if (mAvatarList && mAvatarList->contains(avatar_id)) return;
bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(avatar_id);
+ LLConversationItemParticipant* participant = NULL;
+
if (is_avatar)
{
- mAvatarList->getIDs().push_back(avatar_id);
- mAvatarList->setDirty();
+ // Create a participant view model instance and add it to the linked list
+ LLAvatarName avatar_name;
+ bool has_name = LLAvatarNameCache::get(avatar_id, &avatar_name);
+ participant = new LLConversationItemParticipant(!has_name ? "Avatar" : avatar_name.mDisplayName , avatar_id, mRootViewModel);
+ if (mAvatarList)
+ {
+ mAvatarList->getIDs().push_back(avatar_id);
+ mAvatarList->setDirty();
+ }
}
else
{
std::string display_name = LLVoiceClient::getInstance()->getDisplayName(avatar_id);
- mAvatarList->addAvalineItem(avatar_id, mSpeakerMgr->getSessionID(), display_name.empty() ? LLTrans::getString("AvatarNameWaiting") : display_name);
+ // Create a participant view model instance and add it to the linked list
+ participant = new LLConversationItemParticipant(display_name.empty() ? LLTrans::getString("AvatarNameWaiting") : display_name, avatar_id, mRootViewModel);
+ if (mAvatarList)
+ {
+ mAvatarList->addAvalineItem(avatar_id, mSpeakerMgr->getSessionID(), display_name.empty() ? LLTrans::getString("AvatarNameWaiting") : display_name);
+ }
mAvalineUpdater->watchAvalineCaller(avatar_id);
}
+
+ // *TODO : Merov : need to declare and bind a name update callback on that "participant" instance. See LLAvatarListItem::updateAvatarName() for pattern.
+ // For the moment, we'll get the correct name only if it's already in the name cache (see call to LLAvatarNameCache::get() here above)
+ addParticipant(participant);
+
adjustParticipant(avatar_id);
}
@@ -769,7 +829,7 @@ void LLParticipantList::LLParticipantListMenu::toggleMute(const LLSD& userdata,
LL_WARNS("Speakers") << "Speaker " << speaker_id << " not found" << llendl;
return;
}
- LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(mParent.mAvatarList->getItemByValue(speaker_id));
+ LLAvatarListItem* item = (mParent.mAvatarList ? dynamic_cast<LLAvatarListItem*>(mParent.mAvatarList->getItemByValue(speaker_id)) : NULL);
if (NULL == item) return;
name = item->getAvatarName();
diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h
index 53966c15fe..f8165aa292 100644
--- a/indra/newview/llparticipantlist.h
+++ b/indra/newview/llparticipantlist.h
@@ -31,13 +31,14 @@
#include "llevent.h"
#include "llavatarlist.h" // for LLAvatarItemRecentSpeakerComparator
#include "lllistcontextmenu.h"
+#include "llconversationmodel.h"
class LLSpeakerMgr;
class LLAvatarList;
class LLUICtrl;
class LLAvalineUpdater;
-class LLParticipantList
+class LLParticipantList : public LLConversationItemSession
{
LOG_CLASS(LLParticipantList);
public:
@@ -46,6 +47,7 @@ public:
LLParticipantList(LLSpeakerMgr* data_source,
LLAvatarList* avatar_list,
+ LLFolderViewModelInterface& root_view_model,
bool use_context_menu = true,
bool exclude_agent = true,
bool can_toggle_icons = true);
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index ab72b4e512..c827b39d0e 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -64,6 +64,7 @@
#include "llmessageconfig.h"
#include "llmoveview.h"
#include "llimfloatercontainer.h"
+#include "llnearbychat.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
#include "llteleporthistory.h"
diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp
index e0cb200ef5..75e6e3d13a 100644
--- a/indra/newview/lltoastimpanel.cpp
+++ b/indra/newview/lltoastimpanel.cpp
@@ -104,9 +104,9 @@ LLToastIMPanel::~LLToastIMPanel()
}
//virtual
-BOOL LLToastIMPanel::handleMouseDown(S32 x, S32 y, MASK mask)
+BOOL LLToastIMPanel::handleMouseUp(S32 x, S32 y, MASK mask)
{
- if (LLPanel::handleMouseDown(x,y,mask) == FALSE)
+ if (LLPanel::handleMouseUp(x,y,mask) == FALSE)
{
mNotification->respond(mNotification->getResponseTemplate());
}
diff --git a/indra/newview/lltoastimpanel.h b/indra/newview/lltoastimpanel.h
index 279dd69bc7..3eb11fb3bc 100644
--- a/indra/newview/lltoastimpanel.h
+++ b/indra/newview/lltoastimpanel.h
@@ -52,7 +52,7 @@ public:
LLToastIMPanel(LLToastIMPanel::Params &p);
virtual ~LLToastIMPanel();
- /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
+ /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask);
private:
void showInspector();
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 50735d10bd..927ee8f380 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -192,7 +192,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("bumps", "floater_bumps.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBump>);
LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCamera>);
- LLFloaterReg::add("chat_bar", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNearbyChat>);
+ LLFloaterReg::add("nearby_chat", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNearbyChat>);
LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCompileQueue>);
LLFloaterReg::add("conversation", "floater_conversation_log.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterConversationLog>);
diff --git a/indra/newview/llviewergesture.cpp b/indra/newview/llviewergesture.cpp
index c7d37e102e..a2dea31d9b 100644
--- a/indra/newview/llviewergesture.cpp
+++ b/indra/newview/llviewergesture.cpp
@@ -130,7 +130,7 @@ void LLViewerGesture::doTrigger( BOOL send_chat )
{
// Don't play nodding animation, since that might not blend
// with the gesture animation.
- LLNearbyChat::getInstance()->sendChatFromViewer(mOutputString, CHAT_TYPE_NORMAL, FALSE);
+ LLNearbyChat::instance().sendChatFromViewer(mOutputString, CHAT_TYPE_NORMAL, FALSE);
}
}
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index 385d3cd29a..7105720eb4 100644
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -543,7 +543,7 @@ void start_gesture( EKeystate s )
if (KEYSTATE_UP == s &&
! (focus_ctrlp && focus_ctrlp->acceptsTextInput()))
{
- if (LLNearbyChat::getInstance()->getCurrentChat().empty())
+ if (LLNearbyChat::instance().getCurrentChat().empty())
{
// No existing chat in chat editor, insert '/'
LLNearbyChat::startChat("/");
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index b20b86a582..9abd269f0f 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2297,12 +2297,10 @@ void god_message_name_cb(const LLAvatarName& av_name, LLChat chat, std::string m
// Treat like a system message and put in chat history.
chat.mText = av_name.getCompleteName() + ": " + message;
- LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
- if(nearby_chat)
+ if (LLNearbyChat::instanceExists())
{
- nearby_chat->addMessage(chat);
+ LLNearbyChat::instance().addMessage(chat);
}
-
}
void process_improved_im(LLMessageSystem *msg, void **user_data)
@@ -2897,8 +2895,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
// Note: lie to Nearby Chat, pretending that this is NOT an IM, because
// IMs from obejcts don't open IM sessions.
- LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
- if(!chat_from_system && nearby_chat)
+ if(!chat_from_system && LLNearbyChat::instanceExists())
{
chat.mOwnerID = from_id;
LLSD args;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 1bcf15913f..23d2b1633d 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -198,7 +198,6 @@
#include "llfloaternotificationsconsole.h"
-#include "llnearbychat.h"
#include "llwindowlistener.h"
#include "llviewerwindowlistener.h"
#include "llpaneltopinfobar.h"
@@ -2497,43 +2496,42 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
// Traverses up the hierarchy
if( keyboard_focus )
{
- LLNearbyChat* nearby_chat = LLFloaterReg::findTypedInstance<LLNearbyChat>("chat_bar");
-
- if (nearby_chat)
+ if (LLNearbyChat::instanceExists())
{
- LLChatEntry* chat_editor = nearby_chat->getChatBox();
-
- // arrow keys move avatar while chatting hack
- if (chat_editor && chat_editor->hasFocus())
- {
- // If text field is empty, there's no point in trying to move
- // cursor with arrow keys, so allow movement
- if (chat_editor->getText().empty()
- || gSavedSettings.getBOOL("ArrowKeysAlwaysMove"))
+ LLChatEntry* chat_editor = LLNearbyChat::instance().getChatBox();
+
+ // arrow keys move avatar while chatting hack
+ if (chat_editor && chat_editor->hasFocus())
{
- // let Control-Up and Control-Down through for chat line history,
- if (!(key == KEY_UP && mask == MASK_CONTROL)
- && !(key == KEY_DOWN && mask == MASK_CONTROL))
+ // If text field is empty, there's no point in trying to move
+ // cursor with arrow keys, so allow movement
+ if (chat_editor->getText().empty()
+ || gSavedSettings.getBOOL("ArrowKeysAlwaysMove"))
{
- switch(key)
+ // let Control-Up and Control-Down through for chat line history,
+ if (!(key == KEY_UP && mask == MASK_CONTROL)
+ && !(key == KEY_DOWN && mask == MASK_CONTROL))
{
- case KEY_LEFT:
- case KEY_RIGHT:
- case KEY_UP:
- case KEY_DOWN:
- case KEY_PAGE_UP:
- case KEY_PAGE_DOWN:
- case KEY_HOME:
- // when chatbar is empty or ArrowKeysAlwaysMove set,
- // pass arrow keys on to avatar...
- return FALSE;
- default:
- break;
+ switch(key)
+ {
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ case KEY_UP:
+ case KEY_DOWN:
+ case KEY_PAGE_UP:
+ case KEY_PAGE_DOWN:
+ case KEY_HOME:
+ // when chatbar is empty or ArrowKeysAlwaysMove set,
+ // pass arrow keys on to avatar...
+ return FALSE;
+ default:
+ break;
+ }
}
}
}
}
- }
+
if (keyboard_focus->handleKey(key, mask, FALSE))
{
return TRUE;
@@ -2564,11 +2562,11 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
if ( gSavedSettings.getS32("LetterKeysFocusChatBar") && !gAgentCamera.cameraMouselook() &&
!keyboard_focus && key < 0x80 && (mask == MASK_NONE || mask == MASK_SHIFT) )
{
- LLChatEntry* chat_editor = LLNearbyChat::getInstance()->getChatBox();
+ LLChatEntry* chat_editor = LLNearbyChat::instance().getChatBox();
if (chat_editor)
{
// passing NULL here, character will be added later when it is handled by character handler.
- LLNearbyChat::getInstance()->startChat(NULL);
+ LLNearbyChat::instance().startChat(NULL);
return TRUE;
}
}
diff --git a/indra/newview/skins/default/xui/da/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/da/panel_nearby_chat_bar.xml
index 949cbcbd7b..eb104201f8 100644
--- a/indra/newview/skins/default/xui/da/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/da/panel_nearby_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="chat_bar">
+<panel name="nearby_chat">
<line_editor label="Klik her for at chatte." name="chat_box" tool_tip="Tryk på enter for at tale, Ctrl-Enter for at råbe."/>
<button name="show_nearby_chat" tool_tip="Viser/skjuler log for chat nærved"/>
</panel>
diff --git a/indra/newview/skins/default/xui/de/floater_chat_bar.xml b/indra/newview/skins/default/xui/de/floater_chat_bar.xml
index 2464a55665..ab77d4dae5 100644
--- a/indra/newview/skins/default/xui/de/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/de/floater_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="chat_bar" title="CHAT IN DER NÄHE">
+<floater name="nearby_chat" title="CHAT IN DER NÄHE">
<panel name="bottom_panel">
<line_editor label="Zum Chatten hier klicken." name="chat_box" tool_tip="Eingabetaste zum Sprechen, Strg+Eingabe zum Rufen"/>
<button name="show_nearby_chat" tool_tip="Chatprotokoll in der Nähe ein-/ausblenden"/>
diff --git a/indra/newview/skins/default/xui/de/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/de/panel_nearby_chat_bar.xml
index 08cc0b0ec8..69cf6d98de 100644
--- a/indra/newview/skins/default/xui/de/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/de/panel_nearby_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="chat_bar">
+<panel name="nearby_chat">
<line_editor label="Zum Chatten hier klicken." name="chat_box" tool_tip="Eingabe drücken, um zu sprechen, Strg-Eingabe drücken, um zu Rufen."/>
<button name="show_nearby_chat" tool_tip="Protokoll des Chats in der Nähe anzeigen/ausblenden"/>
</panel>
diff --git a/indra/newview/skins/default/xui/en/floater_conversation_preview.xml b/indra/newview/skins/default/xui/en/floater_conversation_preview.xml
index 27b744aefb..c837a0ee57 100644
--- a/indra/newview/skins/default/xui/en/floater_conversation_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_conversation_preview.xml
@@ -3,7 +3,7 @@
legacy_header_height="18"
can_resize="true"
default_tab_group="1"
- height="361"
+ height="391"
layout="topleft"
min_height="243"
min_width="234"
@@ -50,4 +50,14 @@
left="5"
width="390">
</chat_history>
+ <button
+ follows="bottom|right"
+ height="22"
+ layout="topleft"
+ name="more_history"
+ label="More history..."
+ right="-15"
+ top_pad="5"
+ width="100">
+ </button>
</floater>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 1aa55acf2d..aa131035ed 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -225,10 +225,10 @@
use_mac_ctrl="true">
<menu_item_check.on_check
function="Floater.Visible"
- parameter="chat_bar" />
+ parameter="nearby_chat" />
<menu_item_check.on_click
function="Floater.Toggle"
- parameter="chat_bar" />
+ parameter="nearby_chat" />
</menu_item_check>
<menu_item_check
label="Speak"
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
index f4722b05d6..27a27473d8 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
@@ -46,7 +46,7 @@
follows="left|right"
top="4"
width="310"
- name="chat_bar"
+ name="nearby_chat"
mouse_opaque="false"/>
</layout_panel>
<layout_panel
diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml
index 6bc9c48729..19143cef89 100644
--- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml
@@ -5,7 +5,7 @@
height="25"
layout="topleft"
left="0"
- name="chat_bar"
+ name="nearby_chat"
top="21"
width="308">
<line_editor
diff --git a/indra/newview/skins/default/xui/es/floater_chat_bar.xml b/indra/newview/skins/default/xui/es/floater_chat_bar.xml
index 2e94805057..02369c9a43 100644
--- a/indra/newview/skins/default/xui/es/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/es/floater_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="chat_bar" title="CHAT">
+<floater name="nearby_chat" title="CHAT">
<panel name="bottom_panel">
<line_editor label="Pulsa aquí para chatear." name="chat_box" tool_tip="Pulsa Enter para decirlo o Ctrl+Enter para gritarlo"/>
<button name="show_nearby_chat" tool_tip="Muestra o esconde el registro del chat"/>
diff --git a/indra/newview/skins/default/xui/es/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/es/panel_nearby_chat_bar.xml
index af2b6e920b..e6ca59f912 100644
--- a/indra/newview/skins/default/xui/es/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/es/panel_nearby_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="chat_bar">
+<panel name="nearby_chat">
<line_editor label="Pulsa aquí para chatear." name="chat_box" tool_tip="Pulsa Enter para decirlo o Ctrl+Enter para gritarlo"/>
<button name="show_nearby_chat" tool_tip="Muestra o esconde el registro del chat"/>
</panel>
diff --git a/indra/newview/skins/default/xui/fr/floater_chat_bar.xml b/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
index 890411d091..7dcb9a280d 100644
--- a/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/fr/floater_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="chat_bar" title="CHAT PRÈS DE MOI">
+<floater name="nearby_chat" title="CHAT PRÈS DE MOI">
<panel name="bottom_panel">
<line_editor label="Cliquer ici pour chatter." name="chat_box" tool_tip="Appuyer sur Entrée pour dire, Ctrl+Entrée pour crier"/>
<button name="show_nearby_chat" tool_tip="Afficher/masquer le journal de chat près de vous."/>
diff --git a/indra/newview/skins/default/xui/fr/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/fr/panel_nearby_chat_bar.xml
index 82cdf292ab..762dee01bb 100644
--- a/indra/newview/skins/default/xui/fr/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/fr/panel_nearby_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="chat_bar">
+<panel name="nearby_chat">
<line_editor label="Cliquer ici pour chatter." name="chat_box" tool_tip="Appuyer sur Entrée pour dire, Ctrl-Entrée pour crier"/>
<button name="show_nearby_chat" tool_tip="Affiche/Masque le journal de chats près de vous"/>
</panel>
diff --git a/indra/newview/skins/default/xui/it/floater_chat_bar.xml b/indra/newview/skins/default/xui/it/floater_chat_bar.xml
index 94c85b50c8..b47e32ce90 100644
--- a/indra/newview/skins/default/xui/it/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/it/floater_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="chat_bar" title="CHAT NEI DINTORNI">
+<floater name="nearby_chat" title="CHAT NEI DINTORNI">
<panel name="bottom_panel">
<line_editor label="Clicca qui per la chat." name="chat_box" tool_tip="Premi Invio per parlare, Ctrl+Invio per gridare"/>
<button name="show_nearby_chat" tool_tip="Mostra/Nasconde il registro della chat nei dintorni"/>
diff --git a/indra/newview/skins/default/xui/it/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/it/panel_nearby_chat_bar.xml
index 6317d3192e..1fef88870a 100644
--- a/indra/newview/skins/default/xui/it/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/it/panel_nearby_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="chat_bar">
+<panel name="nearby_chat">
<string name="min_width">
192
</string>
diff --git a/indra/newview/skins/default/xui/ja/floater_chat_bar.xml b/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
index 11f223ade6..9f5df6fb85 100644
--- a/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/ja/floater_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="chat_bar" title="近くのチャット">
+<floater name="nearby_chat" title="近くのチャット">
<panel name="bottom_panel">
<line_editor label="ここをクリックしてチャットを開始します。" name="chat_box" tool_tip="Enter キーを押して話し、Ctrl + Enter キーで叫びます。"/>
<button name="show_nearby_chat" tool_tip="近くのチャットログを表示/非表示"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/ja/panel_nearby_chat_bar.xml
index 5998206f27..201fb0a376 100644
--- a/indra/newview/skins/default/xui/ja/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/ja/panel_nearby_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="chat_bar">
+<panel name="nearby_chat">
<line_editor label="ここをクリックしてチャットを開始します。" name="chat_box" tool_tip="Enter キーを押して発言し、Ctrl + Enter キーで叫びます。"/>
<button name="show_nearby_chat" tool_tip="近くのチャットログを表示・非表示"/>
</panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/pl/panel_nearby_chat_bar.xml
index 63cf96b571..4ed3ff669b 100644
--- a/indra/newview/skins/default/xui/pl/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/pl/panel_nearby_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="chat_bar">
+<panel name="nearby_chat">
<string name="min_width">
192
</string>
diff --git a/indra/newview/skins/default/xui/pt/floater_chat_bar.xml b/indra/newview/skins/default/xui/pt/floater_chat_bar.xml
index 72016c6b40..2eb2c94940 100644
--- a/indra/newview/skins/default/xui/pt/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/pt/floater_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="chat_bar" title="BATE-PAPO LOCAL">
+<floater name="nearby_chat" title="BATE-PAPO LOCAL">
<panel name="bottom_panel">
<line_editor label="Clique aqui para bater papo." name="chat_box" tool_tip="Tecle Enter para falar, Ctrl+Enter para gritar"/>
<button name="show_nearby_chat" tool_tip="Mostra/oculta o histórico do bate-papo local"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/pt/panel_nearby_chat_bar.xml
index 9b993488be..5628a87109 100644
--- a/indra/newview/skins/default/xui/pt/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/pt/panel_nearby_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="chat_bar">
+<panel name="nearby_chat">
<line_editor label="Clique aqui para bater papo." name="chat_box" tool_tip="Tecle Enter para falar, Ctrl+Enter para gritar"/>
<button name="show_nearby_chat" tool_tip="Mostra/oculta o histórico do bate-papo local"/>
</panel>
diff --git a/indra/newview/skins/default/xui/ru/floater_chat_bar.xml b/indra/newview/skins/default/xui/ru/floater_chat_bar.xml
index 79b7b033fb..f6b2fc81e1 100644
--- a/indra/newview/skins/default/xui/ru/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/ru/floater_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="chat_bar" title="ЛОКАЛЬНЫЙ ЧАТ">
+<floater name="nearby_chat" title="ЛОКАЛЬНЫЙ ЧАТ">
<panel name="bottom_panel">
<line_editor label="Щелкните здесь для общения." name="chat_box" tool_tip="Нажмите Enter, чтобы сказать, Ctrl+Enter, чтобы прокричать"/>
<button name="show_nearby_chat" tool_tip="Показать/скрыть лог локального чата"/>
diff --git a/indra/newview/skins/default/xui/ru/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/ru/panel_nearby_chat_bar.xml
index 804ba7def7..395c643b0b 100644
--- a/indra/newview/skins/default/xui/ru/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/ru/panel_nearby_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="chat_bar">
+<panel name="nearby_chat">
<line_editor label="Щелкните здесь для общения" name="chat_box" tool_tip="Нажмите Enter, чтобы сказать, Ctrl+Enter, чтобы прокричать"/>
<button name="show_nearby_chat" tool_tip="Показать/скрыть лог локального чата"/>
</panel>
diff --git a/indra/newview/skins/default/xui/tr/floater_chat_bar.xml b/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
index 988c845982..cd999b4b7a 100644
--- a/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/tr/floater_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="chat_bar" title="YAKINDAKİ SOHBET">
+<floater name="nearby_chat" title="YAKINDAKİ SOHBET">
<panel name="bottom_panel">
<line_editor label="Sohbet etmek için buraya tıklayın." name="chat_box" tool_tip="Söylemek için Enter, bağırmak için Ctrl+Enter yapın"/>
<button name="show_nearby_chat" tool_tip="Yakın sohbet günlüğünü gösterir/gizler"/>
diff --git a/indra/newview/skins/default/xui/tr/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/tr/panel_nearby_chat_bar.xml
index fd954475ac..7d191191c4 100644
--- a/indra/newview/skins/default/xui/tr/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/tr/panel_nearby_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="chat_bar">
+<panel name="nearby_chat">
<line_editor label="Sohbet etmek için buraya tıklayın." name="chat_box" tool_tip="Söylemek için Enter, bağırmak için Ctrl+Enter yapın"/>
<button name="show_nearby_chat" tool_tip="yakın sohbet günlüğünü gösterir/gizler"/>
</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/zh/panel_nearby_chat_bar.xml
index 3cabfcfaba..f27f205c44 100644
--- a/indra/newview/skins/default/xui/zh/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/zh/panel_nearby_chat_bar.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel name="chat_bar">
+<panel name="nearby_chat">
<line_editor label="點擊此處開始聊天。" name="chat_box" tool_tip="按下 Enter 鍵來說或按下 Ctrl+Enter 來喊叫"/>
<button name="show_nearby_chat" tool_tip="顯示 / 隱藏 附近的聊天紀錄"/>
</panel>