CHUI-318 FIXED (User cannot navigate forward in chat history viewer once the More History option is selected.)

- Added spinner so that user could select desired history page. Also displaying total count of pages.
meow-7.2.2
Paul ProductEngine 2012-09-06 23:34:47 +03:00
parent 973f54ace7
commit 62eb7ec030
3 changed files with 43 additions and 7 deletions

View File

@ -29,6 +29,7 @@
#include "llfloaterconversationpreview.h"
#include "llimview.h"
#include "lllineeditor.h"
#include "llspinctrl.h"
#include "lltrans.h"
LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_id)
@ -69,6 +70,15 @@ BOOL LLFloaterConversationPreview::postBuild()
LLLogChat::loadChatHistory(file, mMessages, true);
mCurrentPage = mMessages.size() / mPageSize;
mPageSpinner = getChild<LLSpinCtrl>("history_page_spin");
mPageSpinner->setCommitCallback(boost::bind(&LLFloaterConversationPreview::onMoreHistoryBtnClick, this));
mPageSpinner->setMinValue(1);
mPageSpinner->setMaxValue(mCurrentPage + 1);
mPageSpinner->set(mCurrentPage + 1);
std::string total_page_num = llformat("/ %d", mCurrentPage + 1);
getChild<LLTextBox>("page_num_label")->setValue(total_page_num);
return LLFloater::postBuild();
}
@ -128,6 +138,7 @@ void LLFloaterConversationPreview::showHistory()
void LLFloaterConversationPreview::onMoreHistoryBtnClick()
{
mCurrentPage = mPageSpinner->getValueF32();
if (--mCurrentPage < 0)
{
return;

View File

@ -29,6 +29,8 @@
#include "llchathistory.h"
#include "llfloater.h"
class LLSpinCtrl;
class LLFloaterConversationPreview : public LLFloater
{
public:
@ -45,6 +47,7 @@ private:
void onMoreHistoryBtnClick();
void showHistory();
LLSpinCtrl* mPageSpinner;
LLChatHistory* mChatHistory;
LLUUID mSessionID;
int mCurrentPage;

View File

@ -51,14 +51,36 @@
left="5"
width="390">
</chat_history>
<button
<text
follows="bottom|right"
font="SansSerif"
height="22"
layout="topleft"
name="more_history"
label="More history..."
right="-15"
top_pad="5"
width="100">
</button>
name="page_label"
right="-110"
top_pad="7"
value="Page"
width="35">
</text>
<spinner
decimal_digits="0"
follows="bottom|right"
height="23"
increment="1"
label_width="40"
layout="topleft"
left_pad="0"
name="history_page_spin"
top_delta="-3"
width="50"/>
<text
follows="bottom|right"
font="SandSerif"
height="22"
layout="topleft"
name="page_num_label"
left_pad="5"
top_delta="4"
width="40">
</text>
</floater>