diff options
author | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2014-09-09 21:42:26 +0300 |
---|---|---|
committer | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2014-09-09 21:42:26 +0300 |
commit | b1c5edc5135b4ade68b0aa839506ea013dc2f40d (patch) | |
tree | 3707f94a8e5b78ca2b02f7e744c32798b8c8e20c /indra/newview/llpanelmaininventory.cpp | |
parent | 19ce74567954d5b234cb931f7faa5fe58037c513 (diff) | |
parent | eef4acc5367a486b0c52c6ce5e1aba995fefd99c (diff) |
Merge viewer-release 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 90dfb24377..a7c9dbdf7b 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); @@ -702,6 +704,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); + } } } @@ -721,6 +747,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()); @@ -742,6 +769,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() @@ -842,17 +870,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(); } @@ -867,6 +901,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; |