aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview')
-rw-r--r--linden/indra/newview/app_settings/settings.xml22
-rw-r--r--linden/indra/newview/llfolderview.cpp304
-rw-r--r--linden/indra/newview/llfolderview.h75
-rw-r--r--linden/indra/newview/llinventoryactions.cpp18
-rw-r--r--linden/indra/newview/llinventoryview.cpp40
-rw-r--r--linden/indra/newview/llinventoryview.h5
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_inventory.xml2
7 files changed, 300 insertions, 166 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index acdb0a6..76f549d 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -288,17 +288,6 @@
288 <key>Value</key> 288 <key>Value</key>
289 <string>http://support.secondlife.com</string> 289 <string>http://support.secondlife.com</string>
290 </map> 290 </map>
291 <key>InventorySearchType</key>
292 <map>
293 <key>Comment</key>
294 <string>Controls what type of inventory search we perform.</string>
295 <key>Persist</key>
296 <integer>0</integer>
297 <key>Type</key>
298 <string>U32</string>
299 <key>Value</key>
300 <integer>0</integer>
301 </map>
302 <key>IgnoreSimulatorCameraConstraints</key> 291 <key>IgnoreSimulatorCameraConstraints</key>
303 <map> 292 <map>
304 <key>Comment</key> 293 <key>Comment</key>
@@ -932,6 +921,17 @@
932 <key>Value</key> 921 <key>Value</key>
933 <integer>1</integer> 922 <integer>1</integer>
934 </map> 923 </map>
924 <key>WornItemsSortOrder</key>
925 <map>
926 <key>Comment</key>
927 <string>Specifies sort key for worn inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)</string>
928 <key>Persist</key>
929 <integer>1</integer>
930 <key>Type</key>
931 <string>U32</string>
932 <key>Value</key>
933 <integer>7</integer>
934 </map>
935 <key>DefaultGrid</key> 935 <key>DefaultGrid</key>
936 <map> 936 <map>
937 <key>Comment</key> 937 <key>Comment</key>
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp
index e87ac0c..16c0aa9 100644
--- a/linden/indra/newview/llfolderview.cpp
+++ b/linden/indra/newview/llfolderview.cpp
@@ -162,7 +162,6 @@ LLFolderViewItem::LLFolderViewItem( const std::string& name, LLUIImagePtr icon,
162 mIcon(icon), 162 mIcon(icon),
163 mHasVisibleChildren(FALSE), 163 mHasVisibleChildren(FALSE),
164 mIndentation(0), 164 mIndentation(0),
165 mNumDescendantsSelected(0),
166 mFiltered(FALSE), 165 mFiltered(FALSE),
167 mLastFilterGeneration(-1), 166 mLastFilterGeneration(-1),
168 mStringMatchOffset(std::string::npos), 167 mStringMatchOffset(std::string::npos),
@@ -350,7 +349,8 @@ void LLFolderViewItem::refresh()
350 349
351 if (mSearchableLabel.compare(searchable_label) || 350 if (mSearchableLabel.compare(searchable_label) ||
352 mSearchableLabelCreator.compare(searchable_label_creator) || 351 mSearchableLabelCreator.compare(searchable_label_creator) ||
353 mSearchableLabelDesc.compare(searchable_label_creator)) 352 mSearchableLabelDesc.compare(searchable_label_desc) ||
353 mSearchableLabelAll.compare(searchable_label_all))
354 { 354 {
355 mSearchableLabel.assign(searchable_label); 355 mSearchableLabel.assign(searchable_label);
356 mSearchableLabelCreator.assign(searchable_label_creator); 356 mSearchableLabelCreator.assign(searchable_label_creator);
@@ -358,28 +358,10 @@ void LLFolderViewItem::refresh()
358 mSearchableLabelAll.assign(searchable_label_all); 358 mSearchableLabelAll.assign(searchable_label_all);
359 359
360 dirtyFilter(); 360 dirtyFilter();
361 //some part of label has changed, so overall width has potentially changed 361 // some part of label has changed, so overall width has potentially changed
362 if (mParentFolder) 362 if (mParentFolder)
363 mParentFolder->requestArrange(); 363 mParentFolder->requestArrange();
364 } 364 }
365
366 /*if(mSearchableLabelCreator.compare(searchable_label_creator))
367 {
368 mSearchableLabelCreator.assign(searchable_label_creator);
369
370 dirtyFilter();
371 if(mParentFolder)
372 mParentFolder->requestArrange();
373 }
374
375 if(mSearchableLabelDesc.compare(searchable_label_desc))
376 {
377 mSearchableLabelDesc.assign(searchable_label_desc);
378
379 dirtyFilter();
380 if(mParentFolder)
381 mParentFolder->requestArrange();
382 }*/
383 365
384 S32 label_width = sFont->getWidth(mLabel); 366 S32 label_width = sFont->getWidth(mLabel);
385 if( mLabelSuffix.size() ) 367 if( mLabelSuffix.size() )
@@ -517,26 +499,33 @@ void LLFolderViewItem::dirtyFilter()
517// together. 499// together.
518BOOL LLFolderViewItem::setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus) 500BOOL LLFolderViewItem::setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus)
519{ 501{
520 if( selection == this ) 502 if (selection == this && !mIsSelected)
521 { 503 {
522 mIsSelected = TRUE; 504 selectItem();
523 if(mListener) 505 if(mListener)
524 { 506 {
525 mListener->selectItem(); 507 mListener->selectItem();
526 } 508 }
527 } 509 }
528 else 510 else if (mIsSelected) // Deselect everything else.
529 { 511 {
530 mIsSelected = FALSE; 512 deselectItem();
531 } 513 }
532 return mIsSelected; 514 return mIsSelected;
533} 515}
534 516
535BOOL LLFolderViewItem::changeSelection(LLFolderViewItem* selection, BOOL selected) 517BOOL LLFolderViewItem::changeSelection(LLFolderViewItem* selection, BOOL selected)
536{ 518{
537 if(selection == this && mIsSelected != selected) 519 if (selection == this && mIsSelected != selected)
538 { 520 {
539 mIsSelected = selected; 521 if (mIsSelected)
522 {
523 deselectItem();
524 }
525 else
526 {
527 selectItem();
528 }
540 if(mListener) 529 if(mListener)
541 { 530 {
542 mListener->selectItem(); 531 mListener->selectItem();
@@ -546,22 +535,33 @@ BOOL LLFolderViewItem::changeSelection(LLFolderViewItem* selection, BOOL selecte
546 return FALSE; 535 return FALSE;
547} 536}
548 537
549void LLFolderViewItem::recursiveDeselect(BOOL deselect_self) 538void LLFolderViewItem::deselectItem(void)
550{ 539{
551 if (mIsSelected && deselect_self) 540 llassert(mIsSelected);
552 {
553 mIsSelected = FALSE;
554 541
555 // update ancestors' count of selected descendents 542 mIsSelected = FALSE;
556 LLFolderViewFolder* parent_folder = getParentFolder(); 543
557 while(parent_folder) 544 // Update ancestors' count of selected descendents.
558 { 545 LLFolderViewFolder* parent_folder = getParentFolder();
559 parent_folder->mNumDescendantsSelected--; 546 if (parent_folder)
560 parent_folder = parent_folder->getParentFolder(); 547 {
561 } 548 parent_folder->recursiveIncrementNumDescendantsSelected(-1);
562 } 549 }
563} 550}
564 551
552void LLFolderViewItem::selectItem(void)
553{
554 llassert(!mIsSelected);
555
556 mIsSelected = TRUE;
557
558 // Update ancestors' count of selected descendents.
559 LLFolderViewFolder* parent_folder = getParentFolder();
560 if (parent_folder)
561 {
562 parent_folder->recursiveIncrementNumDescendantsSelected(1);
563 }
564}
565 565
566BOOL LLFolderViewItem::isMovable() 566BOOL LLFolderViewItem::isMovable()
567{ 567{
@@ -654,16 +654,20 @@ void LLFolderViewItem::rename(const std::string& new_name)
654 } 654 }
655} 655}
656 656
657const std::string& LLFolderViewItem::getSearchableLabel(U32 search_type = 0) const 657const std::string& LLFolderViewItem::getSearchableLabel() const
658{ 658{
659 if(search_type == 3) 659 U32 type = mRoot->getFilter()->getSearchType();
660 return mSearchableLabelAll; 660 switch(type)
661 else if(search_type == 2) 661 {
662 return mSearchableLabelDesc; 662 case 1:
663 else if(search_type == 1)
664 return mSearchableLabelCreator; 663 return mSearchableLabelCreator;
665 else 664 case 2:
665 return mSearchableLabelDesc;
666 case 3:
667 return mSearchableLabelAll;
668 default:
666 return mSearchableLabel; 669 return mSearchableLabel;
670 }
667} 671}
668 672
669const std::string& LLFolderViewItem::getName( void ) const 673const std::string& LLFolderViewItem::getName( void ) const
@@ -1022,9 +1026,16 @@ void LLFolderViewItem::draw()
1022 { 1026 {
1023 // don't draw backgrounds for zero-length strings 1027 // don't draw backgrounds for zero-length strings
1024 S32 filter_string_length = mRoot->getFilterSubString().size(); 1028 S32 filter_string_length = mRoot->getFilterSubString().size();
1025 if (filter_string_length > 0) 1029
1030 std::string combined_string = mLabel + mLabelSuffix;
1031
1032 //fix so that highlighting works properly again - rkeast
1033 std::string check = combined_string;
1034 LLStringUtil::toUpper(check);
1035
1036 if ((filter_string_length > 0) && (check.find(mRoot->getFilterSubString()) != -1))
1026 { 1037 {
1027 std::string combined_string = mLabel + mLabelSuffix; 1038// llinfos << "mLabel " << mLabel<< " mLabelSuffix " << mLabelSuffix << " mLabel " << mLabel << " mLabel " << mLabel << llendl;
1028 S32 left = llround(text_left) + sFont->getWidth(combined_string, 0, mStringMatchOffset) - 1; 1039 S32 left = llround(text_left) + sFont->getWidth(combined_string, 0, mStringMatchOffset) - 1;
1029 S32 right = left + sFont->getWidth(combined_string, mStringMatchOffset, filter_string_length) + 2; 1040 S32 right = left + sFont->getWidth(combined_string, mStringMatchOffset, filter_string_length) + 2;
1030 S32 bottom = llfloor(getRect().getHeight() - sFont->getLineHeight() - 3); 1041 S32 bottom = llfloor(getRect().getHeight() - sFont->getLineHeight() - 3);
@@ -1057,6 +1068,7 @@ LLFolderViewFolder::LLFolderViewFolder( const std::string& name, LLUIImagePtr ic
1057 LLFolderView* root, 1068 LLFolderView* root,
1058 LLFolderViewEventListener* listener ): 1069 LLFolderViewEventListener* listener ):
1059 LLFolderViewItem( name, icon, 0, root, listener ), // 0 = no create time 1070 LLFolderViewItem( name, icon, 0, root, listener ), // 0 = no create time
1071 mNumDescendantsSelected(0),
1060 mIsOpen(FALSE), 1072 mIsOpen(FALSE),
1061 mExpanderHighlighted(FALSE), 1073 mExpanderHighlighted(FALSE),
1062 mCurHeight(0.f), 1074 mCurHeight(0.f),
@@ -1423,6 +1435,21 @@ BOOL LLFolderViewFolder::hasFilteredDescendants()
1423 return mMostFilteredDescendantGeneration >= mRoot->getFilter()->getCurrentGeneration(); 1435 return mMostFilteredDescendantGeneration >= mRoot->getFilter()->getCurrentGeneration();
1424} 1436}
1425 1437
1438void LLFolderViewFolder::recursiveIncrementNumDescendantsSelected(S32 increment)
1439{
1440 LLFolderViewFolder* parent_folder = this;
1441 do
1442 {
1443 parent_folder->mNumDescendantsSelected += increment;
1444
1445 // Make sure we don't have negative values.
1446 llassert(parent_folder->mNumDescendantsSelected >= 0);
1447
1448 parent_folder = parent_folder->getParentFolder();
1449 }
1450 while(parent_folder);
1451}
1452
1426// Passes selection information on to children and record selection 1453// Passes selection information on to children and record selection
1427// information if necessary. 1454// information if necessary.
1428BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem, 1455BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem,
@@ -1431,7 +1458,10 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem
1431 BOOL rv = FALSE; 1458 BOOL rv = FALSE;
1432 if( selection == this ) 1459 if( selection == this )
1433 { 1460 {
1434 mIsSelected = TRUE; 1461 if (!isSelected())
1462 {
1463 selectItem();
1464 }
1435 if(mListener) 1465 if(mListener)
1436 { 1466 {
1437 mListener->selectItem(); 1467 mListener->selectItem();
@@ -1440,7 +1470,10 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem
1440 } 1470 }
1441 else 1471 else
1442 { 1472 {
1443 mIsSelected = FALSE; 1473 if (isSelected())
1474 {
1475 deselectItem();
1476 }
1444 rv = FALSE; 1477 rv = FALSE;
1445 } 1478 }
1446 BOOL child_selected = FALSE; 1479 BOOL child_selected = FALSE;
@@ -1453,7 +1486,6 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem
1453 { 1486 {
1454 rv = TRUE; 1487 rv = TRUE;
1455 child_selected = TRUE; 1488 child_selected = TRUE;
1456 mNumDescendantsSelected++;
1457 } 1489 }
1458 } 1490 }
1459 for (items_t::iterator iter = mItems.begin(); 1491 for (items_t::iterator iter = mItems.begin();
@@ -1464,7 +1496,6 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem
1464 { 1496 {
1465 rv = TRUE; 1497 rv = TRUE;
1466 child_selected = TRUE; 1498 child_selected = TRUE;
1467 mNumDescendantsSelected++;
1468 } 1499 }
1469 } 1500 }
1470 if(openitem && child_selected) 1501 if(openitem && child_selected)
@@ -1474,37 +1505,39 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem
1474 return rv; 1505 return rv;
1475} 1506}
1476 1507
1477// This method is used to change the selection of an item. If 1508// This method is used to change the selection of an item.
1478// selection is 'this', then note selection as true. Returns TRUE 1509// Recursively traverse all children; if 'selection' is 'this' then change
1479// if this or a child is now selected. 1510// the select status if necessary.
1480BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, 1511// Returns TRUE if the selection state of this folder, or of a child, was changed.
1481 BOOL selected) 1512BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, BOOL selected)
1482{ 1513{
1483 BOOL rv = FALSE; 1514 BOOL rv = FALSE;
1484 if(selection == this) 1515 if(selection == this)
1485 { 1516 {
1486 mIsSelected = selected; 1517 if (isSelected() != selected)
1518 {
1519 rv = TRUE;
1520 if (selected)
1521 {
1522 selectItem();
1523 }
1524 else
1525 {
1526 deselectItem();
1527 }
1528 }
1487 if(mListener && selected) 1529 if(mListener && selected)
1488 { 1530 {
1489 mListener->selectItem(); 1531 mListener->selectItem();
1490 } 1532 }
1491 rv = TRUE;
1492 } 1533 }
1493 1534
1494 for (folders_t::iterator iter = mFolders.begin(); 1535 for (folders_t::iterator iter = mFolders.begin();
1495 iter != mFolders.end();) 1536 iter != mFolders.end();)
1496 { 1537 {
1497 folders_t::iterator fit = iter++; 1538 folders_t::iterator fit = iter++;
1498 if((*fit)->changeSelection(selection, selected)) 1539 if ((*fit)->changeSelection(selection, selected))
1499 { 1540 {
1500 if (selected)
1501 {
1502 mNumDescendantsSelected++;
1503 }
1504 else
1505 {
1506 mNumDescendantsSelected--;
1507 }
1508 rv = TRUE; 1541 rv = TRUE;
1509 } 1542 }
1510 } 1543 }
@@ -1512,33 +1545,22 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection,
1512 iter != mItems.end();) 1545 iter != mItems.end();)
1513 { 1546 {
1514 items_t::iterator iit = iter++; 1547 items_t::iterator iit = iter++;
1515 if((*iit)->changeSelection(selection, selected)) 1548 if ((*iit)->changeSelection(selection, selected))
1516 { 1549 {
1517 if (selected)
1518 {
1519 mNumDescendantsSelected++;
1520 }
1521 else
1522 {
1523 mNumDescendantsSelected--;
1524 }
1525 rv = TRUE; 1550 rv = TRUE;
1526 } 1551 }
1527 } 1552 }
1528 return rv; 1553 return rv;
1529} 1554}
1530 1555
1531S32 LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& selected_items) 1556void LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& selected_items)
1532{ 1557{
1533 S32 num_selected = 0;
1534
1535 // pass on to child folders first 1558 // pass on to child folders first
1536 for (folders_t::iterator iter = mFolders.begin(); 1559 for (folders_t::iterator iter = mFolders.begin();
1537 iter != mFolders.end();) 1560 iter != mFolders.end();)
1538 { 1561 {
1539 folders_t::iterator fit = iter++; 1562 folders_t::iterator fit = iter++;
1540 num_selected += (*fit)->extendSelection(selection, last_selected, selected_items); 1563 (*fit)->extendSelection(selection, last_selected, selected_items);
1541 mNumDescendantsSelected += num_selected;
1542 } 1564 }
1543 1565
1544 // handle selection of our immediate children... 1566 // handle selection of our immediate children...
@@ -1631,8 +1653,6 @@ S32 LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderVie
1631 if (item->changeSelection(item, TRUE)) 1653 if (item->changeSelection(item, TRUE))
1632 { 1654 {
1633 selected_items.put(item); 1655 selected_items.put(item);
1634 mNumDescendantsSelected++;
1635 num_selected++;
1636 } 1656 }
1637 } 1657 }
1638 } 1658 }
@@ -1642,30 +1662,15 @@ S32 LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderVie
1642 if (selection->changeSelection(selection, TRUE)) 1662 if (selection->changeSelection(selection, TRUE))
1643 { 1663 {
1644 selected_items.put(selection); 1664 selected_items.put(selection);
1645 mNumDescendantsSelected++;
1646 num_selected++;
1647 } 1665 }
1648 } 1666 }
1649
1650 return num_selected;
1651} 1667}
1652 1668
1653void LLFolderViewFolder::recursiveDeselect(BOOL deselect_self) 1669void LLFolderViewFolder::recursiveDeselect(BOOL deselect_self)
1654{ 1670{
1655 // make sure we don't have negative values 1671 if (isSelected() && deselect_self)
1656 llassert(mNumDescendantsSelected >= 0);
1657
1658 if (mIsSelected && deselect_self)
1659 { 1672 {
1660 mIsSelected = FALSE; 1673 deselectItem();
1661
1662 // update ancestors' count of selected descendents
1663 LLFolderViewFolder* parent_folder = getParentFolder();
1664 while(parent_folder)
1665 {
1666 parent_folder->mNumDescendantsSelected--;
1667 parent_folder = parent_folder->getParentFolder();
1668 }
1669 } 1674 }
1670 1675
1671 if (0 == mNumDescendantsSelected) 1676 if (0 == mNumDescendantsSelected)
@@ -1673,14 +1678,19 @@ void LLFolderViewFolder::recursiveDeselect(BOOL deselect_self)
1673 return; 1678 return;
1674 } 1679 }
1675 1680
1681 // Deselect all items in this folder.
1676 for (items_t::iterator iter = mItems.begin(); 1682 for (items_t::iterator iter = mItems.begin();
1677 iter != mItems.end();) 1683 iter != mItems.end();)
1678 { 1684 {
1679 items_t::iterator iit = iter++; 1685 items_t::iterator iit = iter++;
1680 LLFolderViewItem* item = (*iit); 1686 LLFolderViewItem* item = (*iit);
1681 item->recursiveDeselect(TRUE); 1687 if (item->isSelected())
1688 {
1689 item->deselectItem();
1690 }
1682 } 1691 }
1683 1692
1693 // Recursively deselect all folders in this folder.
1684 for (folders_t::iterator iter = mFolders.begin(); 1694 for (folders_t::iterator iter = mFolders.begin();
1685 iter != mFolders.end();) 1695 iter != mFolders.end();)
1686 { 1696 {
@@ -1740,7 +1750,10 @@ void LLFolderViewFolder::removeView(LLFolderViewItem* item)
1740 return; 1750 return;
1741 } 1751 }
1742 // deselect without traversing hierarchy 1752 // deselect without traversing hierarchy
1743 item->recursiveDeselect(TRUE); 1753 if (item->isSelected())
1754 {
1755 item->deselectItem();
1756 }
1744 getRoot()->removeFromSelectionList(item); 1757 getRoot()->removeFromSelectionList(item);
1745 extractItem(item); 1758 extractItem(item);
1746 delete item; 1759 delete item;
@@ -1756,16 +1769,24 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item )
1756 // This is an evil downcast. However, it's only doing 1769 // This is an evil downcast. However, it's only doing
1757 // pointer comparison to find if (which it should be ) the 1770 // pointer comparison to find if (which it should be ) the
1758 // item is in the container, so it's pretty safe. 1771 // item is in the container, so it's pretty safe.
1759 LLFolderViewFolder* f = reinterpret_cast<LLFolderViewFolder*>(item); 1772 LLFolderViewFolder* f = static_cast<LLFolderViewFolder*>(item);
1760 folders_t::iterator ft; 1773 folders_t::iterator ft;
1761 ft = std::find(mFolders.begin(), mFolders.end(), f); 1774 ft = std::find(mFolders.begin(), mFolders.end(), f);
1762 if(ft != mFolders.end()) 1775 if(ft != mFolders.end())
1763 { 1776 {
1777 if ((*ft)->numSelected())
1778 {
1779 recursiveIncrementNumDescendantsSelected(-(*ft)->numSelected());
1780 }
1764 mFolders.erase(ft); 1781 mFolders.erase(ft);
1765 } 1782 }
1766 } 1783 }
1767 else 1784 else
1768 { 1785 {
1786 if ((*it)->isSelected())
1787 {
1788 recursiveIncrementNumDescendantsSelected(-1);
1789 }
1769 mItems.erase(it); 1790 mItems.erase(it);
1770 } 1791 }
1771 //item has been removed, need to update filter 1792 //item has been removed, need to update filter
@@ -1944,6 +1965,10 @@ BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item)
1944 item, 1965 item,
1945 mSortFunction); 1966 mSortFunction);
1946 mItems.insert(it,item); 1967 mItems.insert(it,item);
1968 if (item->isSelected())
1969 {
1970 recursiveIncrementNumDescendantsSelected(1);
1971 }
1947 item->setRect(LLRect(0, 0, getRect().getWidth(), 0)); 1972 item->setRect(LLRect(0, 0, getRect().getWidth(), 0));
1948 item->setVisible(FALSE); 1973 item->setVisible(FALSE);
1949 addChild( item ); 1974 addChild( item );
@@ -1961,6 +1986,10 @@ BOOL LLFolderViewFolder::addFolder(LLFolderViewFolder* folder)
1961 folder, 1986 folder,
1962 mSortFunction); 1987 mSortFunction);
1963 mFolders.insert(it,folder); 1988 mFolders.insert(it,folder);
1989 if (folder->numSelected())
1990 {
1991 recursiveIncrementNumDescendantsSelected(folder->numSelected());
1992 }
1964 folder->setOrigin(0, 0); 1993 folder->setOrigin(0, 0);
1965 folder->reshape(getRect().getWidth(), 0); 1994 folder->reshape(getRect().getWidth(), 0);
1966 folder->setVisible(FALSE); 1995 folder->setVisible(FALSE);
@@ -2731,6 +2760,10 @@ BOOL LLFolderView::addFolder( LLFolderViewFolder* folder)
2731 { 2760 {
2732 mFolders.insert(mFolders.begin(), folder); 2761 mFolders.insert(mFolders.begin(), folder);
2733 } 2762 }
2763 if (folder->numSelected())
2764 {
2765 recursiveIncrementNumDescendantsSelected(folder->numSelected());
2766 }
2734 folder->setOrigin(0, 0); 2767 folder->setOrigin(0, 0);
2735 folder->reshape(getRect().getWidth(), 0); 2768 folder->reshape(getRect().getWidth(), 0);
2736 folder->setVisible(FALSE); 2769 folder->setVisible(FALSE);
@@ -3012,29 +3045,24 @@ BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected)
3012 return rv; 3045 return rv;
3013} 3046}
3014 3047
3015S32 LLFolderView::extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items) 3048void LLFolderView::extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items)
3016{ 3049{
3017 S32 rv = 0;
3018
3019 // now store resulting selection 3050 // now store resulting selection
3020 if (mAllowMultiSelect) 3051 if (mAllowMultiSelect)
3021 { 3052 {
3022 LLFolderViewItem *cur_selection = getCurSelectedItem(); 3053 LLFolderViewItem *cur_selection = getCurSelectedItem();
3023 rv = LLFolderViewFolder::extendSelection(selection, cur_selection, items); 3054 LLFolderViewFolder::extendSelection(selection, cur_selection, items);
3024 for (S32 i = 0; i < items.count(); i++) 3055 for (S32 i = 0; i < items.count(); i++)
3025 { 3056 {
3026 addToSelectionList(items[i]); 3057 addToSelectionList(items[i]);
3027 rv++;
3028 } 3058 }
3029 } 3059 }
3030 else 3060 else
3031 { 3061 {
3032 setSelection(selection, FALSE, FALSE); 3062 setSelection(selection, FALSE, FALSE);
3033 rv++;
3034 } 3063 }
3035 3064
3036 mSignalSelectCallback = SIGNAL_KEYBOARD_FOCUS; 3065 mSignalSelectCallback = SIGNAL_KEYBOARD_FOCUS;
3037 return rv;
3038} 3066}
3039 3067
3040void LLFolderView::sanitizeSelection() 3068void LLFolderView::sanitizeSelection()
@@ -4554,6 +4582,8 @@ LLInventoryFilter::LLInventoryFilter(const std::string& name) :
4554 mModified(FALSE), 4582 mModified(FALSE),
4555 mNeedTextRebuild(TRUE) 4583 mNeedTextRebuild(TRUE)
4556{ 4584{
4585 //fix to get rid of gSavedSettings use - rkeast
4586 mSearchType = 0;
4557 mFilterOps.mFilterTypes = LLInventoryType::NIT_ALL; 4587 mFilterOps.mFilterTypes = LLInventoryType::NIT_ALL;
4558 mFilterOps.mMinDate = time_min(); 4588 mFilterOps.mMinDate = time_min();
4559 mFilterOps.mMaxDate = time_max(); 4589 mFilterOps.mMaxDate = time_max();
@@ -4599,14 +4629,49 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item)
4599 LLFolderViewEventListener* listener = item->getListener(); 4629 LLFolderViewEventListener* listener = item->getListener();
4600 const LLUUID& item_id = listener->getUUID(); 4630 const LLUUID& item_id = listener->getUUID();
4601 4631
4602 U32 search_type = gSavedSettings.getU32("InventorySearchType"); 4632 //When searching for all labels, we need to explode the filter string
4603 mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel(search_type).find(mFilterSubString) : std::string::npos; 4633 //Into an array, and then compare each string to the label seperately
4604 BOOL passed = (listener->getNInventoryType() & mFilterOps.mFilterTypes || listener->getNInventoryType() == LLInventoryType::NIT_NONE) 4634 //Otherwise the filter substring needs to be
4635 //formatted in the same order as the label - rkeast
4636
4637 BOOL passed;
4638 //Added ability to toggle this type of searching for all labels cause it's convienient - RKeast
4639 if(mSearchType == 3)
4640 {
4641 std::istringstream i(mFilterSubString);
4642 std::string blah;
4643
4644 LLDynamicArray<std::string> search_array;
4645
4646 while(i >> blah)
4647 {
4648 search_array.put(blah);
4649 }
4650
4651 BOOL subStringMatch = true;
4652 for(int i = 0; i < search_array.getLength(); i++)
4653 {
4654 mSubStringMatchOffset = (search_array.get(i)).size() ? item->getSearchableLabel().find(search_array.get(i)) : std::string::npos;
4655 subStringMatch = subStringMatch && ((search_array.get(i)).size() == 0 || mSubStringMatchOffset != std::string::npos);
4656 }
4657
4658 passed = (listener->getNInventoryType() & mFilterOps.mFilterTypes || listener->getNInventoryType() == LLInventoryType::NIT_NONE)
4659 && (subStringMatch)
4660 && (mFilterWorn == false || gAgent.isWearingItem(item_id) ||
4661 (gAgent.getAvatarObject() && gAgent.getAvatarObject()->isWearingAttachment(item_id)))
4662 && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions)
4663 && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate);
4664 }
4665 else
4666 {
4667 mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos;
4668 passed = (listener->getNInventoryType() & mFilterOps.mFilterTypes || listener->getNInventoryType() == LLInventoryType::NIT_NONE)
4605 && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) 4669 && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos)
4606 && (mFilterWorn == false || gAgent.isWearingItem(item_id) || 4670 && (mFilterWorn == false || gAgent.isWearingItem(item_id) ||
4607 (gAgent.getAvatarObject() && gAgent.getAvatarObject()->isWearingAttachment(item_id))) 4671 (gAgent.getAvatarObject() && gAgent.getAvatarObject()->isWearingAttachment(item_id)))
4608 && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) 4672 && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions)
4609 && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); 4673 && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate);
4674 }
4610 return passed; 4675 return passed;
4611} 4676}
4612 4677
@@ -4655,6 +4720,19 @@ BOOL LLInventoryFilter::isModifiedAndClear()
4655 return ret; 4720 return ret;
4656} 4721}
4657 4722
4723
4724//fix to get rid of gSavedSettings use - rkeast
4725void LLInventoryFilter::setSearchType(U32 type)
4726{
4727 mSearchType = type;
4728}
4729
4730//fix to get rid of gSavedSettings use - rkeast
4731U32 LLInventoryFilter::getSearchType()
4732{
4733 return mSearchType;
4734}
4735
4658void LLInventoryFilter::setFilterTypes(U32 types) 4736void LLInventoryFilter::setFilterTypes(U32 types)
4659{ 4737{
4660 if (mFilterOps.mFilterTypes != types) 4738 if (mFilterOps.mFilterTypes != types)
diff --git a/linden/indra/newview/llfolderview.h b/linden/indra/newview/llfolderview.h
index 5e6902d..9fad72e 100644
--- a/linden/indra/newview/llfolderview.h
+++ b/linden/indra/newview/llfolderview.h
@@ -168,6 +168,10 @@ public:
168class LLInventoryFilter 168class LLInventoryFilter
169{ 169{
170public: 170public:
171 //fix to get rid of gSavedSettings use - rkeast
172 void setSearchType(U32 type);
173 U32 getSearchType();
174
171 typedef enum e_folder_show 175 typedef enum e_folder_show
172 { 176 {
173 SHOW_ALL_FOLDERS, 177 SHOW_ALL_FOLDERS,
@@ -248,6 +252,9 @@ public:
248 void fromLLSD(LLSD& data); 252 void fromLLSD(LLSD& data);
249 253
250protected: 254protected:
255 //fix to get rid of gSavedSettings use - rkeast
256 U32 mSearchType;
257
251 struct filter_ops 258 struct filter_ops
252 { 259 {
253 U32 mFilterTypes; 260 U32 mFilterTypes;
@@ -322,9 +329,12 @@ class LLFolderView;
322 329
323class LLFolderViewItem : public LLUICtrl 330class LLFolderViewItem : public LLUICtrl
324{ 331{
325protected:
326 friend class LLFolderViewEventListener; 332 friend class LLFolderViewEventListener;
327 333
334private:
335 BOOL mIsSelected;
336
337protected:
328 static const LLFontGL* sFont; 338 static const LLFontGL* sFont;
329 static const LLFontGL* sSmallFont; 339 static const LLFontGL* sSmallFont;
330 static LLColor4 sFgColor; 340 static LLColor4 sFgColor;
@@ -354,7 +364,6 @@ protected:
354 U32 mCreationDate; 364 U32 mCreationDate;
355 LLFolderViewFolder* mParentFolder; 365 LLFolderViewFolder* mParentFolder;
356 LLFolderViewEventListener* mListener; 366 LLFolderViewEventListener* mListener;
357 BOOL mIsSelected;
358 BOOL mIsCurSelection; 367 BOOL mIsCurSelection;
359 BOOL mSelectPending; 368 BOOL mSelectPending;
360 LLFontGL::StyleFlags mLabelStyle; 369 LLFontGL::StyleFlags mLabelStyle;
@@ -363,7 +372,6 @@ protected:
363 std::string mStatusText; 372 std::string mStatusText;
364 BOOL mHasVisibleChildren; 373 BOOL mHasVisibleChildren;
365 S32 mIndentation; 374 S32 mIndentation;
366 S32 mNumDescendantsSelected;
367 BOOL mFiltered; 375 BOOL mFiltered;
368 S32 mLastFilterGeneration; 376 S32 mLastFilterGeneration;
369 std::string::size_type mStringMatchOffset; 377 std::string::size_type mStringMatchOffset;
@@ -424,22 +432,23 @@ public:
424 432
425 virtual void dirtyFilter(); 433 virtual void dirtyFilter();
426 434
427 // If the selection is 'this' then note that otherwise 435 // If 'selection' is 'this' then note that otherwise ignore.
428 // ignore. Returns TRUE if this object was affected. If open is 436 // Returns TRUE if this item ends up being selected.
429 // TRUE, then folders are opened up along the way to the 437 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus);
430 // selection.
431 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem,
432 BOOL take_keyboard_focus);
433 438
434 // This method is used to toggle the selection of an item. If 439 // This method is used to set the selection state of an item.
435 // selection is 'this', then note selection, and return TRUE. 440 // If 'selection' is 'this' then note selection.
441 // Returns TRUE if the selection state of this item was changed.
436 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected); 442 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
437 443
438 // this method is used to group select items 444 // this method is used to group select items
439 virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items){ return FALSE; } 445 virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items) { }
440 446
441 // this method is used to group select items 447 // this method is used to deselect this element
442 virtual void recursiveDeselect(BOOL deselect_self); 448 void deselectItem();
449
450 // this method is used to select this element
451 void selectItem();
443 452
444 // gets multiple-element selection 453 // gets multiple-element selection
445 virtual BOOL getSelectionList(std::set<LLUUID> &selection){return TRUE;} 454 virtual BOOL getSelectionList(std::set<LLUUID> &selection){return TRUE;}
@@ -453,9 +462,7 @@ public:
453 // destroys this item recursively 462 // destroys this item recursively
454 virtual void destroyView(); 463 virtual void destroyView();
455 464
456 S32 getNumSelectedDescendants() { return mNumDescendantsSelected; } 465 BOOL isSelected() const { return mIsSelected; }
457
458 BOOL isSelected() { return mIsSelected; }
459 466
460 void setIsCurSelection(BOOL select) { mIsCurSelection = select; } 467 void setIsCurSelection(BOOL select) { mIsCurSelection = select; }
461 468
@@ -475,7 +482,7 @@ public:
475 // viewed. This method will ask the viewed object itself. 482 // viewed. This method will ask the viewed object itself.
476 const std::string& getName( void ) const; 483 const std::string& getName( void ) const;
477 484
478 const std::string& getSearchableLabel( U32 search_type ) const; 485 const std::string& getSearchableLabel() const;
479 486
480 // This method returns the label displayed on the view. This 487 // This method returns the label displayed on the view. This
481 // method was primarily added to allow sorting on the folder 488 // method was primarily added to allow sorting on the folder
@@ -563,6 +570,13 @@ public:
563 UNKNOWN, TRASH, NOT_TRASH 570 UNKNOWN, TRASH, NOT_TRASH
564 } ETrash; 571 } ETrash;
565 572
573private:
574 S32 mNumDescendantsSelected;
575
576public: // Accessed needed by LLFolderViewItem
577 void recursiveIncrementNumDescendantsSelected(S32 increment);
578 S32 numSelected(void) const { return mNumDescendantsSelected + (isSelected() ? 1 : 0); }
579
566protected: 580protected:
567 typedef std::list<LLFolderViewItem*> items_t; 581 typedef std::list<LLFolderViewItem*> items_t;
568 typedef std::list<LLFolderViewFolder*> folders_t; 582 typedef std::list<LLFolderViewFolder*> folders_t;
@@ -624,20 +638,22 @@ public:
624 virtual void dirtyFilter(); 638 virtual void dirtyFilter();
625 639
626 // Passes selection information on to children and record 640 // Passes selection information on to children and record
627 // selection information if necessary. Returns TRUE if this object 641 // selection information if necessary.
628 // (or a child) was affected. 642 // Returns TRUE if this object (or a child) ends up being selected.
629 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, 643 // If 'openitem' is TRUE then folders are opened up along the way to the selection.
630 BOOL take_keyboard_focus); 644 virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus);
631 645
632 // This method is used to change the selection of an item. If 646 // This method is used to change the selection of an item.
633 // selection is 'this', then note selection as true. Returns TRUE 647 // Recursively traverse all children; if 'selection' is 'this' then change
634 // if this or a child is now selected. 648 // the select status if necessary.
649 // Returns TRUE if the selection state of this folder, or of a child, was changed.
635 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected); 650 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
636 651
637 // this method is used to group select items 652 // this method is used to group select items
638 virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items); 653 virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items);
639 654
640 virtual void recursiveDeselect(BOOL deselect_self); 655 // Deselect this folder and all folder/items it contains recursively.
656 void recursiveDeselect(BOOL deselect_self);
641 657
642 // Returns true is this object and all of its children can be removed. 658 // Returns true is this object and all of its children can be removed.
643 virtual BOOL isRemovable(); 659 virtual BOOL isRemovable();
@@ -724,6 +740,7 @@ public:
724 740
725 time_t getCreationDate() const; 741 time_t getCreationDate() const;
726 bool isTrash() const; 742 bool isTrash() const;
743 S32 getNumSelectedDescendants(void) const { return mNumDescendantsSelected; }
727}; 744};
728 745
729 746
@@ -797,7 +814,7 @@ public:
797 // children, and keeps track of selected objects. 814 // children, and keeps track of selected objects.
798 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected); 815 virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
799 816
800 virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items); 817 virtual void extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray<LLFolderViewItem*>& items);
801 818
802 virtual BOOL getSelectionList(std::set<LLUUID> &selection); 819 virtual BOOL getSelectionList(std::set<LLUUID> &selection);
803 820
diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp
index 319b5b2..f3277ad 100644
--- a/linden/indra/newview/llinventoryactions.cpp
+++ b/linden/indra/newview/llinventoryactions.cpp
@@ -486,7 +486,7 @@ class LLDoCreateFloater : public inventory_listener_t
486 } 486 }
487}; 487};
488 488
489//Handles the search type buttons 489//Handles the search type buttons - RKeast
490class SetSearchType : public inventory_listener_t 490class SetSearchType : public inventory_listener_t
491{ 491{
492 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 492 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -494,8 +494,10 @@ class SetSearchType : public inventory_listener_t
494 std::string search_type = userdata.asString(); 494 std::string search_type = userdata.asString();
495 if(search_type == "name") 495 if(search_type == "name")
496 { 496 {
497 gSavedSettings.setU32("InventorySearchType", 0); 497 mPtr->getActivePanel()->setSearchType(0);
498 498
499 gSavedPerAccountSettings.setU32("InventorySearchType",0);
500
499 mPtr->getControl("Inventory.SearchByName")->setValue(TRUE); 501 mPtr->getControl("Inventory.SearchByName")->setValue(TRUE);
500 mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); 502 mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE);
501 mPtr->getControl("Inventory.SearchByDesc")->setValue(FALSE); 503 mPtr->getControl("Inventory.SearchByDesc")->setValue(FALSE);
@@ -503,7 +505,9 @@ class SetSearchType : public inventory_listener_t
503 } 505 }
504 else if(search_type == "creator") 506 else if(search_type == "creator")
505 { 507 {
506 gSavedSettings.setU32("InventorySearchType", 1); 508 mPtr->getActivePanel()->setSearchType(1);
509
510 gSavedPerAccountSettings.setU32("InventorySearchType",1);
507 511
508 mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); 512 mPtr->getControl("Inventory.SearchByName")->setValue(FALSE);
509 mPtr->getControl("Inventory.SearchByCreator")->setValue(TRUE); 513 mPtr->getControl("Inventory.SearchByCreator")->setValue(TRUE);
@@ -512,7 +516,9 @@ class SetSearchType : public inventory_listener_t
512 } 516 }
513 else if(search_type == "desc") 517 else if(search_type == "desc")
514 { 518 {
515 gSavedSettings.setU32("InventorySearchType", 2); 519 mPtr->getActivePanel()->setSearchType(2);
520
521 gSavedPerAccountSettings.setU32("InventorySearchType",2);
516 522
517 mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); 523 mPtr->getControl("Inventory.SearchByName")->setValue(FALSE);
518 mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); 524 mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE);
@@ -521,7 +527,9 @@ class SetSearchType : public inventory_listener_t
521 } 527 }
522 else if(search_type == "all") 528 else if(search_type == "all")
523 { 529 {
524 gSavedSettings.setU32("InventorySearchType", 3); 530 mPtr->getActivePanel()->setSearchType(3);
531
532 gSavedPerAccountSettings.setU32("InventorySearchType",3);
525 533
526 mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); 534 mPtr->getControl("Inventory.SearchByName")->setValue(FALSE);
527 mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); 535 mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE);
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp
index a001d65..71d8194 100644
--- a/linden/indra/newview/llinventoryview.cpp
+++ b/linden/indra/newview/llinventoryview.cpp
@@ -486,7 +486,8 @@ LLInventoryView::LLInventoryView(const std::string& name,
486 LLInventoryModel* inventory) : 486 LLInventoryModel* inventory) :
487 LLFloater(name, rect, std::string("Inventory"), RESIZE_YES, 487 LLFloater(name, rect, std::string("Inventory"), RESIZE_YES,
488 INV_MIN_WIDTH, INV_MIN_HEIGHT, DRAG_ON_TOP, 488 INV_MIN_WIDTH, INV_MIN_HEIGHT, DRAG_ON_TOP,
489 MINIMIZE_NO, CLOSE_YES) 489 MINIMIZE_NO, CLOSE_YES),
490 mActivePanel(NULL)
490 //LLHandle<LLFloater> mFinderHandle takes care of its own initialization 491 //LLHandle<LLFloater> mFinderHandle takes care of its own initialization
491{ 492{
492 init(inventory); 493 init(inventory);
@@ -497,7 +498,8 @@ LLInventoryView::LLInventoryView(const std::string& name,
497 LLInventoryModel* inventory) : 498 LLInventoryModel* inventory) :
498 LLFloater(name, rect, std::string("Inventory"), RESIZE_YES, 499 LLFloater(name, rect, std::string("Inventory"), RESIZE_YES,
499 INV_MIN_WIDTH, INV_MIN_HEIGHT, DRAG_ON_TOP, 500 INV_MIN_WIDTH, INV_MIN_HEIGHT, DRAG_ON_TOP,
500 MINIMIZE_NO, CLOSE_YES) 501 MINIMIZE_NO, CLOSE_YES),
502 mActivePanel(NULL)
501 //LLHandle<LLFloater> mFinderHandle takes care of its own initialization 503 //LLHandle<LLFloater> mFinderHandle takes care of its own initialization
502{ 504{
503 init(inventory); 505 init(inventory);
@@ -522,8 +524,8 @@ void LLInventoryView::init(LLInventoryModel* inventory)
522 addBoolControl("Inventory.FoldersAlwaysByName", sort_folders_by_name ); 524 addBoolControl("Inventory.FoldersAlwaysByName", sort_folders_by_name );
523 addBoolControl("Inventory.SystemFoldersToTop", sort_system_folders_to_top ); 525 addBoolControl("Inventory.SystemFoldersToTop", sort_system_folders_to_top );
524 526
525 //Search Controls 527 //Search Controls - RKeast
526 U32 search_type = gSavedSettings.getU32("InventorySearchType"); 528 U32 search_type = gSavedPerAccountSettings.getU32("InventorySearchType");
527 BOOL search_by_name = (search_type == 0); 529 BOOL search_by_name = (search_type == 0);
528 530
529 addBoolControl("Inventory.SearchByName", search_by_name); 531 addBoolControl("Inventory.SearchByName", search_by_name);
@@ -544,6 +546,10 @@ void LLInventoryView::init(LLInventoryModel* inventory)
544 if (mActivePanel) 546 if (mActivePanel)
545 { 547 {
546 // "All Items" is the previous only view, so it gets the InventorySortOrder 548 // "All Items" is the previous only view, so it gets the InventorySortOrder
549
550 //Fix for gSavedSettings use - rkeast
551 mActivePanel->getFilter()->setSearchType(search_type);
552
547 mActivePanel->setSortOrder(gSavedSettings.getU32("InventorySortOrder")); 553 mActivePanel->setSortOrder(gSavedSettings.getU32("InventorySortOrder"));
548 mActivePanel->getFilter()->markDefault(); 554 mActivePanel->getFilter()->markDefault();
549 mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState); 555 mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
@@ -580,7 +586,7 @@ void LLInventoryView::init(LLInventoryModel* inventory)
580 file.close(); 586 file.close();
581 587
582 // Load the persistent "Recent Items" settings. 588 // Load the persistent "Recent Items" settings.
583 // Note that the "All Items" settings do not persist. 589 // Note that the "All Items" and "Worn Items" settings do not persist per-account.
584 if(recent_items_panel) 590 if(recent_items_panel)
585 { 591 {
586 if(savedFilterState.has(recent_items_panel->getFilter()->getName())) 592 if(savedFilterState.has(recent_items_panel->getFilter()->getName()))
@@ -590,8 +596,7 @@ void LLInventoryView::init(LLInventoryModel* inventory)
590 recent_items_panel->getFilter()->fromLLSD(recent_items); 596 recent_items_panel->getFilter()->fromLLSD(recent_items);
591 } 597 }
592 } 598 }
593 599 }
594 }
595 600
596 //Initialize item count - rkeast 601 //Initialize item count - rkeast
597 mItemCount = gSavedPerAccountSettings.getS32("InventoryPreviousCount"); 602 mItemCount = gSavedPerAccountSettings.getS32("InventoryPreviousCount");
@@ -1044,9 +1049,16 @@ void LLInventoryView::onClearSearch(void* user_data)
1044 LLInventoryView* self = (LLInventoryView*)user_data; 1049 LLInventoryView* self = (LLInventoryView*)user_data;
1045 if(!self) return; 1050 if(!self) return;
1046 1051
1052 LLFloater *finder = self->getFinder();
1047 if (self->mActivePanel) 1053 if (self->mActivePanel)
1048 { 1054 {
1049 self->mActivePanel->setFilterSubString(LLStringUtil::null); 1055 self->mActivePanel->setFilterSubString(LLStringUtil::null);
1056 self->mActivePanel->setFilterTypes(LLInventoryType::NIT_ALL);
1057 }
1058
1059 if (finder)
1060 {
1061 LLInventoryViewFinder::selectAllTypes(finder);
1050 } 1062 }
1051 1063
1052 // re-open folders that were initially open 1064 // re-open folders that were initially open
@@ -1737,6 +1749,7 @@ LLUIImagePtr get_item_icon(LLAssetType::EType asset_type,
1737 1749
1738const std::string LLInventoryPanel::DEFAULT_SORT_ORDER = std::string("InventorySortOrder"); 1750const std::string LLInventoryPanel::DEFAULT_SORT_ORDER = std::string("InventorySortOrder");
1739const std::string LLInventoryPanel::RECENTITEMS_SORT_ORDER = std::string("RecentItemsSortOrder"); 1751const std::string LLInventoryPanel::RECENTITEMS_SORT_ORDER = std::string("RecentItemsSortOrder");
1752const std::string LLInventoryPanel::WORNITEMS_SORT_ORDER = std::string("WornItemsSortOrder");
1740const std::string LLInventoryPanel::INHERIT_SORT_ORDER = std::string(""); 1753const std::string LLInventoryPanel::INHERIT_SORT_ORDER = std::string("");
1741 1754
1742LLInventoryPanel::LLInventoryPanel(const std::string& name, 1755LLInventoryPanel::LLInventoryPanel(const std::string& name,
@@ -1867,6 +1880,19 @@ void LLInventoryPanel::draw()
1867 LLPanel::draw(); 1880 LLPanel::draw();
1868} 1881}
1869 1882
1883
1884//fix to get rid of gSavedSettings use - rkeast
1885void LLInventoryPanel::setSearchType(U32 type)
1886{
1887 mFolders->getFilter()->setSearchType(type);
1888}
1889
1890//fix to get rid of gSavedSettings use - rkeast
1891U32 LLInventoryPanel::getSearchType()
1892{
1893 return mFolders->getFilter()->getSearchType();
1894}
1895
1870void LLInventoryPanel::setFilterTypes(U32 filter_types) 1896void LLInventoryPanel::setFilterTypes(U32 filter_types)
1871{ 1897{
1872 mFolders->getFilter()->setFilterTypes(filter_types); 1898 mFolders->getFilter()->setFilterTypes(filter_types);
diff --git a/linden/indra/newview/llinventoryview.h b/linden/indra/newview/llinventoryview.h
index e098ac7..3ec1e73 100644
--- a/linden/indra/newview/llinventoryview.h
+++ b/linden/indra/newview/llinventoryview.h
@@ -70,6 +70,7 @@ class LLInventoryPanel : public LLPanel
70public: 70public:
71 static const std::string DEFAULT_SORT_ORDER; 71 static const std::string DEFAULT_SORT_ORDER;
72 static const std::string RECENTITEMS_SORT_ORDER; 72 static const std::string RECENTITEMS_SORT_ORDER;
73 static const std::string WORNITEMS_SORT_ORDER;
73 static const std::string INHERIT_SORT_ORDER; 74 static const std::string INHERIT_SORT_ORDER;
74 75
75 LLInventoryPanel(const std::string& name, 76 LLInventoryPanel(const std::string& name,
@@ -96,6 +97,10 @@ public:
96 EAcceptance* accept, 97 EAcceptance* accept,
97 std::string& tooltip_msg); 98 std::string& tooltip_msg);
98 99
100 //fix to get rid of gSavedSettings use - rkeast
101 void setSearchType(U32 type);
102 U32 getSearchType();
103
99 // Call this method to set the selection. 104 // Call this method to set the selection.
100 void openAllFolders(); 105 void openAllFolders();
101 void closeAllFolders(); 106 void closeAllFolders();
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 f1a6626..3ab7c7b 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
@@ -64,7 +64,7 @@
64 <inventory_panel allow_multi_select="true" border="true" bottom_delta="0" 64 <inventory_panel allow_multi_select="true" border="true" bottom_delta="0"
65 follows="left|top|right|bottom" height="431" label="Worn Items" 65 follows="left|top|right|bottom" height="431" label="Worn Items"
66 left_delta="0" mouse_opaque="true" name="Worn Items" 66 left_delta="0" mouse_opaque="true" name="Worn Items"
67 sort_order="RecentItemsSortOrder" width="461" /> 67 sort_order="WornItemsSortOrder" width="461" />
68 </tab_container> 68 </tab_container>
69 69
70 <menu_bar bottom="-34" drop_shadow="false" follows="left|top|right" height="18" left="2" 70 <menu_bar bottom="-34" drop_shadow="false" follows="left|top|right" height="18" left="2"