diff options
author | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2014-09-09 21:53:14 +0300 |
---|---|---|
committer | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2014-09-09 21:53:14 +0300 |
commit | b4704f5f8bf4b72edcf00aa74759ae73c89c5422 (patch) | |
tree | 691596f632ef36d7ec1c0705ada0a9f4070f8139 /indra/newview/llpanelmaininventory.cpp | |
parent | 1285807ec2f58c7dcab2f747461195e126ef26e3 (diff) | |
parent | b1c5edc5135b4ade68b0aa839506ea013dc2f40d (diff) |
Merge viewer-bear and become version 3.7.16
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rwxr-xr-x | indra/newview/llpanelmaininventory.cpp | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e8a006d0be..eb037577be 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -55,6 +55,7 @@ #include "llviewertexturelist.h" #include "llsidepanelinventory.h" #include "llfolderview.h" +#include "llradiogroup.h" const std::string FILTERS_FILENAME("filters.xml"); @@ -82,6 +83,7 @@ public: void updateElementsFromFilter(); BOOL getCheckShowEmpty(); BOOL getCheckSinceLogoff(); + U32 getDateSearchDirection(); static void onTimeAgo(LLUICtrl*, void *); static void onCloseBtn(void* user_data); @@ -704,6 +706,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); + } } } @@ -723,6 +749,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() std::string filter_string = mFilter->getFilterSubString(); LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState(); U32 hours = mFilter->getHoursAgo(); + U32 date_search_direction = mFilter->getDateSearchDirection(); // update the ui elements setTitle(mFilter->getName()); @@ -744,6 +771,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() getChild<LLUICtrl>("check_since_logoff")->setValue(mFilter->isSinceLogoff()); mSpinSinceHours->set((F32)(hours % 24)); mSpinSinceDays->set((F32)(hours / 24)); + getChild<LLRadioGroup>("date_search_direction")->setSelectedIndex(date_search_direction); } void LLFloaterInventoryFinder::draw() @@ -844,17 +872,23 @@ void LLFloaterInventoryFinder::draw() } U32 days = (U32)mSpinSinceDays->get(); U32 hours = (U32)mSpinSinceHours->get(); - if (hours > 24) + if (hours >= 24) { - days += hours / 24; + days = hours / 24; hours = (U32)hours % 24; + // A UI element that has focus will not display a new value set to it + mSpinSinceHours->setFocus(false); + mSpinSinceDays->setFocus(false); mSpinSinceDays->set((F32)days); mSpinSinceHours->set((F32)hours); + mSpinSinceHours->setFocus(true); } hours += days * 24; + mPanelMainInventory->getPanel()->setHoursAgo(hours); mPanelMainInventory->getPanel()->setSinceLogoff(getCheckSinceLogoff()); mPanelMainInventory->setFilterTextFromFilter(); + mPanelMainInventory->getPanel()->setDateSearchDirection(getDateSearchDirection()); LLPanel::draw(); } @@ -869,6 +903,11 @@ BOOL LLFloaterInventoryFinder::getCheckSinceLogoff() return getChild<LLUICtrl>("check_since_logoff")->getValue(); } +U32 LLFloaterInventoryFinder::getDateSearchDirection() +{ + return getChild<LLRadioGroup>("date_search_direction")->getSelectedIndex(); +} + void LLFloaterInventoryFinder::onCloseBtn(void* user_data) { LLFloaterInventoryFinder* finderp = (LLFloaterInventoryFinder*)user_data; |