aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-10-13 04:06:49 -0700
committerMcCabe Maxsted2009-10-13 04:06:49 -0700
commit879e30e0617798a786f39b815668cec4e6dbc310 (patch)
tree677cc61fdb15b8b08a26a1166d9442d777f4f9dd
parentDisable avatar appearance facelight when local lighting turned off (diff)
downloadmeta-impy-879e30e0617798a786f39b815668cec4e6dbc310.zip
meta-impy-879e30e0617798a786f39b815668cec4e6dbc310.tar.gz
meta-impy-879e30e0617798a786f39b815668cec4e6dbc310.tar.bz2
meta-impy-879e30e0617798a786f39b815668cec4e6dbc310.tar.xz
Updated inventory search to include description (from Emerald)
Diffstat (limited to '')
-rw-r--r--ChangeLog.txt9
-rw-r--r--linden/indra/newview/llfolderview.cpp57
-rw-r--r--linden/indra/newview/llfolderview.h11
-rw-r--r--linden/indra/newview/llinventoryactions.cpp20
-rw-r--r--linden/indra/newview/llinventoryview.cpp1
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_inventory.xml6
6 files changed, 87 insertions, 17 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index a28d812..fa273d3 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,5 +1,14 @@
12009-10-13 McCabe Maxsted <hakushakukun@gmail.com> 12009-10-13 McCabe Maxsted <hakushakukun@gmail.com>
2 2
3 * Updated inventory search to include description (from Emerald).
4
5 modified: linden/indra/newview/llfolderview.cpp
6 modified: linden/indra/newview/llfolderview.h
7 modified: linden/indra/newview/llinventoryactions.cpp
8 modified: linden/indra/newview/llinventoryview.cpp
9 modified: linden/indra/newview/skins/default/xui/en-us/floater_inventory.xml
10
11
3 * Disable avatar appearance facelight when local lighting turned off. 12 * Disable avatar appearance facelight when local lighting turned off.
4 13
5 modified: linden/indra/newview/pipeline.cpp 14 modified: linden/indra/newview/pipeline.cpp
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp
index 5407f06..61d7df0 100644
--- a/linden/indra/newview/llfolderview.cpp
+++ b/linden/indra/newview/llfolderview.cpp
@@ -297,11 +297,22 @@ void LLFolderViewItem::refreshFromListener()
297 else 297 else
298 mLabelCreator = creator_name;*/ 298 mLabelCreator = creator_name;*/
299 299
300 //Label for desc search
301 std::string desc;
302 if(item)
303 {
304 if(!item->getDescription().empty())
305 {
306 desc = item->getDescription();
307 }
308 }
309 mLabelDesc = desc;
310
300 //Label for name search 311 //Label for name search
301 mLabel = mListener->getDisplayName(); 312 mLabel = mListener->getDisplayName();
302 313
303 //Build label for combined search - RK 314 //Build label for combined search - RK
304 mLabelAll = mLabel + " " + mLabelCreator; 315 mLabelAll = mLabel + " " + mLabelCreator + " " + mLabelDesc;
305 316
306 setIcon(mListener->getIcon()); 317 setIcon(mListener->getIcon());
307 time_t creation_date = mListener->getCreationDate(); 318 time_t creation_date = mListener->getCreationDate();
@@ -321,32 +332,53 @@ void LLFolderViewItem::refresh()
321 332
322 std::string searchable_label(mLabel); 333 std::string searchable_label(mLabel);
323 std::string searchable_label_creator(mLabelCreator); 334 std::string searchable_label_creator(mLabelCreator);
335 std::string searchable_label_desc(mLabelDesc);
324 std::string searchable_label_all(mLabelAll); 336 std::string searchable_label_all(mLabelAll);
325 337
326 //add the (no modify), (no transfer) etc stuff to each label. 338 //add the (no modify), (no transfer) etc stuff to each label.
327 searchable_label.append(mLabelSuffix); 339 searchable_label.append(mLabelSuffix);
328 searchable_label_creator.append(mLabelSuffix); 340 searchable_label_creator.append(mLabelSuffix);
341 searchable_label_desc.append(mLabelSuffix);
329 searchable_label_all.append(mLabelSuffix); 342 searchable_label_all.append(mLabelSuffix);
330 343
331 //all labels need to be uppercase. 344 //all labels need to be uppercase.
332 LLStringUtil::toUpper(searchable_label); 345 LLStringUtil::toUpper(searchable_label);
333 LLStringUtil::toUpper(searchable_label_creator); 346 LLStringUtil::toUpper(searchable_label_creator);
347 LLStringUtil::toUpper(searchable_label_desc);
334 LLStringUtil::toUpper(searchable_label_all); 348 LLStringUtil::toUpper(searchable_label_all);
335 349
336 if (mSearchableLabel.compare(searchable_label) || 350 if (mSearchableLabel.compare(searchable_label) ||
337 mSearchableLabelCreator.compare(searchable_label_creator)) 351 mSearchableLabelCreator.compare(searchable_label_creator) ||
352 mSearchableLabelDesc.compare(searchable_label_creator))
338 { 353 {
339 mSearchableLabel.assign(searchable_label); 354 mSearchableLabel.assign(searchable_label);
340 mSearchableLabelCreator.assign(searchable_label_creator); 355 mSearchableLabelCreator.assign(searchable_label_creator);
356 mSearchableLabelDesc.assign(searchable_label_desc);
341 mSearchableLabelAll.assign(searchable_label_all); 357 mSearchableLabelAll.assign(searchable_label_all);
342 358
343 dirtyFilter(); 359 dirtyFilter();
344 // some part of label has changed, so overall width has potentially changed 360 //some part of label has changed, so overall width has potentially changed
345 if (mParentFolder) 361 if (mParentFolder)
346 {
347 mParentFolder->requestArrange(); 362 mParentFolder->requestArrange();
348 }
349 } 363 }
364
365 /*if(mSearchableLabelCreator.compare(searchable_label_creator))
366 {
367 mSearchableLabelCreator.assign(searchable_label_creator);
368
369 dirtyFilter();
370 if(mParentFolder)
371 mParentFolder->requestArrange();
372 }
373
374 if(mSearchableLabelDesc.compare(searchable_label_desc))
375 {
376 mSearchableLabelDesc.assign(searchable_label_desc);
377
378 dirtyFilter();
379 if(mParentFolder)
380 mParentFolder->requestArrange();
381 }*/
350 382
351 S32 label_width = sFont->getWidth(mLabel); 383 S32 label_width = sFont->getWidth(mLabel);
352 if( mLabelSuffix.size() ) 384 if( mLabelSuffix.size() )
@@ -621,11 +653,12 @@ void LLFolderViewItem::rename(const std::string& new_name)
621 } 653 }
622} 654}
623 655
624const std::string& LLFolderViewItem::getSearchableLabel() const 656const std::string& LLFolderViewItem::getSearchableLabel(U32 search_type = 0) const
625{ 657{
626 U32 search_type = gSavedSettings.getU32("InventorySearchType"); 658 if(search_type == 3)
627 if(search_type == 4)
628 return mSearchableLabelAll; 659 return mSearchableLabelAll;
660 else if(search_type == 2)
661 return mSearchableLabelDesc;
629 else if(search_type == 1) 662 else if(search_type == 1)
630 return mSearchableLabelCreator; 663 return mSearchableLabelCreator;
631 else 664 else
@@ -4564,11 +4597,13 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item)
4564 } 4597 }
4565 LLFolderViewEventListener* listener = item->getListener(); 4598 LLFolderViewEventListener* listener = item->getListener();
4566 const LLUUID& item_id = listener->getUUID(); 4599 const LLUUID& item_id = listener->getUUID();
4567 mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; 4600
4601 U32 search_type = gSavedSettings.getU32("InventorySearchType");
4602 mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel(search_type).find(mFilterSubString) : std::string::npos;
4568 BOOL passed = (listener->getNInventoryType() & mFilterOps.mFilterTypes || listener->getNInventoryType() == LLInventoryType::NIT_NONE) 4603 BOOL passed = (listener->getNInventoryType() & mFilterOps.mFilterTypes || listener->getNInventoryType() == LLInventoryType::NIT_NONE)
4569 && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) 4604 && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos)
4570 && (mFilterWorn == false || gAgent.isWearingItem(item_id) || 4605 && (mFilterWorn == false || gAgent.isWearingItem(item_id) ||
4571 gAgent.getAvatarObject() && gAgent.getAvatarObject()->isWearingAttachment(item_id)) 4606 (gAgent.getAvatarObject() && gAgent.getAvatarObject()->isWearingAttachment(item_id)))
4572 && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) 4607 && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions)
4573 && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); 4608 && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate);
4574 return passed; 4609 return passed;
diff --git a/linden/indra/newview/llfolderview.h b/linden/indra/newview/llfolderview.h
index 25b4362..82a1951 100644
--- a/linden/indra/newview/llfolderview.h
+++ b/linden/indra/newview/llfolderview.h
@@ -338,11 +338,16 @@ protected:
338 338
339 std::string mLabel; 339 std::string mLabel;
340 std::string mSearchableLabel; 340 std::string mSearchableLabel;
341 std::string mLabelAll; 341
342 std::string mSearchableLabelAll;
343 std::string mLabelCreator; 342 std::string mLabelCreator;
344 std::string mSearchableLabelCreator; 343 std::string mSearchableLabelCreator;
345 344
345 std::string mLabelDesc;
346 std::string mSearchableLabelDesc;
347
348 std::string mLabelAll;
349 std::string mSearchableLabelAll;
350
346 std::string mType; 351 std::string mType;
347 S32 mLabelWidth; 352 S32 mLabelWidth;
348 U32 mCreationDate; 353 U32 mCreationDate;
@@ -469,7 +474,7 @@ public:
469 // viewed. This method will ask the viewed object itself. 474 // viewed. This method will ask the viewed object itself.
470 const std::string& getName( void ) const; 475 const std::string& getName( void ) const;
471 476
472 const std::string& getSearchableLabel( void ) const; 477 const std::string& getSearchableLabel( U32 search_type ) const;
473 478
474 // This method returns the label displayed on the view. This 479 // This method returns the label displayed on the view. This
475 // method was primarily added to allow sorting on the folder 480 // method was primarily added to allow sorting on the folder
diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp
index b598c83..25592c1 100644
--- a/linden/indra/newview/llinventoryactions.cpp
+++ b/linden/indra/newview/llinventoryactions.cpp
@@ -484,7 +484,8 @@ class SetSearchType : public inventory_listener_t
484 gSavedSettings.setU32("InventorySearchType", 0); 484 gSavedSettings.setU32("InventorySearchType", 0);
485 485
486 mPtr->getControl("Inventory.SearchByName")->setValue(TRUE); 486 mPtr->getControl("Inventory.SearchByName")->setValue(TRUE);
487 mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); 487 mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE);
488 mPtr->getControl("Inventory.SearchByDesc")->setValue(FALSE);
488 mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE); 489 mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE);
489 } 490 }
490 else if(search_type == "creator") 491 else if(search_type == "creator")
@@ -493,16 +494,31 @@ class SetSearchType : public inventory_listener_t
493 494
494 mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); 495 mPtr->getControl("Inventory.SearchByName")->setValue(FALSE);
495 mPtr->getControl("Inventory.SearchByCreator")->setValue(TRUE); 496 mPtr->getControl("Inventory.SearchByCreator")->setValue(TRUE);
497 mPtr->getControl("Inventory.SearchByDesc")->setValue(FALSE);
498 mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE);
499 }
500 else if(search_type == "desc")
501 {
502 gSavedSettings.setU32("InventorySearchType", 2);
503
504 mPtr->getControl("Inventory.SearchByName")->setValue(FALSE);
505 mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE);
506 mPtr->getControl("Inventory.SearchByDesc")->setValue(TRUE);
496 mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE); 507 mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE);
497 } 508 }
498 else if(search_type == "all") 509 else if(search_type == "all")
499 { 510 {
500 gSavedSettings.setU32("InventorySearchType", 4); 511 gSavedSettings.setU32("InventorySearchType", 3);
501 512
502 mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); 513 mPtr->getControl("Inventory.SearchByName")->setValue(FALSE);
503 mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); 514 mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE);
515 mPtr->getControl("Inventory.SearchByDesc")->setValue(FALSE);
504 mPtr->getControl("Inventory.SearchByAll")->setValue(TRUE); 516 mPtr->getControl("Inventory.SearchByAll")->setValue(TRUE);
505 } 517 }
518
519 //Clear search when switching modes.
520 mPtr->getActivePanel()->setFilterSubString(LLStringUtil::null);
521 mPtr->getActivePanel()->setFilterTypes(LLInventoryType::NIT_ALL);
506 return true; 522 return true;
507 } 523 }
508}; 524};
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp
index 008d79d..b4a8b72 100644
--- a/linden/indra/newview/llinventoryview.cpp
+++ b/linden/indra/newview/llinventoryview.cpp
@@ -527,6 +527,7 @@ void LLInventoryView::init(LLInventoryModel* inventory)
527 527
528 addBoolControl("Inventory.SearchByName", search_by_name); 528 addBoolControl("Inventory.SearchByName", search_by_name);
529 addBoolControl("Inventory.SearchByCreator", !search_by_name); 529 addBoolControl("Inventory.SearchByCreator", !search_by_name);
530 addBoolControl("Inventory.SearchByDesc", !search_by_name);
530 531
531 addBoolControl("Inventory.SearchByAll", !search_by_name); 532 addBoolControl("Inventory.SearchByAll", !search_by_name);
532 533
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_inventory.xml b/linden/indra/newview/skins/default/xui/en-us/floater_inventory.xml
index f0c97f2..103a11e 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_inventory.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_inventory.xml
@@ -206,7 +206,7 @@
206 </menu_item_check> 206 </menu_item_check>
207 </menu> 207 </menu>
208 <menu bottom_delta="64" drop_shadow="true" height="49" 208 <menu bottom_delta="64" drop_shadow="true" height="49"
209 label="Search" left="0" mouse_opaque="false" name="Sort" opaque="true" 209 label="Search" left="0" mouse_opaque="false" name="Search" opaque="true"
210 tear_off="true" width="118"> 210 tear_off="true" width="118">
211 <menu_item_check bottom_delta="-18" control_name="Inventory.SearchByName" height="18" 211 <menu_item_check bottom_delta="-18" control_name="Inventory.SearchByName" height="18"
212 label="By Name" left="0" mouse_opaque="true" name="By Name" width="118"> 212 label="By Name" left="0" mouse_opaque="true" name="By Name" width="118">
@@ -216,6 +216,10 @@
216 label="By Creator" left="0" mouse_opaque="true" name="By Creator" width="118"> 216 label="By Creator" left="0" mouse_opaque="true" name="By Creator" width="118">
217 <on_click filter="" function="Inventory.SetSearchBy" userdata="creator" /> 217 <on_click filter="" function="Inventory.SetSearchBy" userdata="creator" />
218 </menu_item_check> 218 </menu_item_check>
219 <menu_item_check bottom_delta="-18" control_name="Inventory.SearchByDesc" height="18"
220 label="By Description" left="0" mouse_opaque="true" name="By Description" width="118">
221 <on_click filter="" function="Inventory.SetSearchBy" userdata="desc" />
222 </menu_item_check>
219 <menu_item_separator bottom_delta="-8" height="8" left="0" mouse_opaque="true" name="separator" 223 <menu_item_separator bottom_delta="-8" height="8" left="0" mouse_opaque="true" name="separator"
220 width="118" /> 224 width="118" />
221 <menu_item_check bottom_delta="-18" control_name="Inventory.SearchByAll" height="18" 225 <menu_item_check bottom_delta="-18" control_name="Inventory.SearchByAll" height="18"