From a1a1410d25c3e4ff87e33344b416b7a827cdb1c2 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Mon, 27 Aug 2012 18:16:47 -0700 Subject: Skipping the realloc alignment test on Linux as the ll_aligned_malloc_16() function is not implemented to ensure alignment on Linux. --- indra/llcommon/llmemory.h | 2 ++ indra/llmath/tests/alignment_test.cpp | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'indra') 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); -- cgit v1.2.3 From d4ee17e533d652e90989e60bcbc097c81e73d081 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Tue, 28 Aug 2012 14:48:32 +0300 Subject: CHUI-275 FIXED (Chat history viewer does not show entire user.txt IM log file) - Renamed LLLogChat::loadAllHistory to LLLogChat::loadChatHistory because it doesn't actually loads all history. Also added parameter to the function which is a flag whether to load all file's content or not. - Implemented displaying history by pages (as was decided on meeting page): Added showHistory() method to the LLFloaterConversationPreview which shows the chat history page by page starting from the last conversation (or may say starting from the last page). One page contains 100 entries. Added "More history..." button to display next page of history. --- indra/newview/app_settings/settings.xml | 11 +++ indra/newview/llfloaterconversationpreview.cpp | 90 +++++++++++++--------- indra/newview/llfloaterconversationpreview.h | 7 +- indra/newview/llimview.cpp | 2 +- indra/newview/lllogchat.cpp | 6 +- indra/newview/lllogchat.h | 4 +- indra/newview/llnearbychat.cpp | 2 +- .../xui/en/floater_conversation_preview.xml | 12 ++- 8 files changed, 88 insertions(+), 46 deletions(-) (limited to 'indra') 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 @@ Value + ConversationHistoryPageSize + + Comment + Chat history of conversation opened from call log is displayed by pages. So this is number of entries per page. + Persist + 1 + Type + S32 + Value + 100 + NearbyChatIsNotTornOff Comment diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index e8554bb066..2c34029c5c 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("chat_history"); + getChild("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("description")->setValue(name); } + std::string file = conv->getHistoryFileName(); + LLLogChat::loadChatHistory(file, mMessages, true); + + mCurrentPage = mMessages.size() / mPageSize; + return LLFloater::postBuild(); } @@ -62,51 +70,59 @@ 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 messages; - std::string file = conv->getHistoryFileName(); - LLLogChat::loadAllHistory(file, messages); - if (messages.size()) + mChatHistory->clear(); + + std::ostringstream message; + std::list::const_iterator iter = mMessages.begin(); + + int delta = 0; + if (mCurrentPage) { - std::ostringstream message; - std::list::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); - } + double num_of_pages = (double)mMessages.size() / mPageSize; + delta = (ceil(num_of_pages) - num_of_pages) * 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 mMessages; }; #endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */ diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 216db15c94..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 chat_history; //involves parsing of a chat history - LLLogChat::loadAllHistory(mHistoryFileName, chat_history); + LLLogChat::loadChatHistory(mHistoryFileName, chat_history); addMessagesFromHistory(chat_history); } 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& messages, const std::string& line) } // static -void LLLogChat::loadAllHistory(const std::string& file_name, std::list& messages) +void LLLogChat::loadChatHistory(const std::string& file_name, std::list& messages, bool load_all_history/*= false*/) { if (file_name.empty()) { @@ -412,8 +412,8 @@ void LLLogChat::loadAllHistory(const std::string& file_name, std::list& 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& messages); + static void loadChatHistory(const std::string& file_name, std::list& 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 a723748094..f1518fe825 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -262,7 +262,7 @@ void LLNearbyChat::loadHistory() do_not_log["do_not_log"] = true; std::list history; - LLLogChat::loadAllHistory("chat", history); + LLLogChat::loadChatHistory("chat", history); std::list::const_iterator it = history.begin(); while (it != history.end()) 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"> + -- cgit v1.2.3 From 11e9f66e6217c22373f5d47518f6d1f9885f1793 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 28 Aug 2012 12:41:57 -0700 Subject: BUILDFIX: Correcting a linux build error. --- indra/newview/llfloaterconversationpreview.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 2c34029c5c..ae6f1441eb 100644 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -88,8 +88,13 @@ void LLFloaterConversationPreview::showHistory() int delta = 0; if (mCurrentPage) { - double num_of_pages = (double)mMessages.size() / mPageSize; - delta = (ceil(num_of_pages) - num_of_pages) * mPageSize; + // 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(mMessages.size()) / static_cast(mPageSize); + delta = static_cast((ceil(num_of_pages) - num_of_pages) * static_cast(mPageSize)); } std::advance(iter, (mCurrentPage * mPageSize) - delta); -- cgit v1.2.3 From 051bc99573d7c571cea0e2e1df332c1e5e97ff19 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Tue, 28 Aug 2012 20:08:17 +0300 Subject: CHUI-287 FIX IM toast panel is closed upon mouse up and doesn't pass the mouse click that activates "click to walk". --- indra/newview/lltoastimpanel.cpp | 4 ++-- indra/newview/lltoastimpanel.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') 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(); -- cgit v1.2.3