From 37411bc7ebc5a34e8c9a5c43471291224a3cd35a Mon Sep 17 00:00:00 2001 From: dolphin Date: Fri, 21 Mar 2014 16:58:43 -0700 Subject: Experience log panel is live and updates as new events come in. Multiple identical events get collapsed int a single entry. --- indra/newview/llpanelexperiencelog.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanelexperiencelog.cpp') diff --git a/indra/newview/llpanelexperiencelog.cpp b/indra/newview/llpanelexperiencelog.cpp index e0e522e276..eeabab4c44 100644 --- a/indra/newview/llpanelexperiencelog.cpp +++ b/indra/newview/llpanelexperiencelog.cpp @@ -54,20 +54,22 @@ LLPanelExperienceLog::LLPanelExperienceLog( ) buildFromFile("panel_experience_log.xml"); } + BOOL LLPanelExperienceLog::postBuild( void ) { LLExperienceLog* log = LLExperienceLog::getInstance(); mEventList = getChild("experience_log_list"); mEventList->setCommitCallback(boost::bind(&LLPanelExperienceLog::onSelectionChanged, this)); + mEventList->setDoubleClickCallback( boost::bind(&LLPanelExperienceLog::onProfileExperience, this)); getChild("btn_clear")->setCommitCallback(boost::bind(&LLExperienceLog::clear, log)); getChild("btn_clear")->setCommitCallback(boost::bind(&LLPanelExperienceLog::refresh, this)); getChild(BTN_PROFILE_XP)->setCommitCallback(boost::bind(&LLPanelExperienceLog::onProfileExperience, this)); - getChild(BTN_REPORT_XP)->setCommitCallback(boost::bind(&LLPanelExperienceLog::onReportExperience, this)); - getChild("btn_notify")->setCommitCallback(boost::bind(&LLPanelExperienceLog::onNotify, this)); - getChild("btn_next")->setCommitCallback(boost::bind(&LLPanelExperienceLog::onNext, this)); - getChild("btn_prev")->setCommitCallback(boost::bind(&LLPanelExperienceLog::onPrev, this)); + getChild(BTN_REPORT_XP )->setCommitCallback(boost::bind(&LLPanelExperienceLog::onReportExperience, this)); + getChild("btn_notify" )->setCommitCallback(boost::bind(&LLPanelExperienceLog::onNotify, this)); + getChild("btn_next" )->setCommitCallback(boost::bind(&LLPanelExperienceLog::onNext, this)); + getChild("btn_prev" )->setCommitCallback(boost::bind(&LLPanelExperienceLog::onPrev, this)); LLCheckBoxCtrl* check = getChild("notify_all"); check->set(log->getNotifyNewEvent()); @@ -80,6 +82,7 @@ BOOL LLPanelExperienceLog::postBuild( void ) mPageSize = log->getPageSize(); refresh(); + mNewEvent = LLExperienceLog::instance().addUpdateSignal(boost::bind(&LLPanelExperienceLog::refresh, this)); return TRUE; } @@ -90,6 +93,7 @@ LLPanelExperienceLog* LLPanelExperienceLog::create() void LLPanelExperienceLog::refresh() { + S32 selected = mEventList->getFirstSelectedIndex(); mEventList->deleteAllItems(); const LLSD& events = LLExperienceLog::instance().getEvents(); @@ -169,6 +173,11 @@ void LLPanelExperienceLog::refresh() getChild("btn_next")->setEnabled(moreItems); getChild("btn_prev")->setEnabled(mCurrentPage>0); getChild("btn_clear")->setEnabled(mEventList->getItemCount()>0); + if(selected<0) + { + selected = 0; + } + mEventList->selectNthItem(selected); onSelectionChanged(); } } -- cgit v1.3