From 42e1a9ed870c537b5684cd15a7acc524a3672685 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 27 Jan 2020 17:54:02 +0200 Subject: SL-12475 add Inventory Favorites tab # Conflicts: # indra/newview/llinventorybridge.cpp # indra/newview/llinventorypanel.cpp --- indra/newview/llinventorybridge.cpp | 52 ++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 9 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 657c65c68d..03123689c5 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -138,6 +138,35 @@ bool isMarketplaceSendAction(const std::string& action) return ("send_to_marketplace" == action); } +bool isPanelActive(const std::string& panel_name) +{ + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + return (active_panel && (active_panel->getName() == panel_name)); +} + +bool isParentSystemFolder(const LLInventoryModel* model, const LLUUID& folder_id) +{ + if (!model || folder_id.isNull()) return false; + + LLViewerInventoryCategory* cat = model->getCategory(folder_id); + if (cat) + { + if (cat->getPreferredType() == LLFolderType::FT_ROOT_INVENTORY) + { + return false; + } + if (LLFolderType::lookupIsProtectedType(cat->getPreferredType())) + { + return true; + } + else + { + return isParentSystemFolder(model, cat->getParentUUID()); + } + } + return false; +} + // Used by LLFolderBridge as callback for directory fetching recursion class LLRightClickInventoryFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver { @@ -888,8 +917,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, disabled_items.push_back(std::string("Properties")); } - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); - if (active_panel && (active_panel->getName() != "All Items")) + if (!isPanelActive("All Items")) { items.push_back(std::string("Show in Main Panel")); } @@ -980,7 +1008,7 @@ void LLInvFVBridge::addDeleteContextMenuOptions(menuentry_vec_t &items, items.push_back(std::string("Delete")); - if (!isItemRemovable()) + if (!isItemRemovable() || isPanelActive("Favorite Items")) { disabled_items.push_back(std::string("Delete")); } @@ -4010,6 +4038,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("New Clothes")); disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); + disabled_items.push_back(std::string("Set Favorites folder")); } if (favorites == mUUID) { @@ -4037,6 +4066,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("New Clothes")); disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); + disabled_items.push_back(std::string("Set Favorites folder")); } if (marketplace_listings_id == mUUID) { @@ -4045,14 +4075,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("Cut")); disabled_items.push_back(std::string("Delete")); } + + if (isPanelActive("Favorite Items")) + { + disabled_items.push_back(std::string("Delete")); + } if(trash_id == mUUID) { - bool is_recent_panel = false; - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); - if (active_panel && (active_panel->getName() == "Recent Items")) - { - is_recent_panel = true; - } + bool is_recent_panel = isPanelActive("Recent Items"); // This is the trash. items.push_back(std::string("Empty Trash")); @@ -4102,6 +4132,10 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items items.push_back(std::string("New Settings")); items.push_back(std::string("upload_def")); + if (!LLFolderType::lookupIsProtectedType(getPreferredType()) && !isParentSystemFolder(model, mUUID)) + { + items.push_back(std::string("Set Favorites folder")); + } if (!LLEnvironment::instance().isInventoryEnabled()) { disabled_items.push_back("New Settings"); -- cgit v1.2.3 From b484a2736524dc52ef81dd3e3d25ee0970674fd4 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 4 Nov 2020 18:53:56 +0200 Subject: SL-13826 Open a new inventory floater for "Find original" and "Show original" result --- indra/newview/llinventorybridge.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 03123689c5..67d65547b6 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1881,6 +1881,7 @@ void LLItemBridge::gotoItem() if (active_panel) { active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); + active_panel->setFocus(TRUE); } } @@ -7229,24 +7230,13 @@ void LLLinkFolderBridge::performAction(LLInventoryModel* model, std::string acti } LLItemBridge::performAction(model,action); } + void LLLinkFolderBridge::gotoItem() { - const LLUUID &cat_uuid = getFolderID(); - if (!cat_uuid.isNull()) - { - LLFolderViewItem *base_folder = mInventoryPanel.get()->getItemByID(cat_uuid); - if (base_folder) - { - if (LLInventoryModel* model = getInventoryModel()) - { - model->fetchDescendentsOf(cat_uuid); - } - base_folder->setOpen(TRUE); - mRoot->setSelection(base_folder,TRUE); - mRoot->scrollToShowSelection(); - } - } + LLItemBridge::gotoItem(); + LLInventoryPanel::getActiveInventoryPanel()->openFolderByID(getFolderID()); } + const LLUUID &LLLinkFolderBridge::getFolderID() const { if (LLViewerInventoryItem *link_item = getItem()) -- cgit v1.2.3 From 6ec194154be3d40f897d728925d1a565c6f8be78 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 10 Dec 2020 17:43:21 +0200 Subject: SL-13826 Show result of "Find original" and "Show original" in Main Inventory floater and reset the filters to guarantee success --- indra/newview/llinventorybridge.cpp | 41 ++++++++++++++----------------------- 1 file changed, 15 insertions(+), 26 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ae96963b2a..27e222237e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1863,29 +1863,11 @@ void LLItemBridge::restoreToWorld() void LLItemBridge::gotoItem() { - LLInventoryObject *obj = getInventoryObject(); - if (obj && obj->getIsLinkType()) - { - const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX); - if (gInventory.isObjectDescendentOf(obj->getLinkedUUID(), inbox_id)) - { - LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); - if (sidepanel_inventory && sidepanel_inventory->getInboxPanel()) - { - sidepanel_inventory->getInboxPanel()->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); - } - } - else - { - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if (active_panel) - { - active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); - active_panel->setFocus(TRUE); - } - } - - } + LLInventoryObject *obj = getInventoryObject(); + if (obj && obj->getIsLinkType()) + { + show_item_original(obj->getUUID()); + } } LLUIImagePtr LLItemBridge::getIcon() const @@ -7251,13 +7233,20 @@ void LLLinkFolderBridge::performAction(LLInventoryModel* model, std::string acti } LLItemBridge::performAction(model,action); } - void LLLinkFolderBridge::gotoItem() { LLItemBridge::gotoItem(); - LLInventoryPanel::getActiveInventoryPanel()->openFolderByID(getFolderID()); -} + const LLUUID &cat_uuid = getFolderID(); + if (!cat_uuid.isNull()) + { + LLFolderViewItem *base_folder = LLInventoryPanel::getActiveInventoryPanel()->getItemByID(cat_uuid); + if (base_folder) + { + base_folder->setOpen(TRUE); + } + } +} const LLUUID &LLLinkFolderBridge::getFolderID() const { if (LLViewerInventoryItem *link_item = getItem()) -- cgit v1.2.3 From 1087c26de7ba89465618518ba93dc7161f075f47 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 6 Jan 2021 12:08:21 +0200 Subject: SL-14633 FIXED The item from the favorite tab in the inventory floater can be purged --- 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 27e222237e..34e2dc7904 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -987,7 +987,7 @@ void LLInvFVBridge::addTrashContextMenuOptions(menuentry_vec_t &items, } } items.push_back(std::string("Purge Item")); - if (!isItemRemovable()) + if (!isItemRemovable() || isPanelActive("Favorite Items")) { disabled_items.push_back(std::string("Purge Item")); } -- cgit v1.2.3 From 18717562eef9a333ad6d3598180823bd9821d06f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 18 Feb 2021 23:40:03 +0200 Subject: SL-14654 [EEP] Aplying settings locally now takes 1 second insterad of 5 --- indra/newview/llinventorybridge.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 04f89af989..0e7e762d81 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -7060,8 +7060,8 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action if (!item) return; LLUUID asset_id = item->getAssetUUID(); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); } else if ("apply_settings_parcel" == action) { -- cgit v1.2.3 From 5bdc96784c696f7a36aab1e18e70dafbe4a27d73 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 23 Feb 2021 18:41:15 +0200 Subject: SL-12475 Add the way to reset current Favorites folders --- indra/newview/llinventorybridge.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0e7e762d81..065a3cb9ae 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4115,7 +4115,11 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items items.push_back(std::string("New Settings")); items.push_back(std::string("upload_def")); - if (!LLFolderType::lookupIsProtectedType(getPreferredType()) && !isParentSystemFolder(model, mUUID)) + if (model->findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE) == mUUID) + { + items.push_back(std::string("Reset Favorites folder")); + } + else if (!LLFolderType::lookupIsProtectedType(getPreferredType()) && !isParentSystemFolder(model, mUUID)) { items.push_back(std::string("Set Favorites folder")); } -- cgit v1.2.3 From 14826e17dccb3a12fe7551effc60a2a3c62a4946 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 25 Feb 2021 23:48:48 +0200 Subject: SL-14654 [EEP] Aplying settings locally now is instant The 1 second fade makes it harder to compare different settings. --- indra/newview/llinventorybridge.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 065a3cb9ae..a0c3608107 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -7064,8 +7064,8 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action if (!item) return; LLUUID asset_id = item->getAssetUUID(); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id, LLEnvironment::TRANSITION_FAST); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); } else if ("apply_settings_parcel" == action) { -- cgit v1.2.3 From b1fad32e8b50fc7bb09a45f3454c24d6efeb4b15 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 21 Apr 2021 12:08:24 +0300 Subject: Revert "SL-14633 FIXED The item from the favorite tab in the inventory floater can be purged" --- 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 a0c3608107..d6c662557f 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -987,7 +987,7 @@ void LLInvFVBridge::addTrashContextMenuOptions(menuentry_vec_t &items, } } items.push_back(std::string("Purge Item")); - if (!isItemRemovable() || isPanelActive("Favorite Items")) + if (!isItemRemovable()) { disabled_items.push_back(std::string("Purge Item")); } -- cgit v1.2.3 From 2c88c74276ffd67ef511e4c3dabbf8e7c676b641 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 21 Apr 2021 12:12:04 +0300 Subject: Revert "SL-12475 add Inventory Favorites tab" --- indra/newview/llinventorybridge.cpp | 56 ++++++------------------------------- 1 file changed, 9 insertions(+), 47 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d6c662557f..8b61e6c61a 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -138,35 +138,6 @@ bool isMarketplaceSendAction(const std::string& action) return ("send_to_marketplace" == action); } -bool isPanelActive(const std::string& panel_name) -{ - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); - return (active_panel && (active_panel->getName() == panel_name)); -} - -bool isParentSystemFolder(const LLInventoryModel* model, const LLUUID& folder_id) -{ - if (!model || folder_id.isNull()) return false; - - LLViewerInventoryCategory* cat = model->getCategory(folder_id); - if (cat) - { - if (cat->getPreferredType() == LLFolderType::FT_ROOT_INVENTORY) - { - return false; - } - if (LLFolderType::lookupIsProtectedType(cat->getPreferredType())) - { - return true; - } - else - { - return isParentSystemFolder(model, cat->getParentUUID()); - } - } - return false; -} - // Used by LLFolderBridge as callback for directory fetching recursion class LLRightClickInventoryFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver { @@ -917,7 +888,8 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, disabled_items.push_back(std::string("Properties")); } - if (!isPanelActive("All Items")) + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + if (active_panel && (active_panel->getName() != "All Items")) { items.push_back(std::string("Show in Main Panel")); } @@ -1008,7 +980,7 @@ void LLInvFVBridge::addDeleteContextMenuOptions(menuentry_vec_t &items, items.push_back(std::string("Delete")); - if (!isItemRemovable() || isPanelActive("Favorite Items")) + if (!isItemRemovable()) { disabled_items.push_back(std::string("Delete")); } @@ -4021,7 +3993,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("New Clothes")); disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); - disabled_items.push_back(std::string("Set Favorites folder")); } if (favorites == mUUID) { @@ -4049,7 +4020,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("New Clothes")); disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); - disabled_items.push_back(std::string("Set Favorites folder")); } if (marketplace_listings_id == mUUID) { @@ -4058,14 +4028,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("Cut")); disabled_items.push_back(std::string("Delete")); } - - if (isPanelActive("Favorite Items")) - { - disabled_items.push_back(std::string("Delete")); - } if(trash_id == mUUID) { - bool is_recent_panel = isPanelActive("Recent Items"); + bool is_recent_panel = false; + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + if (active_panel && (active_panel->getName() == "Recent Items")) + { + is_recent_panel = true; + } // This is the trash. items.push_back(std::string("Empty Trash")); @@ -4115,14 +4085,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items items.push_back(std::string("New Settings")); items.push_back(std::string("upload_def")); - if (model->findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE) == mUUID) - { - items.push_back(std::string("Reset Favorites folder")); - } - else if (!LLFolderType::lookupIsProtectedType(getPreferredType()) && !isParentSystemFolder(model, mUUID)) - { - items.push_back(std::string("Set Favorites folder")); - } if (!LLEnvironment::instance().isInventoryEnabled()) { disabled_items.push_back("New Settings"); -- cgit v1.2.3