Skip to content
Snippets Groups Projects
Commit e75d8342 authored by Oz Linden's avatar Oz Linden
Browse files

merge changes for storm-898

parents 5376850e 8785c707
No related branches found
No related tags found
No related merge requests found
......@@ -510,9 +510,15 @@ void LLInventoryFilter::setHoursAgo(U32 hours)
{
if (mFilterOps.mHoursAgo != hours)
{
bool are_date_limits_valid = mFilterOps.mMinDate == time_min() && mFilterOps.mMaxDate == time_max();
bool is_increasing = hours > mFilterOps.mHoursAgo;
bool is_increasing_from_zero = is_increasing && !mFilterOps.mHoursAgo;
// *NOTE: need to cache last filter time, in case filter goes stale
BOOL less_restrictive = (mFilterOps.mMinDate == time_min() && mFilterOps.mMaxDate == time_max() && hours > mFilterOps.mHoursAgo);
BOOL more_restrictive = (mFilterOps.mMinDate == time_min() && mFilterOps.mMaxDate == time_max() && hours <= mFilterOps.mHoursAgo);
BOOL less_restrictive = (are_date_limits_valid && ((is_increasing && mFilterOps.mHoursAgo)) || !hours);
BOOL more_restrictive = (are_date_limits_valid && (!is_increasing && hours) || is_increasing_from_zero);
mFilterOps.mHoursAgo = hours;
mFilterOps.mMinDate = time_min();
mFilterOps.mMaxDate = time_max();
......
......@@ -81,7 +81,6 @@ class LLFloaterInventoryFinder : public LLFloater
BOOL getCheckSinceLogoff();
static void onTimeAgo(LLUICtrl*, void *);
static void onCheckSinceLogoff(LLUICtrl*, void *);
static void onCloseBtn(void* user_data);
static void selectAllTypes(void* user_data);
static void selectNoTypes(void* user_data);
......@@ -619,20 +618,6 @@ LLFloaterInventoryFinder::LLFloaterInventoryFinder(LLPanelMainInventory* invento
updateElementsFromFilter();
}
void LLFloaterInventoryFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_data)
{
LLFloaterInventoryFinder *self = (LLFloaterInventoryFinder *)user_data;
if (!self) return;
bool since_logoff= self->getChild<LLUICtrl>("check_since_logoff")->getValue();
if (!since_logoff &&
!( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() ) )
{
self->mSpinSinceHours->set(1.0f);
}
}
BOOL LLFloaterInventoryFinder::postBuild()
{
const LLRect& viewrect = mPanelMainInventory->getRect();
......@@ -647,9 +632,6 @@ BOOL LLFloaterInventoryFinder::postBuild()
mSpinSinceDays = getChild<LLSpinCtrl>("spin_days_ago");
childSetCommitCallback("spin_days_ago", onTimeAgo, this);
// mCheckSinceLogoff = getChild<LLSpinCtrl>("check_since_logoff");
childSetCommitCallback("check_since_logoff", onCheckSinceLogoff, this);
childSetAction("Close", onCloseBtn, this);
updateElementsFromFilter();
......@@ -660,12 +642,10 @@ void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data)
LLFloaterInventoryFinder *self = (LLFloaterInventoryFinder *)user_data;
if (!self) return;
bool since_logoff=true;
if ( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() )
{
since_logoff = false;
self->getChild<LLUICtrl>("check_since_logoff")->setValue(false);
}
self->getChild<LLUICtrl>("check_since_logoff")->setValue(since_logoff);
}
void LLFloaterInventoryFinder::changeFilter(LLInventoryFilter* filter)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment