aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llinventoryview.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/llinventoryview.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llinventoryview.cpp57
1 files changed, 17 insertions, 40 deletions
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp
index 9eb33ee..afeb3be 100644
--- a/linden/indra/newview/llinventoryview.cpp
+++ b/linden/indra/newview/llinventoryview.cpp
@@ -373,19 +373,15 @@ void LLInventoryViewFinder::selectNoTypes(void* user_data)
373///---------------------------------------------------------------------------- 373///----------------------------------------------------------------------------
374/// LLInventoryView 374/// LLInventoryView
375///---------------------------------------------------------------------------- 375///----------------------------------------------------------------------------
376class LLSaveFolderState : public LLFolderViewFunctor 376void LLSaveFolderState::setApply(BOOL apply)
377{ 377{
378public: 378 mApply = apply;
379 LLSaveFolderState() : mApply(FALSE) {} 379 // before generating new list of open folders, clear the old one
380 virtual ~LLSaveFolderState() {} 380 if(!apply)
381 virtual void doFolder(LLFolderViewFolder* folder); 381 {
382 virtual void doItem(LLFolderViewItem* item) {} 382 clearOpenFolders();
383 void setApply(BOOL apply) { mApply = apply; } 383 }
384 void clearOpenFolders() { mOpenFolders.clear(); } 384}
385protected:
386 std::set<LLUUID> mOpenFolders;
387 BOOL mApply;
388};
389 385
390void LLSaveFolderState::doFolder(LLFolderViewFolder* folder) 386void LLSaveFolderState::doFolder(LLFolderViewFolder* folder)
391{ 387{
@@ -512,17 +508,6 @@ LLInventoryView::~LLInventoryView( void )
512 508
513void LLInventoryView::draw() 509void LLInventoryView::draw()
514{ 510{
515 if (mActivePanel && mActivePanel->getNeedsAutoSelect())
516 {
517 LLOpenFilteredFolders opener;
518 mActivePanel->getRootFolder()->applyFunctorRecursively(opener);
519 // select first filtered item
520 LLSelectFirstFilteredItem filter;
521 mActivePanel->getRootFolder()->applyFunctorRecursively(filter);
522 mActivePanel->getRootFolder()->scrollToShowSelection();
523 mActivePanel->setNeedsAutoSelect(FALSE);
524 }
525
526 if (LLInventoryModel::isEverythingFetched()) 511 if (LLInventoryModel::isEverythingFetched())
527 { 512 {
528 LLLocale locale(LLLocale::USER_LOCALE); 513 LLLocale locale(LLLocale::USER_LOCALE);
@@ -590,15 +575,6 @@ void LLSelectFirstFilteredItem::doFolder(LLFolderViewFolder* folder)
590 } 575 }
591} 576}
592 577
593class LLOpenFoldersWithSelection : public LLFolderViewFunctor
594{
595public:
596 LLOpenFoldersWithSelection() {}
597 virtual ~LLOpenFoldersWithSelection() {}
598 virtual void doFolder(LLFolderViewFolder* folder);
599 virtual void doItem(LLFolderViewItem* item);
600};
601
602void LLOpenFoldersWithSelection::doItem(LLFolderViewItem *item) 578void LLOpenFoldersWithSelection::doItem(LLFolderViewItem *item)
603{ 579{
604 if (item->getParentFolder() && item->isSelected()) 580 if (item->getParentFolder() && item->isSelected())
@@ -728,7 +704,7 @@ LLInventoryView* LLInventoryView::showAgentInventory(BOOL take_keyboard_focus)
728 { 704 {
729 // Make sure it's in front and it makes a noise 705 // Make sure it's in front and it makes a noise
730 iv->setTitle("Inventory"); 706 iv->setTitle("Inventory");
731 iv->open(); 707 iv->open(); /*Flawfinder: ignore*/
732 } 708 }
733 //if (take_keyboard_focus) 709 //if (take_keyboard_focus)
734 //{ 710 //{
@@ -813,7 +789,7 @@ void LLInventoryView::toggleFindOptions()
813 LLRect(mRect.mLeft - INV_FINDER_WIDTH, mRect.mTop, mRect.mLeft, mRect.mTop - INV_FINDER_HEIGHT), 789 LLRect(mRect.mLeft - INV_FINDER_WIDTH, mRect.mTop, mRect.mLeft, mRect.mTop - INV_FINDER_HEIGHT),
814 this); 790 this);
815 mFinderHandle = finder->getHandle(); 791 mFinderHandle = finder->getHandle();
816 finder->open(); 792 finder->open(); /*Flawfinder: ignore*/
817 addDependentFloater(mFinderHandle); 793 addDependentFloater(mFinderHandle);
818 794
819 // start background fetch of folders 795 // start background fetch of folders
@@ -894,7 +870,6 @@ void LLInventoryView::onSearchEdit(const LLString& search_string, void* user_dat
894 // save current folder open state if no filter currently applied 870 // save current folder open state if no filter currently applied
895 if (!self->mActivePanel->getRootFolder()->isFilterActive()) 871 if (!self->mActivePanel->getRootFolder()->isFilterActive())
896 { 872 {
897 self->mSavedFolderState->clearOpenFolders();
898 self->mSavedFolderState->setApply(FALSE); 873 self->mSavedFolderState->setApply(FALSE);
899 self->mActivePanel->getRootFolder()->applyFunctorRecursively(*self->mSavedFolderState); 874 self->mActivePanel->getRootFolder()->applyFunctorRecursively(*self->mSavedFolderState);
900 } 875 }
@@ -1107,8 +1082,7 @@ LLInventoryPanel::LLInventoryPanel(const LLString& name,
1107 mScroller(NULL), 1082 mScroller(NULL),
1108 mAllowMultiSelect(allow_multi_select), 1083 mAllowMultiSelect(allow_multi_select),
1109 mSortOrderSetting(sort_order_setting), 1084 mSortOrderSetting(sort_order_setting),
1110 mSearchFunction(search), 1085 mSearchFunction(search)
1111 mNeedsAutoSelect(FALSE)
1112{ 1086{
1113} 1087}
1114 1088
@@ -1258,8 +1232,10 @@ void LLInventoryPanel::modelChanged(U32 mask)
1258{ 1232{
1259 LLFastTimer t2(LLFastTimer::FTM_REFRESH); 1233 LLFastTimer t2(LLFastTimer::FTM_REFRESH);
1260 1234
1235 bool handled = false;
1261 if(mask & LLInventoryObserver::LABEL) 1236 if(mask & LLInventoryObserver::LABEL)
1262 { 1237 {
1238 handled = true;
1263 // label change - empty out the display name for each object 1239 // label change - empty out the display name for each object
1264 // in this change set. 1240 // in this change set.
1265 const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); 1241 const std::set<LLUUID>& changed_items = gInventory.getChangedIDs();
@@ -1282,11 +1258,11 @@ void LLInventoryPanel::modelChanged(U32 mask)
1282 } 1258 }
1283 } 1259 }
1284 } 1260 }
1285 else if((mask & (LLInventoryObserver::STRUCTURE 1261 if((mask & (LLInventoryObserver::STRUCTURE
1286 | LLInventoryObserver::ADD 1262 | LLInventoryObserver::ADD
1287 | LLInventoryObserver::REMOVE)) != 0) 1263 | LLInventoryObserver::REMOVE)) != 0)
1288 { 1264 {
1289 1265 handled = true;
1290 // Record which folders are open by uuid. 1266 // Record which folders are open by uuid.
1291 LLInventoryModel* model = getModel(); 1267 LLInventoryModel* model = getModel();
1292 if (model) 1268 if (model)
@@ -1347,7 +1323,8 @@ void LLInventoryPanel::modelChanged(U32 mask)
1347 } 1323 }
1348 } 1324 }
1349 } 1325 }
1350 else 1326
1327 if (!handled)
1351 { 1328 {
1352 // it's a small change that only requires a refresh. 1329 // it's a small change that only requires a refresh.
1353 // *TODO: figure out a more efficient way to do the refresh 1330 // *TODO: figure out a more efficient way to do the refresh