diff options
Diffstat (limited to 'linden/indra/newview/llinventoryview.cpp')
-rw-r--r-- | linden/indra/newview/llinventoryview.cpp | 74 |
1 files changed, 41 insertions, 33 deletions
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index 900b145..bb70ea4 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp | |||
@@ -451,11 +451,13 @@ void LLInventoryView::init(LLInventoryModel* inventory) | |||
451 | U32 sort_order = gSavedSettings.getU32("InventorySortOrder"); | 451 | U32 sort_order = gSavedSettings.getU32("InventorySortOrder"); |
452 | BOOL sort_by_name = ! ( sort_order & LLInventoryFilter::SO_DATE ); | 452 | BOOL sort_by_name = ! ( sort_order & LLInventoryFilter::SO_DATE ); |
453 | BOOL sort_folders_by_name = ( sort_order & LLInventoryFilter::SO_FOLDERS_BY_NAME ); | 453 | BOOL sort_folders_by_name = ( sort_order & LLInventoryFilter::SO_FOLDERS_BY_NAME ); |
454 | BOOL sort_system_folders_to_top = ( sort_order & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP ); | ||
454 | 455 | ||
455 | addBoolControl("Inventory.ShowFilters", FALSE); | 456 | addBoolControl("Inventory.ShowFilters", FALSE); |
456 | addBoolControl("Inventory.SortByName", sort_by_name ); | 457 | addBoolControl("Inventory.SortByName", sort_by_name ); |
457 | addBoolControl("Inventory.SortByDate", ! sort_by_name ); | 458 | addBoolControl("Inventory.SortByDate", ! sort_by_name ); |
458 | addBoolControl("Inventory.FoldersAlwaysByName", sort_folders_by_name ); | 459 | addBoolControl("Inventory.FoldersAlwaysByName", sort_folders_by_name ); |
460 | addBoolControl("Inventory.SystemFoldersToTop", sort_system_folders_to_top ); | ||
459 | 461 | ||
460 | mSavedFolderState = new LLSaveFolderState(); | 462 | mSavedFolderState = new LLSaveFolderState(); |
461 | mSavedFolderState->setApply(FALSE); | 463 | mSavedFolderState->setApply(FALSE); |
@@ -637,20 +639,24 @@ void LLInventoryView::onClose(bool app_quitting) | |||
637 | BOOL LLInventoryView::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) | 639 | BOOL LLInventoryView::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) |
638 | { | 640 | { |
639 | LLFolderView* root_folder = mActivePanel ? mActivePanel->getRootFolder() : NULL; | 641 | LLFolderView* root_folder = mActivePanel ? mActivePanel->getRootFolder() : NULL; |
640 | // first check for user accepting current search results | 642 | if (root_folder) |
641 | if (!called_from_parent && root_folder&& | ||
642 | mSearchEditor && mSearchEditor->hasFocus() && | ||
643 | (key == KEY_RETURN || key == KEY_DOWN) && mask == MASK_NONE) | ||
644 | { | ||
645 | // move focus to inventory proper | ||
646 | root_folder->setFocus(TRUE); | ||
647 | root_folder->scrollToShowSelection(); | ||
648 | return TRUE; | ||
649 | } | ||
650 | |||
651 | if (root_folder->hasFocus() && key == KEY_UP) | ||
652 | { | 643 | { |
653 | startSearch(); | 644 | // first check for user accepting current search results |
645 | if (!called_from_parent | ||
646 | && mSearchEditor && mSearchEditor->hasFocus() | ||
647 | && (key == KEY_RETURN || key == KEY_DOWN) | ||
648 | && mask == MASK_NONE) | ||
649 | { | ||
650 | // move focus to inventory proper | ||
651 | root_folder->setFocus(TRUE); | ||
652 | root_folder->scrollToShowSelection(); | ||
653 | return TRUE; | ||
654 | } | ||
655 | |||
656 | if (root_folder->hasFocus() && key == KEY_UP) | ||
657 | { | ||
658 | startSearch(); | ||
659 | } | ||
654 | } | 660 | } |
655 | 661 | ||
656 | return LLFloater::handleKeyHere(key, mask, called_from_parent); | 662 | return LLFloater::handleKeyHere(key, mask, called_from_parent); |
@@ -1364,11 +1370,13 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) | |||
1364 | S32 count; | 1370 | S32 count; |
1365 | 1371 | ||
1366 | if (objectp) | 1372 | if (objectp) |
1367 | { | 1373 | { |
1368 | if (objectp->getType() == LLAssetType::AT_NONE) | 1374 | if (objectp->getType() <= LLAssetType::AT_NONE || |
1375 | objectp->getType() >= LLAssetType::AT_COUNT) | ||
1369 | { | 1376 | { |
1370 | llwarns << "LLInventoryPanel::buildNewViews called with objectp->mType == AT_NONE (shouldn't happen)" << llendl; | 1377 | llwarns << "LLInventoryPanel::buildNewViews called with objectp->mType == " |
1371 | itemp = NULL; | 1378 | << ((S32) objectp->getType()) |
1379 | << " (shouldn't happen)" << llendl; | ||
1372 | } | 1380 | } |
1373 | else if (objectp->getType() == LLAssetType::AT_CATEGORY) // build new view for category | 1381 | else if (objectp->getType() == LLAssetType::AT_CATEGORY) // build new view for category |
1374 | { | 1382 | { |
@@ -1377,19 +1385,16 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) | |||
1377 | this, | 1385 | this, |
1378 | objectp->getUUID()); | 1386 | objectp->getUUID()); |
1379 | 1387 | ||
1380 | LLFolderViewFolder* folderp = new LLFolderViewFolder(new_listener->getDisplayName(), | 1388 | if (new_listener) |
1381 | new_listener->getIcon(), | ||
1382 | mFolders, | ||
1383 | new_listener); | ||
1384 | if (!(mFolders->getSortOrder() & LLInventoryFilter::SO_DATE)) | ||
1385 | { | ||
1386 | folderp->setItemSortFunction(sort_item_name); | ||
1387 | } | ||
1388 | else | ||
1389 | { | 1389 | { |
1390 | folderp->setItemSortFunction(sort_item_date); | 1390 | LLFolderViewFolder* folderp = new LLFolderViewFolder(new_listener->getDisplayName(), |
1391 | new_listener->getIcon(), | ||
1392 | mFolders, | ||
1393 | new_listener); | ||
1394 | |||
1395 | folderp->setItemSortOrder(mFolders->getSortOrder()); | ||
1396 | itemp = folderp; | ||
1391 | } | 1397 | } |
1392 | itemp = folderp; | ||
1393 | } | 1398 | } |
1394 | else // build new view for item | 1399 | else // build new view for item |
1395 | { | 1400 | { |
@@ -1400,11 +1405,14 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) | |||
1400 | this, | 1405 | this, |
1401 | item->getUUID(), | 1406 | item->getUUID(), |
1402 | item->getFlags()); | 1407 | item->getFlags()); |
1403 | itemp = new LLFolderViewItem(new_listener->getDisplayName(), | 1408 | if (new_listener) |
1404 | new_listener->getIcon(), | 1409 | { |
1405 | new_listener->getCreationDate(), | 1410 | itemp = new LLFolderViewItem(new_listener->getDisplayName(), |
1406 | mFolders, | 1411 | new_listener->getIcon(), |
1407 | new_listener); | 1412 | new_listener->getCreationDate(), |
1413 | mFolders, | ||
1414 | new_listener); | ||
1415 | } | ||
1408 | } | 1416 | } |
1409 | 1417 | ||
1410 | LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolders->getItemByID(objectp->getParentUUID()); | 1418 | LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolders->getItemByID(objectp->getParentUUID()); |