diff options
author | Jonathan Yap <jhwelch@gmail.com> | 2014-06-11 17:05:06 -0400 |
---|---|---|
committer | Jonathan Yap <jhwelch@gmail.com> | 2014-06-11 17:05:06 -0400 |
commit | ae7e074e7c8c35693fe8a5b888e96b911a46b43b (patch) | |
tree | ba7324ab6264cf7475db76c4b0f4fddf9fb17775 | |
parent | 078941c4a43289e35c9e8f0f566a6e55941592fb (diff) |
STORM-2034 Fix and improve processing when hours overflow to days
-rwxr-xr-x | indra/newview/llpanelmaininventory.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a23b56a637..46826c29ef 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -702,6 +702,30 @@ void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) if ( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() ) { self->getChild<LLUICtrl>("check_since_logoff")->setValue(false); + + U32 days = (U32)self->mSpinSinceDays->get(); + U32 hours = (U32)self->mSpinSinceHours->get(); + if (hours >= 24) + { +// Try to handle both cases of spinner clicking and text input in a sensible fashion as best as possible. +// There is no way to tell if someone has clicked the spinner to get to 24 or input 24 manually, so in this +// case add to days. Any value > 24 means they have input the hours manually, so do not add to the current +// day value. + if (24 == hours) // Got to 24 via spinner clicking or text input of 24 + { + days = days + hours / 24; + } + else // Text input, so do not add to days + { + days = hours / 24; + } + hours = (U32)hours % 24; + self->mSpinSinceHours->setFocus(false); + self->mSpinSinceDays->setFocus(false); + self->mSpinSinceDays->set((F32)days); + self->mSpinSinceHours->set((F32)hours); + self->mSpinSinceHours->setFocus(true); + } } } @@ -844,7 +868,7 @@ void LLFloaterInventoryFinder::draw() } U32 days = (U32)mSpinSinceDays->get(); U32 hours = (U32)mSpinSinceHours->get(); - if (hours > 24) + if (hours >= 24) { days = hours / 24; hours = (U32)hours % 24; @@ -856,6 +880,7 @@ void LLFloaterInventoryFinder::draw() mSpinSinceHours->setFocus(true); } hours += days * 24; + mPanelMainInventory->getPanel()->setHoursAgo(hours); mPanelMainInventory->getPanel()->setSinceLogoff(getCheckSinceLogoff()); mPanelMainInventory->setFilterTextFromFilter(); |