summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llfloaterconversationpreview.cpp24
-rwxr-xr-xindra/newview/llfloaterconversationpreview.h2
2 files changed, 10 insertions, 16 deletions
diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp
index dd8bea01b4..5041f4689d 100755
--- a/indra/newview/llfloaterconversationpreview.cpp
+++ b/indra/newview/llfloaterconversationpreview.cpp
@@ -44,7 +44,8 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i
mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize")),
mAccountName(session_id[LL_FCP_ACCOUNT_NAME]),
mCompleteName(session_id[LL_FCP_COMPLETE_NAME]),
- mMutex(NULL)
+ mMutex(NULL),
+ mShowHistory(false)
{
}
@@ -110,35 +111,27 @@ void LLFloaterConversationPreview::setPages(std::list<LLSD>& messages, const std
std::string total_page_num = llformat("/ %d", mCurrentPage+1);
getChild<LLTextBox>("page_num_label")->setValue(total_page_num);
- mChatHistoryLoaded = true;
+ mShowHistory = true;
}
}
void LLFloaterConversationPreview::draw()
{
- if(mChatHistoryLoaded)
+ if(mShowHistory)
{
showHistory();
+ mShowHistory = false;
}
LLFloater::draw();
}
void LLFloaterConversationPreview::onOpen(const LLSD& key)
{
- if(mChatHistoryLoaded)
- {
- showHistory();
- }
+ mShowHistory = true;
}
void LLFloaterConversationPreview::showHistory()
{
- if (!mChatHistoryLoaded)
- {
- return;
- }
- mChatHistoryLoaded = false;
-
// additional protection to avoid changes of mMessages in setPages
LLMutexLock lock(&mMutex);
if(!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size())
@@ -201,10 +194,11 @@ void LLFloaterConversationPreview::showHistory()
void LLFloaterConversationPreview::onMoreHistoryBtnClick()
{
mCurrentPage = (int)(mPageSpinner->getValueF32());
- if (--mCurrentPage < 0)
+ if (!mCurrentPage)
{
return;
}
- showHistory();
+ mCurrentPage--;
+ mShowHistory = true;
}
diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h
index f8796127ba..b0488f4ff1 100755
--- a/indra/newview/llfloaterconversationpreview.h
+++ b/indra/newview/llfloaterconversationpreview.h
@@ -62,7 +62,7 @@ private:
std::string mAccountName;
std::string mCompleteName;
std::string mChatHistoryFileName;
- bool mChatHistoryLoaded;
+ bool mShowHistory;
};
#endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */