summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rwxr-xr-xindra/newview/llpanelmaininventory.cpp27
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();