summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2021-04-21 12:12:04 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2021-04-21 12:12:04 +0300
commit2c88c74276ffd67ef511e4c3dabbf8e7c676b641 (patch)
treeebd2fd5e3f0be2aa191a490b95fc22e73a4d0fe4 /indra/newview
parentb1fad32e8b50fc7bb09a45f3454c24d6efeb4b15 (diff)
Revert "SL-12475 add Inventory Favorites tab"
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings_per_account.xml11
-rw-r--r--indra/newview/llinventorybridge.cpp56
-rw-r--r--indra/newview/llinventorymodel.cpp5
-rw-r--r--indra/newview/llinventorypanel.cpp102
-rw-r--r--indra/newview/llinventorypanel.h23
-rw-r--r--indra/newview/llpanelmaininventory.cpp12
-rw-r--r--indra/newview/llpanelmaininventory.h2
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory.xml14
-rw-r--r--indra/newview/skins/default/xui/en/panel_main_inventory.xml40
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml3
10 files changed, 25 insertions, 243 deletions
diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml
index 3d77ac43e5..537744b44c 100644
--- a/indra/newview/app_settings/settings_per_account.xml
+++ b/indra/newview/app_settings/settings_per_account.xml
@@ -403,17 +403,6 @@
<key>Value</key>
<string></string>
</map>
- <key>FavoritesFolder</key>
- <map>
- <key>Comment</key>
- <string>User's chosen folder which will be shown in the Favorites tab (UUID)</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>String</string>
- <key>Value</key>
- <string></string>
- </map>
<key>SnapshotBaseDir</key>
<map>
<key>Comment</key>
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");
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 48187c6179..28db6a5808 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -543,11 +543,6 @@ const LLUUID LLInventoryModel::findUserDefinedCategoryUUIDForType(LLFolderType::
cat_id = LLUUID(gSavedPerAccountSettings.getString("AnimationUploadFolder"));
break;
}
- case LLFolderType::FT_FAVORITE:
- {
- cat_id = LLUUID(gSavedPerAccountSettings.getString("FavoritesFolder"));
- break;
- }
default:
break;
}
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index cda39c716b..3608f9e23f 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -181,8 +181,6 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this));
mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this));
mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2));
- mCommitCallbackRegistrar.add("Inventory.SetFavoritesFolder", boost::bind(&LLInventoryPanel::setFavoritesFolder, this, _2));
- mCommitCallbackRegistrar.add("Inventory.ResetFavoritesFolder", boost::bind(&LLInventoryPanel::resetFavoritesFolder, this, _2));
}
LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id )
@@ -1473,16 +1471,6 @@ void LLInventoryPanel::fileUploadLocation(const LLSD& userdata)
}
}
-void LLInventoryPanel::setFavoritesFolder(const LLSD& userdata)
-{
- gSavedPerAccountSettings.setString("FavoritesFolder", LLFolderBridge::sSelf.get()->getUUID().asString());
-}
-
-void LLInventoryPanel::resetFavoritesFolder(const LLSD& userdata)
-{
- gSavedPerAccountSettings.setString("FavoritesFolder", "");
-}
-
void LLInventoryPanel::purgeSelectedItems()
{
if (!mFolderRoot.get()) return;
@@ -1864,96 +1852,6 @@ LLInventoryRecentItemsPanel::LLInventoryRecentItemsPanel( const Params& params)
mInvFVBridgeBuilder = &RECENT_ITEMS_BUILDER;
}
-static LLDefaultChildRegistry::Register<LLInventoryFavoriteItemsPanel> t_favorites_inventory_panel("favorites_inventory_panel");
-
-LLInventoryFavoriteItemsPanel::LLInventoryFavoriteItemsPanel(const Params& params)
- : LLInventoryPanel(params)
-{
- std::string ctrl_name = "FavoritesFolder";
- if (gSavedPerAccountSettings.controlExists(ctrl_name))
- {
- LLPointer<LLControlVariable> cntrl_ptr = gSavedPerAccountSettings.getControl(ctrl_name);
- if (cntrl_ptr.notNull())
- {
- mFolderChangedSignal = cntrl_ptr->getCommitSignal()->connect(boost::bind(&LLInventoryFavoriteItemsPanel::updateFavoritesRootFolder, this));
- }
- }
-}
-
-void LLInventoryFavoriteItemsPanel::setSelectCallback(const boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb)
-{
- if (mFolderRoot.get())
- {
- mFolderRoot.get()->setSelectCallback(cb);
- mSelectionCallback = cb;
- }
-}
-
-void LLInventoryFavoriteItemsPanel::initFromParams(const Params& p)
-{
- Params fav_params(p);
- fav_params.start_folder.id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE);
- LLInventoryPanel::initFromParams(fav_params);
- updateFavoritesRootFolder();
-}
-
-void LLInventoryFavoriteItemsPanel::updateFavoritesRootFolder()
-{
- const LLUUID& folder_id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE);
-
- bool is_favorites_set = (folder_id != gInventory.findCategoryUUIDForTypeInRoot(LLFolderType::FT_FAVORITE, true, gInventory.getRootFolderID()));
-
- if (!is_favorites_set || folder_id != getRootFolderID())
- {
- LLUUID root_id = folder_id;
- if (mFolderRoot.get())
- {
- removeItemID(getRootFolderID());
- mFolderRoot.get()->destroyView();
- }
-
- mCommitCallbackRegistrar.pushScope();
- {
- LLFolderView* folder_view = createFolderRoot(root_id);
- mFolderRoot = folder_view->getHandle();
-
- addItemID(root_id, mFolderRoot.get());
-
-
- LLRect scroller_view_rect = getRect();
- scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom);
- LLScrollContainer::Params scroller_params(mParams.scroll());
- scroller_params.rect(scroller_view_rect);
-
- if (mScroller)
- {
- removeChild(mScroller);
- delete mScroller;
- mScroller = NULL;
- }
- mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params);
- addChild(mScroller);
- mScroller->addChild(mFolderRoot.get());
- mFolderRoot.get()->setScrollContainer(mScroller);
- mFolderRoot.get()->setFollowsAll();
- mFolderRoot.get()->addChild(mFolderRoot.get()->mStatusTextBox);
-
- if (!mSelectionCallback.empty())
- {
- mFolderRoot.get()->setSelectCallback(mSelectionCallback);
- }
- }
- mCommitCallbackRegistrar.popScope();
- mFolderRoot.get()->setCallbackRegistrar(&mCommitCallbackRegistrar);
-
- if (is_favorites_set)
- {
- buildNewViews(folder_id);
- }
- mFolderRoot.get()->setShowEmptyMessage(!is_favorites_set);
- }
-}
-
/************************************************************************/
/* Asset Pre-Filtered Inventory Panel related class */
/************************************************************************/
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index e6d23eb649..a019fc2231 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -220,8 +220,6 @@ public:
void doCreate(const LLSD& userdata);
bool beginIMSession();
void fileUploadLocation(const LLSD& userdata);
- void setFavoritesFolder(const LLSD& userdata);
- void resetFavoritesFolder(const LLSD& userdata);
void purgeSelectedItems();
bool attachObject(const LLSD& userdata);
static void idle(void* user_data);
@@ -369,27 +367,6 @@ private:
EViewsInitializationState mViewsInitialized; // Whether views have been generated
};
-
-class LLInventoryFavoriteItemsPanel : public LLInventoryPanel
-{
-public:
- struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
- {};
-
- void initFromParams(const Params& p);
- bool isSelectionRemovable() { return false; }
- void setSelectCallback(const boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb);
-
-protected:
- LLInventoryFavoriteItemsPanel(const Params& params);
- ~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); }
- void updateFavoritesRootFolder();
-
- boost::signals2::connection mFolderChangedSignal;
- boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)> mSelectionCallback;
- friend class LLUICtrlFactory;
-};
-
/************************************************************************/
/* Asset Pre-Filtered Inventory Panel related class */
/* Exchanges filter's flexibility for speed of generation and */
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index d9138091c6..e9c9c451a2 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -190,16 +190,6 @@ BOOL LLPanelMainInventory::postBuild()
worn_filter.markDefault();
mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2));
}
-
- mFavoriteItemsPanel = getChild<LLInventoryFavoriteItemsPanel>("Favorite Items");
- if (mFavoriteItemsPanel)
- {
- LLInventoryFilter& recent_filter = mFavoriteItemsPanel->getFilter();
- recent_filter.setEmptyLookupMessage("InventoryFavoritItemsNotSelected");
- recent_filter.markDefault();
- mFavoriteItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mFavoriteItemsPanel, _1, _2));
- }
-
mSearchTypeCombo = getChild<LLComboBox>("search_type");
if(mSearchTypeCombo)
{
@@ -1449,7 +1439,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
}
if (command_name == "delete")
{
- return getActivePanel()->isSelectionRemovable() && (getActivePanel() != mFavoriteItemsPanel);
+ return getActivePanel()->isSelectionRemovable();
}
if (command_name == "save_texture")
{
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index 313e478bfe..dfb8db9d12 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -37,7 +37,6 @@
class LLComboBox;
class LLFolderViewItem;
class LLInventoryPanel;
-class LLInventoryFavoriteItemsPanel;
class LLSaveFolderState;
class LLFilterEditor;
class LLTabContainer;
@@ -138,7 +137,6 @@ private:
LLHandle<LLFloater> mFinderHandle;
LLInventoryPanel* mActivePanel;
LLInventoryPanel* mWornItemsPanel;
- LLInventoryFavoriteItemsPanel* mFavoriteItemsPanel;
bool mResortActivePanel;
LLSaveFolderState* mSavedFolderState;
std::string mFilterText;
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index b5cde602bd..eda9739976 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -393,20 +393,6 @@
parameter="model" />
</menu_item_call>
</menu>
- <menu_item_call
- label="Use as Favorites folder"
- layout="topleft"
- name="Set Favorites folder">
- <menu_item_call.on_click
- function="Inventory.SetFavoritesFolder"/>
- </menu_item_call>
- <menu_item_call
- label="Reset Favorites folder"
- layout="topleft"
- name="Reset Favorites folder">
- <menu_item_call.on_click
- function="Inventory.ResetFavoritesFolder"/>
- </menu_item_call>
<menu
label="Change Type"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index 7bd5c9b548..2ff58035ed 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -127,32 +127,20 @@
name="Recent Items"
show_item_link_overlays="true"
width="290" />
- <inventory_panel
- name="Worn Items"
- label="WORN"
- show_empty_message="false"
- follows="all"
- layout="topleft"
- width="290"
- bg_opaque_color="DkGray2"
- bg_alpha_color="DkGray2"
- background_visible="true"
- border="false"
- bevel_style="none"
- scroll.reserve_scroll_corner="false"/>
- <favorites_inventory_panel
- name="Favorite Items"
- label="FAVORITES"
- show_empty_message="false"
- follows="all"
- layout="topleft"
- width="290"
- bg_opaque_color="DkGray2"
- bg_alpha_color="DkGray2"
- background_visible="true"
- border="false"
- bevel_style="none"
- scroll.reserve_scroll_corner="false"/>
+ <inventory_panel
+ name="Worn Items"
+ label="WORN"
+ show_empty_message="false"
+ follows="all"
+ layout="topleft"
+ width="290"
+ bg_opaque_color="DkGray2"
+ bg_alpha_color="DkGray2"
+ background_visible="true"
+ border="false"
+ bevel_style="none"
+ scroll.reserve_scroll_corner="false">
+ </inventory_panel>
</tab_container>
<layout_stack
animate="false"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 4b022e7072..1f0d9c530f 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2296,8 +2296,7 @@ For AI Character: Get the closest navigable point to the point provided.
<!-- inventory -->
<string name="InventoryNoMatchingItems">Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search].</string>
- <string name="InventoryNoMatchingRecentItems">Didn't find what you're looking for? Try [secondlife:///app/inventory/filters Show filters].</string>
- <string name="InventoryFavoritItemsNotSelected">Click "Use as Favorites folder" on a folder of your choice. You can choose a different folder at any time. System folders and folders inside them cannot be used for Favorites.</string>
+ <string name="InventoryNoMatchingRecentItems">Didn't find what you're looking for? Try [secondlife:///app/inventory/filters Show filters].</string>
<string name="PlacesNoMatchingItems">To add a place to your landmarks, click the star to the right of the location name.</string>
<string name="FavoritesNoMatchingItems">To add a place to your favorites bar, click the star to the right of the location name.</string>
<string name="MarketplaceNoMatchingItems">No items found. Check the spelling of your search string and try again.</string>