From d843a0d8bef5d36d3a4ef838b1b0335b4532147b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 25 Apr 2013 17:09:05 -0400 Subject: SH-4137 WIP - added callback-based support for purge descendents, remove category --- indra/newview/llinventorybridge.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index a5043a30ac..27f35c5946 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1159,17 +1159,10 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid) { - LLInventoryCategory* cat = model->getCategory(uuid); - if (cat) - { - model->purgeDescendentsOf(uuid); - model->notifyObservers(); - } LLInventoryObject* obj = model->getObject(uuid); if (obj) { - model->purgeObject(uuid); - model->notifyObservers(); + remove_inventory_object(uuid, NULL); } } -- cgit v1.2.3 From b1998cabc487c434555276a389ed19847b98f998 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 13 May 2013 17:08:37 -0400 Subject: SH-4168 WIP, SH-4155 WIP - update inventory model based on ais returns, try to maintain loading... string more consistently in folder bridge --- indra/newview/llinventorybridge.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) mode change 100644 => 100755 indra/newview/llinventorybridge.cpp (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp old mode 100644 new mode 100755 index 27f35c5946..abebd0aa5e --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1566,18 +1566,18 @@ void LLItemBridge::buildDisplayName() const else { mDisplayName.assign(LLStringUtil::null); -} - + } + mSearchableName.assign(mDisplayName); mSearchableName.append(getLabelSuffix()); LLStringUtil::toUpper(mSearchableName); - + //Name set, so trigger a sort if(mParent) -{ - mParent->requestSort(); - } + { + mParent->requestSort(); } +} LLFontGL::StyleFlags LLItemBridge::getLabelStyle() const { @@ -1901,8 +1901,7 @@ void LLFolderBridge::update() possibly_has_children = true; } - bool loading = (possibly_has_children - && !up_to_date ); + bool loading = (possibly_has_children && !up_to_date ); if (loading != mIsLoading) { @@ -1929,12 +1928,13 @@ void LLFolderBridge::update() || (LLInventoryModelBackgroundFetch::instance().folderFetchActive() && root_is_loading)) { + buildDisplayName(); mDisplayName = LLInvFVBridge::getDisplayName() + " ( " + LLTrans::getString("LoadingData") + " ) "; mIsLoading = true; } else { - mDisplayName = LLInvFVBridge::getDisplayName(); + buildDisplayName(); mIsLoading = false; } } -- cgit v1.2.3 From 8a4add76b44bab32633c5432f8852e5351770c91 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 15 May 2013 18:08:12 -0400 Subject: SH-4175 WIP - Avoid add to outfit or remove from outfit when an outfit change is already in progress --- indra/newview/llinventorybridge.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index abebd0aa5e..b857f8bbec 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3579,6 +3579,10 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& { disabled_items.push_back(std::string("Replace Outfit")); } + if (!LLAppearanceMgr::instance().getCanAddToCOF(mUUID)) + { + disabled_items.push_back(std::string("Add To Outfit")); + } items.push_back(std::string("Outfit Separator")); } } -- cgit v1.2.3 From 14f7ad902330051e1bb3ff17abbbfa05a0ebf7e8 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 16 May 2013 19:17:52 -0700 Subject: SH-4168 FIX Inventory: Loading... Loading... shown on folders cleaned up logic for displaying "loading..." message so that it only applies to folders that are opened whose contents aren't yet loaded --- indra/newview/llinventorybridge.cpp | 48 ++++++++++--------------------------- 1 file changed, 13 insertions(+), 35 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b857f8bbec..c32abe507e 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -200,6 +200,7 @@ const std::string& LLInvFVBridge::getDisplayName() const { buildDisplayName(); } + return mDisplayName; } @@ -1894,49 +1895,19 @@ void LLFolderBridge::buildDisplayName() const void LLFolderBridge::update() { - bool possibly_has_children = false; - bool up_to_date = isUpToDate(); - if(!up_to_date && hasChildren()) // we know we have children but haven't fetched them (doesn't obey filter) - { - possibly_has_children = true; - } - - bool loading = (possibly_has_children && !up_to_date ); + // we know we have children but haven't fetched them (doesn't obey filter) + bool loading = !isUpToDate() && hasChildren() && mFolderViewItem->isOpen(); if (loading != mIsLoading) { - if ( loading && !mIsLoading ) + if ( loading ) { // Measure how long we've been in the loading state mTimeSinceRequestStart.reset(); } + mIsLoading = loading; - const BOOL in_inventory = gInventory.isObjectDescendentOf(getUUID(), gInventory.getRootFolderID()); - const BOOL in_library = gInventory.isObjectDescendentOf(getUUID(), gInventory.getLibraryRootFolderID()); - - bool root_is_loading = false; - if (in_inventory) - { - root_is_loading = LLInventoryModelBackgroundFetch::instance().inventoryFetchInProgress(); - } - if (in_library) - { - root_is_loading = LLInventoryModelBackgroundFetch::instance().libraryFetchInProgress(); - } - if ((mIsLoading - && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) - || (LLInventoryModelBackgroundFetch::instance().folderFetchActive() - && root_is_loading)) - { - buildDisplayName(); - mDisplayName = LLInvFVBridge::getDisplayName() + " ( " + LLTrans::getString("LoadingData") + " ) "; - mIsLoading = true; - } - else - { - buildDisplayName(); - mIsLoading = false; - } + mFolderViewItem->refresh(); } } @@ -3056,6 +3027,13 @@ LLUIImagePtr LLFolderBridge::getIconOverlay() const return NULL; } +std::string LLFolderBridge::getLabelSuffix() const +{ + static LLCachedControl folder_loading_message_delay(gSavedSettings, "FolderLoadingMessageWaitTime"); + return mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= folder_loading_message_delay() + ? llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str()) + : LLStringUtil::null; +} BOOL LLFolderBridge::renameItem(const std::string& new_name) { -- cgit v1.2.3 From 6c56c77ec575141963c5de8dfa228253fe175bc3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 24 May 2013 08:53:21 -0400 Subject: SH-4027 WIP - initial implementation of item update via AIS. --- indra/newview/llinventorybridge.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index c32abe507e..89c56ab82c 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1692,13 +1692,9 @@ BOOL LLItemBridge::renameItem(const std::string& new_name) LLViewerInventoryItem* item = getItem(); if(item && (item->getName() != new_name)) { - LLPointer new_item = new LLViewerInventoryItem(item); - new_item->rename(new_name); - new_item->updateServer(FALSE); - model->updateItem(new_item); - - model->notifyObservers(); - buildDisplayName(); + LLSD updates; + updates["name"] = new_name; + update_inventory_item(item->getUUID(),updates, NULL); } // return FALSE because we either notified observers (& therefore // rebuilt) or we didn't update. -- cgit v1.2.3 From fd2893e23d002124c49416b7e7a497a1105d2fc4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 26 Jun 2013 12:19:38 -0400 Subject: SH-4305 WIP - cleanup --- indra/newview/llinventorybridge.cpp | 44 ------------------------------------- 1 file changed, 44 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 89c56ab82c..09a96c82b5 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2436,29 +2436,6 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, LLAppearanceMgr::instance().linkAll(mUUID,items,NULL); } } - else - { -#if SUPPORT_ENSEMBLES - // BAP - should skip if dup. - if (move_is_into_current_outfit) - { - LLAppearanceMgr::instance().addEnsembleLink(inv_cat); - } - else - { - LLPointer cb = NULL; - const std::string empty_description = ""; - link_inventory_item( - gAgent.getID(), - cat_id, - mUUID, - inv_cat->getName(), - empty_description, - LLAssetType::AT_LINK_FOLDER, - cb); - } -#endif - } } else if (move_is_into_outbox && !move_is_from_outbox) { @@ -2850,17 +2827,6 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) modifyOutfit(FALSE); return; } -#if SUPPORT_ENSEMBLES - else if ("wearasensemble" == action) - { - LLInventoryModel* model = getInventoryModel(); - if(!model) return; - LLViewerInventoryCategory* cat = getCategory(); - if(!cat) return; - LLAppearanceMgr::instance().addEnsembleLink(cat,true); - return; - } -#endif else if ("addtooutfit" == action) { modifyOutfit(TRUE); @@ -3382,16 +3348,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items items.push_back(std::string("New Clothes")); items.push_back(std::string("New Body Parts")); } -#if SUPPORT_ENSEMBLES - // Changing folder types is an unfinished unsupported feature - // and can lead to unexpected behavior if enabled. - items.push_back(std::string("Change Type")); - const LLViewerInventoryCategory *cat = getCategory(); - if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType())) - { - disabled_items.push_back(std::string("Change Type")); - } -#endif getClipboardEntries(false, items, disabled_items, flags); } else -- cgit v1.2.3 From 47fb1fc67b9cc1d3a31359da871cb6477701173b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 27 Jun 2013 15:30:14 -0400 Subject: SH-4300 WIP - added callback for a non-callback case of updateClothingOrderingInfo. Also removed some wrong code for drag-and-drop corresponding to a case that's not allowed anyway. --- indra/newview/llinventorybridge.cpp | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 09a96c82b5..cb3f40a5bb 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2416,26 +2416,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } - // if target is an outfit or current outfit folder we use link - if (move_is_into_current_outfit || move_is_into_outfit) + // if target is current outfit folder we use link + if (move_is_into_current_outfit && + inv_cat->getPreferredType() == LLFolderType::FT_NONE) { - if (inv_cat->getPreferredType() == LLFolderType::FT_NONE) - { - if (move_is_into_current_outfit) - { - // traverse category and add all contents to currently worn. - BOOL append = true; - LLAppearanceMgr::instance().wearInventoryCategory(inv_cat, false, append); - } - else - { - // Recursively create links in target outfit. - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; - model->collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH); - LLAppearanceMgr::instance().linkAll(mUUID,items,NULL); - } - } + // traverse category and add all contents to currently worn. + BOOL append = true; + LLAppearanceMgr::instance().wearInventoryCategory(inv_cat, false, append); } else if (move_is_into_outbox && !move_is_from_outbox) { -- cgit v1.2.3 From 3ed3b88892adb4234c375d2d6bd5f0d2da5566c7 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 9 Aug 2013 13:36:36 -0700 Subject: Refactoring link creation calls in preparation for adding AIS v3 hook. --- indra/newview/llinventorybridge.cpp | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index cb3f40a5bb..0481bf5f45 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3223,28 +3223,9 @@ void LLFolderBridge::pasteLinkFromClipboard() dropToOutfit(item, move_is_into_current_outfit); } } - else if (LLInventoryCategory *cat = model->getCategory(object_id)) + else if (LLConstPointer obj = model->getObject(object_id)) { - const std::string empty_description = ""; - link_inventory_item( - gAgent.getID(), - cat->getUUID(), - parent_id, - cat->getName(), - empty_description, - LLAssetType::AT_LINK_FOLDER, - LLPointer(NULL)); - } - else if (LLInventoryItem *item = model->getItem(object_id)) - { - link_inventory_item( - gAgent.getID(), - item->getLinkedUUID(), - parent_id, - item->getName(), - item->getDescription(), - LLAssetType::AT_LINK, - LLPointer(NULL)); + link_inventory_object(parent_id, obj, LLPointer(NULL)); } } // Change mode to paste for next paste @@ -3830,14 +3811,7 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_c else { LLPointer cb = NULL; - link_inventory_item( - gAgent.getID(), - inv_item->getLinkedUUID(), - mUUID, - inv_item->getName(), - inv_item->getDescription(), - LLAssetType::AT_LINK, - cb); + link_inventory_object(mUUID, LLConstPointer(inv_item), cb); } } -- cgit v1.2.3 From 8f4c4db90fdafc86efb64318e611d00aae662ab1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Sat, 23 Nov 2013 09:37:09 -0500 Subject: SH-4611 FIX - use an observer to scroll after category rename completes --- indra/newview/llinventorybridge.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3877f9f040..74837bac37 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2984,8 +2984,45 @@ std::string LLFolderBridge::getLabelSuffix() const : LLStringUtil::null; } +class ScrollOnRenameObserver: public LLInventoryObserver +{ +public: + LLFolderView *mView; + LLUUID mUUID; + + ScrollOnRenameObserver(const LLUUID& uuid, LLFolderView *view): + mUUID(uuid), + mView(view) + { + } + void changed(U32 mask) + { + if (mask & LLInventoryObserver::LABEL) + { + // TODO - check for whether this is the item we're waiting for a rename of + const uuid_set_t& changed_item_ids = gInventory.getChangedIDs(); + for (uuid_set_t::const_iterator it = changed_item_ids.begin(); it != changed_item_ids.end(); ++it) + { + const LLUUID& id = *it; + if (id == mUUID) + { + mView->scrollToShowSelection(); + + gInventory.removeObserver(this); + delete this; + return; + } + } + } + } +}; + BOOL LLFolderBridge::renameItem(const std::string& new_name) { + + LLScrollOnRenameObserver *observer = new LLScrollOnRenameObserver(mUUID, mRoot); + gInventory.addObserver(observer); + rename_category(getInventoryModel(), mUUID, new_name); // return FALSE because we either notified observers (& therefore -- cgit v1.2.3 From fd2d81223697bad850b979f308c271ca370eccd3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 25 Nov 2013 16:03:52 -0500 Subject: SH-4549 FIX - code cleanup --- indra/newview/llinventorybridge.cpp | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 74837bac37..1f942f5f4b 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2984,39 +2984,6 @@ std::string LLFolderBridge::getLabelSuffix() const : LLStringUtil::null; } -class ScrollOnRenameObserver: public LLInventoryObserver -{ -public: - LLFolderView *mView; - LLUUID mUUID; - - ScrollOnRenameObserver(const LLUUID& uuid, LLFolderView *view): - mUUID(uuid), - mView(view) - { - } - void changed(U32 mask) - { - if (mask & LLInventoryObserver::LABEL) - { - // TODO - check for whether this is the item we're waiting for a rename of - const uuid_set_t& changed_item_ids = gInventory.getChangedIDs(); - for (uuid_set_t::const_iterator it = changed_item_ids.begin(); it != changed_item_ids.end(); ++it) - { - const LLUUID& id = *it; - if (id == mUUID) - { - mView->scrollToShowSelection(); - - gInventory.removeObserver(this); - delete this; - return; - } - } - } - } -}; - BOOL LLFolderBridge::renameItem(const std::string& new_name) { -- cgit v1.2.3 From 940cde3938217daf348bd62f719cae262bad86b0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 3 Dec 2013 11:49:29 -0500 Subject: SH-4640 WIP --- indra/newview/llinventorybridge.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1f942f5f4b..4bce25c8b5 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1730,16 +1730,9 @@ BOOL LLItemBridge::removeItem() { if (!item->getIsLinkType()) { - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - LLLinkedItemIDMatches is_linked_item_match(mUUID); - gInventory.collectDescendentsIf(gInventory.getRootFolderID(), - cat_array, - item_array, - LLInventoryModel::INCLUDE_TRASH, - is_linked_item_match); - - const U32 num_links = cat_array.size() + item_array.size(); + LLInventoryModel::item_array_t item_array = + gInventory.collectLinksTo(mUUID, gInventory.getRootFolderID()); + const U32 num_links = item_array.size(); if (num_links > 0) { // Warn if the user is will break any links when deleting this item. -- cgit v1.2.3 From 1320e5ddcd9fc3be526dcacbf4710f8bcf878665 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 3 Dec 2013 16:35:07 -0500 Subject: SH-4640 WIP - use backlinks in inventory --- indra/newview/llinventorybridge.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4bce25c8b5..fbb276efd6 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1730,8 +1730,7 @@ BOOL LLItemBridge::removeItem() { if (!item->getIsLinkType()) { - LLInventoryModel::item_array_t item_array = - gInventory.collectLinksTo(mUUID, gInventory.getRootFolderID()); + LLInventoryModel::item_array_t item_array = gInventory.collectLinksTo(mUUID); const U32 num_links = item_array.size(); if (num_links > 0) { -- cgit v1.2.3 From cc9a7a70b1971def1c53c70c96e8ce88fc5a7b86 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 17 Dec 2013 14:14:03 -0500 Subject: merge fix --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 32164f3a72..1a98f293d1 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2970,7 +2970,7 @@ LLUIImagePtr LLFolderBridge::getIconOverlay() const std::string LLFolderBridge::getLabelSuffix() const { - static LLCachedControl folder_loading_message_delay(gSavedSettings, "FolderLoadingMessageWaitTime", 0.5); + static LLCachedControl folder_loading_message_delay(gSavedSettings, "FolderLoadingMessageWaitTime", 0.5f); return mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= folder_loading_message_delay() ? llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str()) : LLStringUtil::null; -- cgit v1.2.3