diff options
-rwxr-xr-x | indra/newview/llinventoryfilter.cpp | 37 | ||||
-rwxr-xr-x | indra/newview/llinventoryfilter.h | 6 | ||||
-rwxr-xr-x | indra/newview/llinventorypanel.cpp | 5 | ||||
-rwxr-xr-x | indra/newview/llinventorypanel.h | 1 | ||||
-rwxr-xr-x | indra/newview/llpanelmaininventory.cpp | 12 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml | 48 |
6 files changed, 92 insertions, 17 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 000eee3317..25447da53b 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -37,6 +37,7 @@ #include "llfolderview.h" #include "llinventorybridge.h" #include "llviewerfoldertype.h" +#include "llradiogroup.h" // linden library includes #include "llclipboard.h" @@ -51,6 +52,7 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p) mMinDate(p.date_range.min_date), mMaxDate(p.date_range.max_date), mHoursAgo(p.hours_ago), + mDateSearchDirection(p.date_search_direction), mShowFolderState(p.show_folder_state), mPermissions(p.permissions), mFilterTypes(p.types), @@ -209,6 +211,7 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent { const U16 HOURS_TO_SECONDS = 3600; time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS; + if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest) { earliest = mFilterOps.mMinDate; @@ -217,9 +220,20 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent { earliest = 0; } - if (listener->getCreationDate() < earliest || - listener->getCreationDate() > mFilterOps.mMaxDate) - return FALSE; + +llwarns << "DBG 3 " << mFilterOps.mDateSearchDirection << llendl; + if (1 == mFilterOps.mDateSearchDirection) + { + if (listener->getCreationDate() < earliest || + listener->getCreationDate() > mFilterOps.mMaxDate) + return FALSE; + } + else + { + if (listener->getCreationDate() > earliest || + listener->getCreationDate() > mFilterOps.mMaxDate) + return FALSE; + } } //////////////////////////////////////////////////////////////////////////////// @@ -635,6 +649,13 @@ void LLInventoryFilter::setHoursAgo(U32 hours) 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); + // Toggle for older than search + if (0 == mFilterOps.mDateSearchDirection) + { + less_restrictive = !less_restrictive; + more_restrictive = !more_restrictive; + } + mFilterOps.mHoursAgo = hours; mFilterOps.mMinDate = time_min(); mFilterOps.mMaxDate = time_max(); @@ -662,6 +683,16 @@ void LLInventoryFilter::setHoursAgo(U32 hours) } } +void LLInventoryFilter::setDateSearchDirection(U32 direction) +{ +llwarns << "DBG 2 " << direction << llendl; + if (direction != mFilterOps.mDateSearchDirection) + { + mFilterOps.mDateSearchDirection = direction; + setModified(FILTER_RESTART); + } +} + void LLInventoryFilter::setFilterLinks(U64 filter_links) { if (mFilterOps.mFilterLinks != filter_links) diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index ce516af0b9..2a95512995 100755 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -94,7 +94,8 @@ public: Optional<EFilterLink> links; Optional<LLUUID> uuid; Optional<DateRange> date_range; - Optional<S32> hours_ago; + Optional<U32> hours_ago; + Optional<U32> date_search_direction; Optional<EFolderShow> show_folder_state; Optional<PermissionMask> permissions; @@ -107,6 +108,7 @@ public: uuid("uuid"), date_range("date_range"), hours_ago("hours_ago", 0), + date_search_direction("date_search_direction", 0), show_folder_state("show_folder_state", SHOW_NON_EMPTY_FOLDERS), permissions("permissions", PERM_NONE) {} @@ -124,6 +126,7 @@ public: time_t mMinDate, mMaxDate; U32 mHoursAgo; + U32 mDateSearchDirection; EFolderShow mShowFolderState; PermissionMask mPermissions; @@ -177,6 +180,7 @@ public: void setHoursAgo(U32 hours); U32 getHoursAgo() const; + void setDateSearchDirection(U32 direction); void setFilterLinks(U64 filter_link); U64 getFilterLinks() const; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index e74e58015a..1a3710afe7 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -400,6 +400,11 @@ void LLInventoryPanel::setHoursAgo(U32 hours) getFilter().setHoursAgo(hours); } +void LLInventoryPanel::setDateSearchDirection(U32 direction) +{ + getFilter().setDateSearchDirection(direction); +} + void LLInventoryPanel::setFilterLinks(U64 filter_links) { getFilter().setFilterLinks(filter_links); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 91c3efd8f0..a490dfce5d 100755 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -173,6 +173,7 @@ public: const std::string getFilterSubString(); void setSinceLogoff(BOOL sl); void setHoursAgo(U32 hours); + void setDateSearchDirection(U32 direction); BOOL getSinceLogoff(); void setFilterLinks(U64 filter_links); 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<LLSpinCtrl>("spin_days_ago"); childSetCommitCallback("spin_days_ago", onTimeAgo, this); + mSinceDirection = getChild<LLRadioGroup>("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<LLUICtrl>("check_since_logoff")->getValue(); } +U32 LLFloaterInventoryFinder::getDateSearchDirection() +{ + return mSinceDirection->getSelectedIndex(); +} + void LLFloaterInventoryFinder::onCloseBtn(void* user_data) { LLFloaterInventoryFinder* finderp = (LLFloaterInventoryFinder*)user_data; diff --git a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml index c86ed595a7..5c7c4de9e8 100755 --- a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml @@ -2,7 +2,7 @@ <floater legacy_header_height="18" can_minimize="false" - height="408" + height="440" layout="topleft" name="Inventory Finder" help_topic="inventory_finder" @@ -95,36 +95,36 @@ width="126" /> <icon height="16" - image_name="Inv_Mesh" + image_name="Inv_Notecard" layout="topleft" left="8" mouse_opaque="true" - name="icon_mesh" - top="142" + name="icon_notecard" + top="122" width="16" /> <check_box height="16" - label="Meshes" + label="Notecards" layout="topleft" left_pad="2" - name="check_mesh" + name="check_notecard" top_delta="0" width="126" /> <icon height="16" - image_name="Inv_Notecard" + image_name="Inv_Mesh" layout="topleft" left="8" mouse_opaque="true" - name="icon_notecard" - top="122" + name="icon_mesh" + top="142" width="16" /> <check_box height="16" - label="Notecards" + label="Meshes" layout="topleft" left_pad="2" - name="check_notecard" + name="check_mesh" top_delta="0" width="126" /> <icon @@ -261,12 +261,34 @@ width="144"> - OR - </text> + + <radio_group + follows="top|left" + height="16" + layout="topleft" + left_delta="0" + name="date_search_direction" + top_pad="0" + width="270"> + <radio_item + label="Older than" + layout="topleft" + name="older" + top_pad="6" /> + <radio_item + label="Younger than" + layout="topleft" + name="yonger" + top_pad="-10" + left="120" /> + </radio_group> + <spinner follows="left|top" height="16" increment="1" initial_value="0" - label="Hours Ago" + label="Hours" label_width="64" layout="topleft" left_delta="0" @@ -279,7 +301,7 @@ height="16" increment="1" initial_value="0" - label="Days Ago" + label="Days" label_width="64" layout="topleft" left_delta="0" |