From 4da7f68549f531a6bec3643727cc68fb29a00bfa Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 5 Jun 2014 17:06:59 -0400 Subject: VWR-25689 Support 'older than' when inventory filtering --- indra/newview/llpanelmaininventory.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index b02298090a..310b5f5639 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); @@ -91,6 +93,7 @@ private: LLPanelMainInventory* mPanelMainInventory; LLSpinCtrl* mSpinSinceDays; LLSpinCtrl* mSpinSinceHours; + LLRadioGroup* mSinceDirection; LLInventoryFilter* mFilter; }; @@ -687,6 +690,9 @@ BOOL LLFloaterInventoryFinder::postBuild() mSpinSinceDays = getChild("spin_days_ago"); childSetCommitCallback("spin_days_ago", onTimeAgo, this); + mSinceDirection = getChild("date_search_direction"); + mSinceDirection->setSelectedIndex(0); + childSetAction("Close", onCloseBtn, this); updateElementsFromFilter(); @@ -851,6 +857,7 @@ void LLFloaterInventoryFinder::draw() mPanelMainInventory->getPanel()->setHoursAgo(hours); mPanelMainInventory->getPanel()->setSinceLogoff(getCheckSinceLogoff()); mPanelMainInventory->setFilterTextFromFilter(); + mPanelMainInventory->getPanel()->setDateSearchDirection(getDateSearchDirection()); LLPanel::draw(); } @@ -865,6 +872,11 @@ BOOL LLFloaterInventoryFinder::getCheckSinceLogoff() return getChild("check_since_logoff")->getValue(); } +U32 LLFloaterInventoryFinder::getDateSearchDirection() +{ + return mSinceDirection->getSelectedIndex(); +} + void LLFloaterInventoryFinder::onCloseBtn(void* user_data) { LLFloaterInventoryFinder* finderp = (LLFloaterInventoryFinder*)user_data; -- cgit v1.2.3 From 89837f385261804781979bdac499d264457e3297 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 6 Jun 2014 14:56:11 -0400 Subject: STOMR-2034 XML adjustments and a bit of code cleanup --- indra/newview/llpanelmaininventory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 310b5f5639..862a07358b 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -681,6 +681,8 @@ BOOL LLFloaterInventoryFinder::postBuild() const LLRect& viewrect = mPanelMainInventory->getRect(); setRect(LLRect(viewrect.mLeft - getRect().getWidth(), viewrect.mTop, viewrect.mLeft, viewrect.mTop - getRect().getHeight())); + const U32 FILTER_NEWER = 0; + childSetAction("All", selectAllTypes, this); childSetAction("None", selectNoTypes, this); @@ -691,7 +693,7 @@ BOOL LLFloaterInventoryFinder::postBuild() childSetCommitCallback("spin_days_ago", onTimeAgo, this); mSinceDirection = getChild("date_search_direction"); - mSinceDirection->setSelectedIndex(0); + mSinceDirection->setSelectedIndex(FILTER_NEWER); childSetAction("Close", onCloseBtn, this); -- cgit v1.2.3 From 481f3cc54ba5ede6eadef77f1f808c39cb2cec92 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 7 Jun 2014 05:16:56 -0400 Subject: STORM-2034 Add persistence for new setting, more XML formatting changes, Fix two issues with how hours and days are calculated and displayed --- indra/newview/llpanelmaininventory.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 862a07358b..ba712d40ae 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -56,6 +56,7 @@ #include "llsidepanelinventory.h" #include "llfolderview.h" #include "llradiogroup.h" +//#include "llinventoryfilter.h" const std::string FILTERS_FILENAME("filters.xml"); @@ -93,7 +94,6 @@ private: LLPanelMainInventory* mPanelMainInventory; LLSpinCtrl* mSpinSinceDays; LLSpinCtrl* mSpinSinceHours; - LLRadioGroup* mSinceDirection; LLInventoryFilter* mFilter; }; @@ -681,8 +681,6 @@ BOOL LLFloaterInventoryFinder::postBuild() const LLRect& viewrect = mPanelMainInventory->getRect(); setRect(LLRect(viewrect.mLeft - getRect().getWidth(), viewrect.mTop, viewrect.mLeft, viewrect.mTop - getRect().getHeight())); - const U32 FILTER_NEWER = 0; - childSetAction("All", selectAllTypes, this); childSetAction("None", selectNoTypes, this); @@ -692,9 +690,6 @@ BOOL LLFloaterInventoryFinder::postBuild() mSpinSinceDays = getChild("spin_days_ago"); childSetCommitCallback("spin_days_ago", onTimeAgo, this); - mSinceDirection = getChild("date_search_direction"); - mSinceDirection->setSelectedIndex(FILTER_NEWER); - childSetAction("Close", onCloseBtn, this); updateElementsFromFilter(); @@ -727,6 +722,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()); @@ -748,6 +744,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() getChild("check_since_logoff")->setValue(mFilter->isSinceLogoff()); mSpinSinceHours->set((F32)(hours % 24)); mSpinSinceDays->set((F32)(hours / 24)); + getChild("date_search_direction")->setSelectedIndex(date_search_direction); } void LLFloaterInventoryFinder::draw() @@ -850,10 +847,14 @@ void LLFloaterInventoryFinder::draw() U32 hours = (U32)mSpinSinceHours->get(); 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); @@ -876,7 +877,7 @@ BOOL LLFloaterInventoryFinder::getCheckSinceLogoff() U32 LLFloaterInventoryFinder::getDateSearchDirection() { - return mSinceDirection->getSelectedIndex(); + return getChild("date_search_direction")->getSelectedIndex(); } void LLFloaterInventoryFinder::onCloseBtn(void* user_data) -- cgit v1.2.3 From e856e10c7d06c8a19b9e12407f13900fee8b80c1 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 9 Jun 2014 11:15:09 -0400 Subject: STORM-2034 Trivial code cleanup --- indra/newview/llpanelmaininventory.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index ba712d40ae..a23b56a637 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -56,7 +56,6 @@ #include "llsidepanelinventory.h" #include "llfolderview.h" #include "llradiogroup.h" -//#include "llinventoryfilter.h" const std::string FILTERS_FILENAME("filters.xml"); -- cgit v1.2.3 From ae7e074e7c8c35693fe8a5b888e96b911a46b43b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 11 Jun 2014 17:05:06 -0400 Subject: STORM-2034 Fix and improve processing when hours overflow to days --- indra/newview/llpanelmaininventory.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') 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("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(); -- cgit v1.2.3 From e2c4d2a0a10e1f69bb074e3be620ce3ecd613969 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 17 Jun 2014 05:45:20 -0400 Subject: STORM-2034 Adjust comment block indent --- indra/newview/llpanelmaininventory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 46826c29ef..6c8765c62d 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -707,10 +707,10 @@ void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) 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. + // 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; -- cgit v1.2.3