summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml70
-rw-r--r--indra/newview/llappearancemgr.cpp7
-rw-r--r--indra/newview/llappearancemgr.h2
-rw-r--r--indra/newview/llconversationmodel.h3
-rw-r--r--indra/newview/llfloaterinventorysettings.cpp28
-rw-r--r--indra/newview/llfloaterinventorysettings.h5
-rw-r--r--indra/newview/llfolderviewmodelinventory.cpp30
-rw-r--r--indra/newview/llfolderviewmodelinventory.h3
-rw-r--r--indra/newview/llinventorybridge.cpp126
-rw-r--r--indra/newview/llinventorybridge.h45
-rw-r--r--indra/newview/llinventoryfilter.cpp79
-rw-r--r--indra/newview/llinventoryfilter.h15
-rw-r--r--indra/newview/llinventoryfunctions.cpp145
-rw-r--r--indra/newview/llinventoryfunctions.h16
-rw-r--r--indra/newview/llinventorygallery.cpp59
-rw-r--r--indra/newview/llinventorygallery.h5
-rw-r--r--indra/newview/llinventorygallerymenu.cpp46
-rw-r--r--indra/newview/llinventoryitemslist.cpp2
-rw-r--r--indra/newview/llinventorymodel.cpp9
-rw-r--r--indra/newview/llinventoryobserver.cpp29
-rw-r--r--indra/newview/llinventoryobserver.h19
-rw-r--r--indra/newview/llinventorypanel.cpp349
-rw-r--r--indra/newview/llinventorypanel.h7
-rw-r--r--indra/newview/lloutfitgallery.cpp202
-rw-r--r--indra/newview/lloutfitgallery.h36
-rw-r--r--indra/newview/lloutfitslist.cpp340
-rw-r--r--indra/newview/lloutfitslist.h63
-rw-r--r--indra/newview/llpanelappearancetab.h7
-rw-r--r--indra/newview/llpanelmaininventory.cpp12
-rw-r--r--indra/newview/llpanelobjectinventory.cpp1
-rw-r--r--indra/newview/llpaneloutfitedit.cpp4
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp67
-rw-r--r--indra/newview/llpaneloutfitsinventory.h22
-rw-r--r--indra/newview/llpanelwearing.cpp28
-rw-r--r--indra/newview/llpanelwearing.h6
-rw-r--r--indra/newview/llsidepanelappearance.cpp9
-rw-r--r--indra/newview/llviewerinventory.cpp3
-rw-r--r--indra/newview/llwearableitemslist.cpp15
-rw-r--r--indra/newview/skins/default/colors.xml3
-rw-r--r--indra/newview/skins/default/textures/icons/Icon_Pointer.pngbin0 -> 294 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.pngbin0 -> 620 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.pngbin0 -> 485 bytes
-rw-r--r--indra/newview/skins/default/textures/textures.xml3
-rw-r--r--indra/newview/skins/default/xui/en/floater_inventory_settings.xml181
-rw-r--r--indra/newview/skins/default/xui/en/floater_preview_trash.xml2
-rw-r--r--indra/newview/skins/default/xui/en/menu_gallery_inventory.xml16
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml20
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory.xml18
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml11
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory_view_default.xml11
-rw-r--r--indra/newview/skins/default/xui/en/menu_outfit_gallery_sort.xml42
-rw-r--r--indra/newview/skins/default/xui/en/menu_outfit_gear.xml63
-rw-r--r--indra/newview/skins/default/xui/en/menu_outfit_list_sort.xml49
-rw-r--r--indra/newview/skins/default/xui/en/menu_outfit_tab.xml20
-rw-r--r--indra/newview/skins/default/xui/en/menu_wearable_list_item.xml14
-rw-r--r--indra/newview/skins/default/xui/en/menu_wearing_tab.xml14
-rw-r--r--indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml10
-rw-r--r--indra/newview/skins/default/xui/en/panel_main_inventory.xml16
-rw-r--r--indra/newview/skins/default/xui/en/panel_outfit_gallery.xml48
-rw-r--r--indra/newview/skins/default/xui/en/panel_outfits_list.xml46
-rw-r--r--indra/newview/skins/default/xui/en/panel_outfits_wearing.xml33
-rw-r--r--indra/newview/skins/default/xui/en/panel_places.xml2
-rw-r--r--indra/newview/skins/default/xui/en/sidepanel_appearance.xml111
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml7
-rw-r--r--indra/newview/skins/default/xui/en/widgets/folder_view_item.xml2
-rw-r--r--indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml2
66 files changed, 2290 insertions, 368 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 4b0aef91a4..e383c1f5c6 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -13843,10 +13843,32 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>OutfitGallerySortByName</key>
+ <key>OutfitGallerySortOrder</key>
<map>
<key>Comment</key>
- <string>Always sort outfits by name in Outfit Gallery</string>
+ <string>Gallery sorting: 0 - sort outfits by name, 1 - images frst, 2 - favorites first</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>OutfitListSortOrder</key>
+ <map>
+ <key>Comment</key>
+ <string>How outfit list in Avatar's floater is sorted. 0 - by name 1 - favorites to top</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>OutfitListFilterFullList</key>
+ <map>
+ <key>Comment</key>
+ <string> 0 - show only matches. 1 - show all items in outfit as long as outfit or item inside matches.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -15452,6 +15474,50 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>InventoryFavoritesUseStar</key>
+ <map>
+ <key>Comment</key>
+ <string>Show star near favorited items in inventory</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>InventoryFavoritesUseHollowStar</key>
+ <map>
+ <key>Comment</key>
+ <string>Show star near folders that contain favorites</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>InventoryFavoritesColorText</key>
+ <map>
+ <key>Comment</key>
+ <string>render favorite items using InventoryFavoriteText as color</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>InventoryAddAttachmentBehavior</key>
+ <map>
+ <key>Comment</key>
+ <string>Defines behavior when hitting return on an inventory item</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>StatsReportMaxDuration</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index b01f12ee83..b825bd9f41 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2042,7 +2042,7 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id)
}
// Moved from LLWearableList::ContextMenu for wider utility.
-bool LLAppearanceMgr::canAddWearables(const uuid_vec_t& item_ids) const
+bool LLAppearanceMgr::canAddWearables(const uuid_vec_t& item_ids, bool warn_on_type_mismatch) const
{
// TODO: investigate wearables may not be loaded at this point EXT-8231
@@ -2072,7 +2072,10 @@ bool LLAppearanceMgr::canAddWearables(const uuid_vec_t& item_ids) const
}
else
{
- LL_WARNS() << "Unexpected wearable type" << LL_ENDL;
+ if (warn_on_type_mismatch)
+ {
+ LL_WARNS() << "Unexpected wearable type" << LL_ENDL;
+ }
return false;
}
}
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index e5de92b653..51ac6522fa 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -102,7 +102,7 @@ public:
bool getCanReplaceCOF(const LLUUID& outfit_cat_id);
// Can we add all referenced items to the avatar?
- bool canAddWearables(const uuid_vec_t& item_ids) const;
+ bool canAddWearables(const uuid_vec_t& item_ids, bool warn_on_type_mismatch = true) const;
// Copy all items in a category.
void shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id,
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index 3a3c26f955..482253d069 100644
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -79,6 +79,9 @@ public:
virtual LLPointer<LLUIImage> getOpenIcon() const { return getIcon(); }
virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; }
virtual std::string getLabelSuffix() const { return LLStringUtil::null; }
+ virtual bool isFavorite() const { return false; }
+ virtual bool isAgentInventory() const { return false; }
+ virtual bool isAgentInventoryRoot() const { return false; }
virtual BOOL isItemRenameable() const { return TRUE; }
virtual BOOL renameItem(const std::string& new_name) { mName = new_name; mNeedsRefresh = true; return TRUE; }
virtual BOOL isItemMovable( void ) const { return FALSE; }
diff --git a/indra/newview/llfloaterinventorysettings.cpp b/indra/newview/llfloaterinventorysettings.cpp
index 29d6e90a33..62f76207a3 100644
--- a/indra/newview/llfloaterinventorysettings.cpp
+++ b/indra/newview/llfloaterinventorysettings.cpp
@@ -28,9 +28,14 @@
#include "llfloaterinventorysettings.h"
+#include "llcolorswatch.h"
+#include "llviewercontrol.h"
+
LLFloaterInventorySettings::LLFloaterInventorySettings(const LLSD& key)
: LLFloater(key)
{
+ mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", boost::bind(&LLFloaterInventorySettings::applyUIColor, this, _1, _2));
+ mCommitCallbackRegistrar.add("ScriptPref.getUIColor", boost::bind(&LLFloaterInventorySettings::getUIColor, this, _1, _2));
}
LLFloaterInventorySettings::~LLFloaterInventorySettings()
@@ -38,7 +43,28 @@ LLFloaterInventorySettings::~LLFloaterInventorySettings()
BOOL LLFloaterInventorySettings::postBuild()
{
- getChild<LLButton>("ok_btn")->setCommitCallback(boost::bind(&LLFloater::closeFloater, this, false));
+ getChild<LLUICtrl>("favorites_color")->setCommitCallback(boost::bind(&LLFloaterInventorySettings::updateColorSwatch, this));
+
+ bool enable_color = gSavedSettings.getBOOL("InventoryFavoritesColorText");
+ getChild<LLUICtrl>("favorites_swatch")->setEnabled(enable_color);
+
return TRUE;
}
+void LLFloaterInventorySettings::updateColorSwatch()
+{
+ bool val = getChild<LLUICtrl>("favorites_color")->getValue();
+ getChild<LLUICtrl>("favorites_swatch")->setEnabled(val);
+}
+
+void LLFloaterInventorySettings::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
+{
+ LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue()));
+}
+
+void LLFloaterInventorySettings::getUIColor(LLUICtrl* ctrl, const LLSD& param)
+{
+ LLColorSwatchCtrl* color_swatch = (LLColorSwatchCtrl*)ctrl;
+ color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString()));
+}
+
diff --git a/indra/newview/llfloaterinventorysettings.h b/indra/newview/llfloaterinventorysettings.h
index 50304276c7..87c61046e2 100644
--- a/indra/newview/llfloaterinventorysettings.h
+++ b/indra/newview/llfloaterinventorysettings.h
@@ -40,6 +40,11 @@ public:
private:
LLFloaterInventorySettings(const LLSD& key);
~LLFloaterInventorySettings();
+
+ void updateColorSwatch();
+
+ void applyUIColor(LLUICtrl* ctrl, const LLSD& param);
+ void getUIColor(LLUICtrl* ctrl, const LLSD& param);
};
#endif
diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp
index 734f20830d..58132299de 100644
--- a/indra/newview/llfolderviewmodelinventory.cpp
+++ b/indra/newview/llfolderviewmodelinventory.cpp
@@ -68,9 +68,10 @@ void LLFolderViewModelInventory::sort( LLFolderViewFolder* folder )
if (!folder->areChildrenInited() || !needsSort(folder->getViewModelItem())) return;
- LLFolderViewModelItemInventory* modelp = static_cast<LLFolderViewModelItemInventory*>(folder->getViewModelItem());
- if (modelp->getUUID().isNull()) return;
+ LLFolderViewModelItemInventory* sort_modelp = static_cast<LLFolderViewModelItemInventory*>(folder->getViewModelItem());
+ if (sort_modelp->getUUID().isNull()) return;
+ bool has_favorites = false;
for (std::list<LLFolderViewFolder*>::iterator it = folder->getFoldersBegin(), end_it = folder->getFoldersEnd();
it != end_it;
++it)
@@ -79,11 +80,14 @@ void LLFolderViewModelInventory::sort( LLFolderViewFolder* folder )
LLFolderViewFolder* child_folderp = *it;
sort(child_folderp);
+ LLFolderViewModelItemInventory* modelp = static_cast<LLFolderViewModelItemInventory*>(child_folderp->getViewModelItem());
+ has_favorites |= child_folderp->isFavorite() || child_folderp->hasFavorites();
+
if (child_folderp->getFoldersCount() > 0)
{
- time_t most_recent_folder_time =
- static_cast<LLFolderViewModelItemInventory*>((*child_folderp->getFoldersBegin())->getViewModelItem())->getCreationDate();
- LLFolderViewModelItemInventory* modelp = static_cast<LLFolderViewModelItemInventory*>(child_folderp->getViewModelItem());
+ LLFolderViewModelItemInventory* folderp = static_cast<LLFolderViewModelItemInventory*>((*child_folderp->getFoldersBegin())->getViewModelItem());
+ time_t most_recent_folder_time = folderp->getCreationDate();
+
if (most_recent_folder_time > modelp->getCreationDate())
{
modelp->setCreationDate(most_recent_folder_time);
@@ -91,16 +95,26 @@ void LLFolderViewModelInventory::sort( LLFolderViewFolder* folder )
}
if (child_folderp->getItemsCount() > 0)
{
- time_t most_recent_item_time =
- static_cast<LLFolderViewModelItemInventory*>((*child_folderp->getItemsBegin())->getViewModelItem())->getCreationDate();
+ LLFolderViewModelItemInventory* itemp = static_cast<LLFolderViewModelItemInventory*>((*child_folderp->getItemsBegin())->getViewModelItem());
+ time_t most_recent_item_time = itemp->getCreationDate();
- LLFolderViewModelItemInventory* modelp = static_cast<LLFolderViewModelItemInventory*>(child_folderp->getViewModelItem());
if (most_recent_item_time > modelp->getCreationDate())
{
modelp->setCreationDate(most_recent_item_time);
}
}
}
+ for (std::list<LLFolderViewItem*>::const_iterator it = folder->getItemsBegin(), end_it = folder->getItemsEnd();
+ it != end_it && !has_favorites;
+ ++it)
+ {
+ LLFolderViewItem* child_itemp = *it;
+ has_favorites |= child_itemp->isFavorite();
+ }
+ if (has_favorites)
+ {
+ folder->updateHasFavorites(true);
+ }
base_t::sort(folder);
}
diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h
index c8fb155176..52703c40d9 100644
--- a/indra/newview/llfolderviewmodelinventory.h
+++ b/indra/newview/llfolderviewmodelinventory.h
@@ -47,7 +47,8 @@ public:
virtual void showProperties(void) = 0;
virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual.
virtual bool isItemInOutfits() const { return false; }
- virtual BOOL isAgentInventory() const { return FALSE; }
+ virtual bool isAgentInventory() const { return false; }
+ virtual bool isAgentInventoryRoot() const { return false; }
virtual BOOL isUpToDate() const = 0;
virtual void addChild(LLFolderViewModelItem* child);
virtual bool hasChildren() const = 0;
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index e4828b14cf..ace0a791f3 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -836,6 +836,8 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
{
const LLInventoryObject *obj = getInventoryObject();
bool single_folder_root = (mRoot == NULL);
+ bool is_cof = isCOFFolder();
+ bool is_inbox = isInboxFolder();
if (obj)
{
@@ -850,7 +852,8 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
disabled_items.push_back(std::string("Copy"));
}
- if (isAgentInventory() && !single_folder_root)
+ bool is_agent_inventory = isAgentInventory();
+ if (is_agent_inventory && !single_folder_root && !is_cof && !is_inbox)
{
items.push_back(std::string("New folder from selected"));
items.push_back(std::string("Subfolder Separator"));
@@ -863,6 +866,19 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
}
}
+ if (isFavorite())
+ {
+ items.push_back(std::string("Remove from Favorites"));
+ }
+ else if (is_agent_inventory && !gInventory.isObjectDescendentOf(mUUID, gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH)))
+ {
+ items.push_back(std::string("Add to Favorites"));
+ if (gInventory.getRootFolderID() == mUUID)
+ {
+ disabled_items.push_back(std::string("Add to Favorites"));
+ }
+ }
+
if (obj->getIsLinkType())
{
items.push_back(std::string("Find Original"));
@@ -875,6 +891,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
if (!isItemMovable() || !canMenuCut())
{
disabled_items.push_back(std::string("Cut"));
+ disabled_items.push_back(std::string("New folder from selected"));
}
}
else
@@ -884,7 +901,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
items.push_back(std::string("Find Links"));
}
- if (!isInboxFolder() && !single_folder_root)
+ if (!is_inbox && !single_folder_root)
{
items.push_back(std::string("Rename"));
if (!isItemRenameable() || ((flags & FIRST_SELECTED_ITEM) == 0))
@@ -924,6 +941,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
if (!isItemMovable() || !canMenuCut())
{
disabled_items.push_back(std::string("Cut"));
+ disabled_items.push_back(std::string("New folder from selected"));
}
if (canListOnMarketplace() && !isMarketplaceListingsFolder() && !isInboxFolder())
@@ -946,7 +964,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
}
// Don't allow items to be pasted directly into the COF or the inbox
- if (!isCOFFolder() && !isInboxFolder())
+ if (!is_cof && !is_inbox)
{
items.push_back(std::string("Paste"));
}
@@ -1188,8 +1206,8 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags,
LLInventoryModel::cat_array_t categories;
LLInventoryModel::item_array_t items;
gInventory.collectDescendents(local_version_folder_id, categories, items, FALSE);
- LLCachedControl<U32> max_depth(gSavedSettings, "InventoryOutboxMaxFolderDepth", 4);
- LLCachedControl<U32> max_count(gSavedSettings, "InventoryOutboxMaxFolderCount", 20);
+ static LLCachedControl<U32> max_depth(gSavedSettings, "InventoryOutboxMaxFolderDepth", 4);
+ static LLCachedControl<U32> max_count(gSavedSettings, "InventoryOutboxMaxFolderCount", 20);
if (categories.size() >= max_count
|| depth > (max_depth + 1))
{
@@ -1331,7 +1349,7 @@ BOOL LLInvFVBridge::isLinkedObjectMissing() const
return FALSE;
}
-BOOL LLInvFVBridge::isAgentInventory() const
+bool LLInvFVBridge::isAgentInventory() const
{
const LLInventoryModel* model = getInventoryModel();
if(!model) return FALSE;
@@ -1339,6 +1357,13 @@ BOOL LLInvFVBridge::isAgentInventory() const
return model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID());
}
+bool LLInvFVBridge::isAgentInventoryRoot() const
+{
+ const LLInventoryModel* model = getInventoryModel();
+ if(!model) return false;
+ return gInventory.getRootFolderID() == mUUID;
+}
+
BOOL LLInvFVBridge::isCOFFolder() const
{
return LLAppearanceMgr::instance().getIsInCOF(mUUID);
@@ -2260,6 +2285,21 @@ const LLUUID& LLItemBridge::getThumbnailUUID() const
return LLUUID::null;
}
+bool LLItemBridge::isFavorite() const
+{
+ LLViewerInventoryItem* item = NULL;
+ LLInventoryModel* model = getInventoryModel();
+ if (model)
+ {
+ item = model->getItem(mUUID);
+ }
+ if (item)
+ {
+ return get_is_favorite(item);
+ }
+ return false;
+}
+
BOOL LLItemBridge::isItemPermissive() const
{
LLViewerInventoryItem* item = getItem();
@@ -2405,6 +2445,16 @@ const LLUUID& LLFolderBridge::getThumbnailUUID() const
return LLUUID::null;
}
+bool LLFolderBridge::isFavorite() const
+{
+ LLViewerInventoryCategory* cat = getCategory();
+ if (cat)
+ {
+ return cat->getIsFavorite();
+ }
+ return false;
+}
+
void LLFolderBridge::update()
{
// we know we have children but haven't fetched them (doesn't obey filter)
@@ -4387,6 +4437,15 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
items.push_back(std::string("Rename"));
items.push_back(std::string("thumbnail"));
+ if (cat->getIsFavorite())
+ {
+ items.push_back(std::string("Remove from Favorites"));
+ }
+ else
+ {
+ items.push_back(std::string("Add to Favorites"));
+ }
+
addDeleteContextMenuOptions(items, disabled_items);
// EXT-4030: disallow deletion of currently worn outfit
const LLViewerInventoryItem *base_outfit_link = LLAppearanceMgr::instance().getBaseOutfitLink();
@@ -8005,7 +8064,8 @@ void LLObjectBridgeAction::attachOrDetach()
}
else
{
- LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding.
+ static LLCachedControl<bool> inventory_linking(gSavedSettings, "InventoryAddAttachmentBehavior", false);
+ LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, inventory_linking()); // Don't replace if adding.
}
}
@@ -8042,7 +8102,7 @@ protected:
BOOL isItemInTrash() const;
// return true if the item is in agent inventory. if false, it
// must be lost or in the inventory library.
- BOOL isAgentInventory() const;
+ bool isAgentInventory() const;
void wearOnAvatar();
};
@@ -8053,7 +8113,7 @@ BOOL LLWearableBridgeAction::isItemInTrash() const
return mModel->isObjectDescendentOf(mUUID, trash_id);
}
-BOOL LLWearableBridgeAction::isAgentInventory() const
+bool LLWearableBridgeAction::isAgentInventory() const
{
if(!mModel) return FALSE;
if(gInventory.getRootFolderID() == mUUID) return TRUE;
@@ -8196,6 +8256,7 @@ void LLRecentItemsFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
buildContextMenuOptions(flags, items, disabled_items);
items.erase(std::remove(items.begin(), items.end(), std::string("New Folder")), items.end());
+ items.erase(std::remove(items.begin(), items.end(), std::string("New folder from selected")), items.end());
hide_context_entries(menu, items, disabled_items);
}
@@ -8230,6 +8291,51 @@ LLInvFVBridge* LLRecentInventoryBridgeBuilder::createBridge(
return new_listener;
}
+/************************************************************************/
+/* Favorites Inventory Panel related classes */
+/************************************************************************/
+void LLFavoritesFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
+{
+ // todo: consider things that should be disabled
+ menuentry_vec_t disabled_items, items;
+ buildContextMenuOptions(flags, items, disabled_items);
+
+ items.erase(std::remove(items.begin(), items.end(), std::string("New Folder")), items.end());
+ items.erase(std::remove(items.begin(), items.end(), std::string("New folder from selected")), items.end());
+
+ hide_context_entries(menu, items, disabled_items);
+}
+
+LLInvFVBridge* LLFavoritesInventoryBridgeBuilder::createBridge(
+ LLAssetType::EType asset_type,
+ LLAssetType::EType actual_asset_type,
+ LLInventoryType::EType inv_type,
+ LLInventoryPanel* inventory,
+ LLFolderViewModelInventory* view_model,
+ LLFolderView* root,
+ const LLUUID& uuid,
+ U32 flags /*= 0x00*/) const
+{
+ LLInvFVBridge* new_listener = NULL;
+ if (asset_type == LLAssetType::AT_CATEGORY
+ && actual_asset_type != LLAssetType::AT_LINK_FOLDER)
+ {
+ new_listener = new LLFavoritesFolderBridge(inv_type, inventory, root, uuid);
+ }
+ else
+ {
+ new_listener = LLInventoryFolderViewModelBuilder::createBridge(asset_type,
+ actual_asset_type,
+ inv_type,
+ inventory,
+ view_model,
+ root,
+ uuid,
+ flags);
+ }
+ return new_listener;
+}
+
LLFolderViewGroupedItemBridge::LLFolderViewGroupedItemBridge()
{
}
@@ -8240,7 +8346,7 @@ void LLFolderViewGroupedItemBridge::groupFilterContextMenu(folder_view_item_dequ
menuentry_vec_t disabled_items;
if (get_selection_item_uuids(selected_items, ids))
{
- if (!LLAppearanceMgr::instance().canAddWearables(ids) && canWearSelected(ids))
+ if (!LLAppearanceMgr::instance().canAddWearables(ids, false) && canWearSelected(ids))
{
disabled_items.push_back(std::string("Wearable And Object Wear"));
disabled_items.push_back(std::string("Wearable Add"));
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 460d501256..9a81d99b0d 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -86,6 +86,7 @@ public:
//--------------------------------------------------------------------
virtual const LLUUID& getUUID() const { return mUUID; }
virtual const LLUUID& getThumbnailUUID() const { return LLUUID::null; }
+ virtual bool isFavorite() const { return false; }
virtual void clearDisplayName() { mDisplayName.clear(); }
virtual void restoreItem() {}
virtual void restoreToWorld() {}
@@ -174,7 +175,8 @@ protected:
BOOL isLinkedObjectInTrash() const; // Is this obj or its baseobj in the trash?
BOOL isLinkedObjectMissing() const; // Is this a linked obj whose baseobj is not in inventory?
- BOOL isAgentInventory() const; // false if lost or in the inventory library
+ bool isAgentInventory() const; // false if lost or in the inventory library
+ bool isAgentInventoryRoot() const; // true if worn by agent
BOOL isCOFFolder() const; // true if COF or descendant of
BOOL isInboxFolder() const; // true if COF or descendant of marketplace inbox
@@ -259,6 +261,7 @@ public:
LLViewerInventoryItem* getItem() const;
virtual const LLUUID& getThumbnailUUID() const;
+ virtual bool isFavorite() const;
protected:
BOOL confirmRemoveItem(const LLSD& notification, const LLSD& response);
@@ -301,6 +304,7 @@ public:
virtual std::string getLabelSuffix() const;
virtual LLFontGL::StyleFlags getLabelStyle() const;
virtual const LLUUID& getThumbnailUUID() const;
+ virtual bool isFavorite() const;
void setShowDescendantsCount(bool show_count) {mShowDescendantsCount = show_count;}
@@ -752,6 +756,45 @@ public:
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Favorites Inventory Panel related classes
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+// Overridden version of the Inventory-Folder-View-Bridge for Folders
+class LLFavoritesFolderBridge : public LLFolderBridge
+{
+ friend class LLInvFVBridgeAction;
+public:
+ // Creates context menu for Folders related to Recent Inventory Panel.
+ // Uses base logic and than removes from visible items "New..." menu items.
+ LLFavoritesFolderBridge(LLInventoryType::EType type,
+ LLInventoryPanel* inventory,
+ LLFolderView* root,
+ const LLUUID& uuid) :
+ LLFolderBridge(inventory, root, uuid)
+ {
+ mInvType = type;
+ }
+ /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags);
+};
+
+// Bridge builder to create Inventory-Folder-View-Bridge for Recent Inventory Panel
+class LLFavoritesInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder
+{
+public:
+ LLFavoritesInventoryBridgeBuilder() {}
+ // Overrides FolderBridge for Recent Inventory Panel.
+ // It use base functionality for bridges other than FolderBridge.
+ virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type,
+ LLAssetType::EType actual_asset_type,
+ LLInventoryType::EType inv_type,
+ LLInventoryPanel* inventory,
+ LLFolderViewModelInventory* view_model,
+ LLFolderView* root,
+ const LLUUID& uuid,
+ U32 flags = 0x00) const;
+};
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Marketplace Inventory Panel related classes
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index b9ce90ff7b..43d4c3110f 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -64,6 +64,7 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p)
mFilterUUID(p.uuid),
mFilterLinks(p.links),
mFilterThumbnails(p.thumbnails),
+ mFilterFavorites(p.favorites),
mSearchVisibility(p.search_visibility)
{
}
@@ -159,6 +160,7 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item)
passed = passed && checkAgainstCreator(listener);
passed = passed && checkAgainstSearchVisibility(listener);
+ passed = passed && checkAgainstFilterFavorites(listener->getUUID());
passed = passed && checkAgainstFilterThumbnails(listener->getUUID());
return passed;
@@ -221,6 +223,19 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
return false;
}
+ const LLViewerInventoryCategory* cat = gInventory.getCategory(folder_id);
+ if (cat && cat->getIsFavorite())
+ {
+ if (mFilterOps.mFilterFavorites == FILTER_ONLY_FAVORITES)
+ {
+ return true;
+ }
+ if (mFilterOps.mFilterFavorites == FILTER_EXCLUDE_FAVORITES)
+ {
+ return false;
+ }
+ }
+
// Marketplace folder filtering
const U32 filterTypes = mFilterOps.mFilterTypes;
const U32 marketplace_filter = FILTERTYPE_MARKETPLACE_ACTIVE | FILTERTYPE_MARKETPLACE_INACTIVE |
@@ -273,6 +288,16 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
}
}
+ if (filterTypes & FILTERTYPE_NO_TRASH_ITEMS)
+ {
+ const LLUUID trash_uuid = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
+ // If not a descendant of the marketplace listings root, then the nesting depth is -1 by definition
+ if (gInventory.isObjectDescendentOf(folder_id, trash_uuid))
+ {
+ return false;
+ }
+ }
+
// show folder links
LLViewerInventoryItem* item = gInventory.getItem(folder_id);
if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER)
@@ -594,6 +619,24 @@ bool LLInventoryFilter::checkAgainstFilterThumbnails(const LLUUID& object_id) co
return true;
}
+bool LLInventoryFilter::checkAgainstFilterFavorites(const LLUUID& object_id) const
+{
+ const LLInventoryObject* object = gInventory.getObject(object_id);
+ if (!object) return true;
+
+
+ if (mFilterOps.mFilterFavorites != FILTER_INCLUDE_FAVORITES)
+ {
+ bool is_favorite = get_is_favorite(object);
+ if (is_favorite && (mFilterOps.mFilterFavorites == FILTER_EXCLUDE_FAVORITES))
+ return false;
+ if (!is_favorite && (mFilterOps.mFilterFavorites == FILTER_ONLY_FAVORITES))
+ return false;
+ }
+
+ return true;
+}
+
bool LLInventoryFilter::checkAgainstCreator(const LLFolderViewModelItemInventory* listener) const
{
if (!listener) return TRUE;
@@ -791,6 +834,32 @@ void LLInventoryFilter::setFilterThumbnails(U64 filter_thumbnails)
mFilterOps.mFilterThumbnails = filter_thumbnails;
}
+void LLInventoryFilter::setFilterFavorites(U64 filter_favorites)
+{
+ if (mFilterOps.mFilterFavorites != filter_favorites)
+ {
+ if (mFilterOps.mFilterFavorites == FILTER_EXCLUDE_FAVORITES
+ && filter_favorites == FILTER_ONLY_FAVORITES)
+ {
+ setModified(FILTER_RESTART);
+ }
+ else if (mFilterOps.mFilterFavorites == FILTER_ONLY_FAVORITES
+ && filter_favorites == FILTER_EXCLUDE_FAVORITES)
+ {
+ setModified(FILTER_RESTART);
+ }
+ else if (mFilterOps.mFilterFavorites == FILTER_INCLUDE_FAVORITES)
+ {
+ setModified(FILTER_MORE_RESTRICTIVE);
+ }
+ else
+ {
+ setModified(FILTER_LESS_RESTRICTIVE);
+ }
+ }
+ mFilterOps.mFilterFavorites = filter_favorites;
+}
+
void LLInventoryFilter::setFilterEmptySystemFolders()
{
mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS;
@@ -903,6 +972,11 @@ void LLInventoryFilter::toggleSearchVisibilityLibrary()
}
}
+void LLInventoryFilter::setFilterNoTrashFolder()
+{
+ mFilterOps.mFilterTypes |= FILTERTYPE_NO_TRASH_ITEMS;
+}
+
void LLInventoryFilter::setFilterNoMarketplaceFolder()
{
mFilterOps.mFilterTypes |= FILTERTYPE_NO_MARKETPLACE_ITEMS;
@@ -1596,6 +1670,11 @@ U64 LLInventoryFilter::getFilterThumbnails() const
return mFilterOps.mFilterThumbnails;
}
+U64 LLInventoryFilter::getFilterFavorites() const
+{
+ return mFilterOps.mFilterFavorites;
+}
+
bool LLInventoryFilter::hasFilterString() const
{
return mFilterSubString.size() > 0;
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index e45375deca..3538b013fb 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -60,6 +60,7 @@ public:
FILTERTYPE_NO_MARKETPLACE_ITEMS = 0x1 << 10, // pass iff folder is not under the marketplace
FILTERTYPE_WORN = 0x1 << 11, // pass if item is worn
FILTERTYPE_SETTINGS = 0x1 << 12, // pass if the item is a settings object
+ FILTERTYPE_NO_TRASH_ITEMS = 0x1 << 13, // pass iff folder is not under the marketplace
};
enum EFilterDateDirection
@@ -82,6 +83,13 @@ public:
FILTER_ONLY_THUMBNAILS
};
+ enum EFilterFavorite
+ {
+ FILTER_INCLUDE_FAVORITES,
+ FILTER_EXCLUDE_FAVORITES,
+ FILTER_ONLY_FAVORITES
+ };
+
enum ESortOrderType
{
SO_NAME = 0, // Sort inventory by name
@@ -148,6 +156,7 @@ public:
Optional<PermissionMask> permissions;
Optional<EFilterCreatorType> creator_type;
Optional<EFilterThumbnail> thumbnails;
+ Optional<EFilterFavorite> favorites;
Params()
: types("filter_types", FILTERTYPE_OBJECT),
@@ -155,6 +164,7 @@ public:
wearable_types("wearable_types", 0xffffFFFFffffFFFFULL),
settings_types("settings_types", 0xffffFFFFffffFFFFULL),
thumbnails("thumbnails", FILTER_INCLUDE_THUMBNAILS),
+ favorites("favorites", FILTER_INCLUDE_FAVORITES),
category_types("category_types", 0xffffFFFFffffFFFFULL),
links("links", FILTERLINK_INCLUDE_LINKS),
search_visibility("search_visibility", 0xFFFFFFFF),
@@ -176,6 +186,7 @@ public:
mFilterWearableTypes,
mFilterSettingsTypes, // for _SETTINGS
mFilterThumbnails,
+ mFilterFavorites,
mFilterLinks,
mFilterCategoryTypes; // For _CATEGORY
LLUUID mFilterUUID; // for UUID
@@ -219,6 +230,7 @@ public:
U64 getFilterSettingsTypes() const;
U64 getSearchVisibilityTypes() const;
U64 getFilterThumbnails() const;
+ U64 getFilterFavorites() const;
bool isFilterObjectTypesWith(LLInventoryType::EType t) const;
void setFilterObjectTypes(U64 types);
@@ -232,8 +244,10 @@ public:
void setFilterMarketplaceInactiveFolders();
void setFilterMarketplaceUnassociatedFolders();
void setFilterMarketplaceListingFolders(bool select_only_listing_folders);
+ void setFilterNoTrashFolder();
void setFilterNoMarketplaceFolder();
void setFilterThumbnails(U64 filter_thumbnails);
+ void setFilterFavorites(U64 filter_favorites);
void updateFilterTypes(U64 types, U64& current_types);
void setSearchType(ESearchType type);
ESearchType getSearchType() { return mSearchType; }
@@ -338,6 +352,7 @@ public:
LLInventoryFilter& operator =(const LLInventoryFilter& other);
bool checkAgainstFilterThumbnails(const LLUUID& object_id) const;
+ bool checkAgainstFilterFavorites(const LLUUID& object_id) const;
private:
bool areDateLimitsSet();
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 909dea050e..ca27ea8b3f 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -2423,6 +2423,123 @@ void ungroup_folder_items(const LLUUID& folder_id)
gInventory.notifyObservers();
}
+class LLUpdateFavorite : public LLInventoryCallback
+{
+public:
+ LLUpdateFavorite(const LLUUID& inv_item_id)
+ : mInvItemID(inv_item_id)
+ {}
+ /* virtual */ void fire(const LLUUID& inv_item_id) override
+ {
+ gInventory.addChangedMask(LLInventoryObserver::UPDATE_FAVORITE, mInvItemID);
+
+ LLInventoryModel::item_array_t items;
+ LLInventoryModel::cat_array_t cat_array;
+ LLLinkedItemIDMatches matches(mInvItemID);
+ gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
+ cat_array,
+ items,
+ LLInventoryModel::INCLUDE_TRASH,
+ matches);
+
+ std::set<LLUUID> link_ids;
+ for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); ++it)
+ {
+ LLPointer<LLViewerInventoryItem> item = *it;
+
+ gInventory.addChangedMask(LLInventoryObserver::UPDATE_FAVORITE, item->getUUID());
+ }
+
+ gInventory.notifyObservers();
+ }
+private:
+ LLUUID mInvItemID;
+};
+
+void favorite_send(LLInventoryObject* obj, const LLUUID& obj_id, bool favorite)
+{
+ LLSD val;
+ if (favorite)
+ {
+ val = true;
+ } // else leave undefined to remove unneeded metadata field
+
+ LLSD updates;
+ if (favorite)
+ {
+ updates["favorite"] = LLSD().with("toggled", true);
+ }
+ else
+ {
+ updates["favorite"] = LLSD();
+ }
+
+ LLPointer<LLInventoryCallback> cb = new LLUpdateFavorite(obj_id);
+
+ LLViewerInventoryCategory* view_folder = dynamic_cast<LLViewerInventoryCategory*>(obj);
+ if (view_folder)
+ {
+ update_inventory_category(obj_id, updates, cb);
+ }
+ LLViewerInventoryItem* view_item = dynamic_cast<LLViewerInventoryItem*>(obj);
+ if (view_item)
+ {
+ update_inventory_item(obj_id, updates, cb);
+ }
+}
+
+bool get_is_favorite(const LLInventoryObject* object)
+{
+ if (object->getIsLinkType())
+ {
+ LLInventoryObject* obj = gInventory.getObject(object->getLinkedUUID());
+ return obj && obj->getIsFavorite();
+ }
+
+ return object->getIsFavorite();
+}
+
+bool get_is_favorite(const LLUUID& obj_id)
+{
+ LLInventoryObject* object = gInventory.getObject(obj_id);
+ if (object && object->getIsLinkType())
+ {
+ LLInventoryObject* obj = gInventory.getObject(object->getLinkedUUID());
+ return obj && obj->getIsFavorite();
+ }
+
+ return object->getIsFavorite();
+}
+
+void set_favorite(const LLUUID& obj_id, bool favorite)
+{
+ LLInventoryObject* obj = gInventory.getObject(obj_id);
+
+ if (obj && obj->getIsLinkType())
+ {
+ obj = gInventory.getObject(obj->getLinkedUUID());
+ }
+
+ if (obj && obj->getIsFavorite() != favorite)
+ {
+ favorite_send(obj, obj->getUUID(), favorite);
+ }
+}
+
+void toggle_favorite(const LLUUID& obj_id)
+{
+ LLInventoryObject* obj = gInventory.getObject(obj_id);
+ if (obj && obj->getIsLinkType())
+ {
+ obj = gInventory.getObject(obj->getLinkedUUID());
+ }
+
+ if (obj)
+ {
+ favorite_send(obj, obj->getUUID(), !obj->getIsFavorite());
+ }
+}
+
std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id)
{
if (model)
@@ -2704,6 +2821,20 @@ bool LLIsTypeWithPermissions::operator()(LLInventoryCategory* cat, LLInventoryIt
return FALSE;
}
+bool LLFavoritesCollector::operator()(LLInventoryCategory* cat,
+ LLInventoryItem* item)
+{
+ if (item && item->getIsFavorite())
+ {
+ return true;
+ }
+ if (cat && cat->getIsFavorite())
+ {
+ return true;
+ }
+ return false;
+}
+
bool LLBuddyCollector::operator()(LLInventoryCategory* cat,
LLInventoryItem* item)
{
@@ -3458,6 +3589,20 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
ungroup_folder_items(*ids.begin());
}
}
+ else if ("add_to_favorites" == action)
+ {
+ for (const LLUUID& id : ids)
+ {
+ set_favorite(id, true);
+ }
+ }
+ else if ("remove_from_favorites" == action)
+ {
+ for (const LLUUID& id : ids)
+ {
+ set_favorite(id, false);
+ }
+ }
else
{
std::set<LLFolderViewItem*>::iterator set_iter;
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index f8403f890c..fdb6fc77d7 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -116,6 +116,10 @@ bool can_move_to_my_outfits(LLInventoryModel* model, LLInventoryCategory* inv_ca
std::string get_localized_folder_name(LLUUID cat_uuid);
void new_folder_window(const LLUUID& folder_id);
void ungroup_folder_items(const LLUUID& folder_id);
+bool get_is_favorite(const LLInventoryObject* object);
+bool get_is_favorite(const LLUUID& obj_id);
+void set_favorite(const LLUUID& obj_id, bool favorite);
+void toggle_favorite(const LLUUID& obj_id);
std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id);
std::string get_searchable_creator_name(LLInventoryModel* model, const LLUUID& item_id);
std::string get_searchable_UUID(LLInventoryModel* model, const LLUUID& item_id);
@@ -326,6 +330,18 @@ protected:
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Class LLFavoritesCollector
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+class LLFavoritesCollector : public LLInventoryCollectFunctor
+{
+public:
+ LLFavoritesCollector() {}
+ virtual ~LLFavoritesCollector() {}
+ virtual bool operator()(LLInventoryCategory* cat,
+ LLInventoryItem* item);
+};
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLBuddyCollector
//
// Simple class that collects calling cards that are not null, and not
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 708e6be73e..a6bedc8854 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -635,7 +635,7 @@ void LLInventoryGallery::removeFromLastRow(LLInventoryGalleryItem* item)
mItemPanels.pop_back();
}
-LLInventoryGalleryItem* LLInventoryGallery::buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, time_t creation_date, bool is_link, bool is_worn)
+LLInventoryGalleryItem* LLInventoryGallery::buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, time_t creation_date, bool is_link, bool is_worn, bool is_favorite)
{
LLInventoryGalleryItem::Params giparams;
giparams.visible = true;
@@ -646,6 +646,7 @@ LLInventoryGalleryItem* LLInventoryGallery::buildGalleryItem(std::string name, L
gitem->setUUID(item_id);
gitem->setGallery(this);
gitem->setType(type, inventory_type, flags, is_link);
+ gitem->setFavorite(is_favorite);
gitem->setLoadImmediately(mLoadThumbnailsImmediately);
gitem->setThumbnail(thumbnail_id);
gitem->setWorn(is_worn);
@@ -928,8 +929,19 @@ bool LLInventoryGallery::updateAddedItem(LLUUID item_id)
}
bool res = false;
-
- LLInventoryGalleryItem* item = buildGalleryItem(name, item_id, obj->getType(), thumbnail_id, inventory_type, misc_flags, obj->getCreationDate(), obj->getIsLinkType(), is_worn);
+ bool is_favorite = get_is_favorite(obj);
+
+ LLInventoryGalleryItem* item = buildGalleryItem(
+ name,
+ item_id,
+ obj->getType(),
+ thumbnail_id,
+ inventory_type,
+ misc_flags,
+ obj->getCreationDate(),
+ obj->getIsLinkType(),
+ is_worn,
+ is_favorite);
mItemMap.insert(LLInventoryGallery::gallery_item_map_t::value_type(item_id, item));
if (mGalleryCreated)
{
@@ -966,7 +978,7 @@ void LLInventoryGallery::updateRemovedItem(LLUUID item_id)
mItemBuildQuery.erase(item_id);
}
-void LLInventoryGallery::updateChangedItemName(LLUUID item_id, std::string name)
+void LLInventoryGallery::updateChangedItemData(LLUUID item_id, std::string name, bool is_favorite)
{
gallery_item_map_t::iterator iter = mItemMap.find(item_id);
if (iter != mItemMap.end())
@@ -975,6 +987,7 @@ void LLInventoryGallery::updateChangedItemName(LLUUID item_id, std::string name)
if (item)
{
item->setItemName(name);
+ item->setFavorite(is_favorite);
}
}
}
@@ -1926,21 +1939,21 @@ void LLInventoryGallery::onDelete(const LLSD& notification, const LLSD& response
{
worn.push_back(item->getUUID());
cat_has_worn = true;
- }
- }
+ }
}
+ }
if (cat_has_worn)
{
cat_deletion_list.push_back(obj_id);
}
- else
- {
+ else
+ {
gInventory.removeCategory(obj_id);
}
}
LLViewerInventoryItem* item = gInventory.getItem(obj_id);
if (item)
- {
+ {
if (has_worn && get_is_item_worn(item))
{
worn.push_back(item->getUUID());
@@ -2036,16 +2049,16 @@ void LLInventoryGallery::deleteSelection()
}
else
{
- if (!LLInventoryAction::sDeleteConfirmationDisplayed) // ask for the confirmation at least once per session
- {
- LLNotifications::instance().setIgnored("DeleteItems", false);
- LLInventoryAction::sDeleteConfirmationDisplayed = true;
- }
-
- LLSD args;
- args["QUESTION"] = LLTrans::getString("DeleteItem");
- LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLInventoryGallery::onDelete, _1, _2, mSelectedItemIDs));
+ if (!LLInventoryAction::sDeleteConfirmationDisplayed) // ask for the confirmation at least once per session
+ {
+ LLNotifications::instance().setIgnored("DeleteItems", false);
+ LLInventoryAction::sDeleteConfirmationDisplayed = true;
}
+
+ LLSD args;
+ args["QUESTION"] = LLTrans::getString("DeleteItem");
+ LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLInventoryGallery::onDelete, _1, _2, mSelectedItemIDs));
+}
}
bool LLInventoryGallery::canDeleteSelection()
@@ -2288,7 +2301,7 @@ void LLInventoryGallery::refreshList(const LLUUID& category_id)
return;
}
- updateChangedItemName(*items_iter, obj->getName());
+ updateChangedItemData(*items_iter, obj->getName(), get_is_favorite(obj));
mNeedsArrange = true;
}
@@ -2802,6 +2815,14 @@ void LLInventoryGalleryItem::setType(LLAssetType::EType type, LLInventoryType::E
getChild<LLIconCtrl>("link_overlay")->setVisible(is_link);
}
+void LLInventoryGalleryItem::setFavorite(bool is_favorite)
+{
+ getChild<LLIconCtrl>("fav_icon")->setVisible(is_favorite);
+ static const LLUIColor text_color = LLUIColorTable::instance().getColor("LabelTextColor", LLColor4::white);
+ static const LLUIColor favorite_color = LLUIColorTable::instance().getColor("InventoryFavoriteColor", LLColor4::white);
+ mNameText->setReadOnlyColor(is_favorite ? favorite_color : text_color);
+}
+
void LLInventoryGalleryItem::setThumbnail(LLUUID id)
{
mDefaultImage = id.isNull();
diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h
index 51444d24b0..f8b70c7930 100644
--- a/indra/newview/llinventorygallery.h
+++ b/indra/newview/llinventorygallery.h
@@ -102,7 +102,7 @@ public:
void getCurrentCategories(uuid_vec_t& vcur);
bool updateAddedItem(LLUUID item_id); // returns true if added item is visible
void updateRemovedItem(LLUUID item_id);
- void updateChangedItemName(LLUUID item_id, std::string name);
+ void updateChangedItemData(LLUUID item_id, std::string name, bool is_favorite);
void updateItemThumbnail(LLUUID item_id);
void updateWornItem(LLUUID item_id, bool is_worn);
@@ -226,7 +226,7 @@ private:
bool updateRowsIfNeeded();
void updateGalleryWidth();
- LLInventoryGalleryItem* buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, time_t creation_date, bool is_link, bool is_worn);
+ LLInventoryGalleryItem* buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, time_t creation_date, bool is_link, bool is_worn, bool is_favorite);
void buildGalleryPanel(int row_count);
void reshapeGalleryPanel(int row_count);
@@ -341,6 +341,7 @@ public:
void setHidden(bool hidden) {mHidden = hidden;}
void setType(LLAssetType::EType type, LLInventoryType::EType inventory_type, U32 flags, bool is_link);
+ void setFavorite(bool is_favorite);
LLAssetType::EType getAssetType() { return mType; }
void setThumbnail(LLUUID id);
void setGallery(LLInventoryGallery* gallery) { mGallery = gallery; }
diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp
index 77bdb4d1f5..13436819a5 100644
--- a/indra/newview/llinventorygallerymenu.cpp
+++ b/indra/newview/llinventorygallerymenu.cpp
@@ -186,6 +186,20 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata)
{
ungroup_folder_items(mUUIDs.front());
}
+ else if ("add_to_favorites" == action)
+ {
+ for (const LLUUID& id : mUUIDs)
+ {
+ set_favorite(id, true);
+ }
+ }
+ else if ("remove_from_favorites" == action)
+ {
+ for (const LLUUID& id : mUUIDs)
+ {
+ set_favorite(id, false);
+ }
+ }
else if ("take_off" == action || "detach" == action)
{
for (LLUUID& selected_id : mUUIDs)
@@ -519,6 +533,18 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
items.push_back(std::string("New Outfit"));
}
+ if (!is_trash && !is_in_trash && gInventory.getRootFolderID() != selected_id)
+ {
+ if (get_is_favorite(obj))
+ {
+ items.push_back(std::string("Remove from Favorites"));
+ }
+ else
+ {
+ items.push_back(std::string("Add to Favorites"));
+ }
+ }
+
items.push_back(std::string("Subfolder Separator"));
if (!is_system_folder && !isRootFolder())
{
@@ -564,6 +590,17 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
if(is_agent_inventory)
{
items.push_back(std::string("Cut"));
+ if (!is_in_trash)
+ {
+ if (get_is_favorite(obj))
+ {
+ items.push_back(std::string("Remove from Favorites"));
+ }
+ else
+ {
+ items.push_back(std::string("Add to Favorites"));
+ }
+ }
if (!is_link || !is_cof || !get_is_item_worn(selected_id))
{
items.push_back(std::string("Delete"));
@@ -703,6 +740,15 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
disabled_items.push_back(std::string("upload_options"));
disabled_items.push_back(std::string("upload_def"));
}
+
+ if (get_is_favorite(obj))
+ {
+ items.push_back(std::string("Remove from Favorites"));
+ }
+ else if (is_agent_inventory)
+ {
+ items.push_back(std::string("Add to Favorites"));
+ }
}
hide_context_entries(*menu, items, disabled_items);
diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp
index 9e936eee5b..63d3117e77 100644
--- a/indra/newview/llinventoryitemslist.cpp
+++ b/indra/newview/llinventoryitemslist.cpp
@@ -115,7 +115,7 @@ void LLInventoryItemsList::doIdle()
{
if (mRefreshState == REFRESH_COMPLETE) return;
- if (isInVisibleChain() || mForceRefresh )
+ if (isInVisibleChain() || mForceRefresh || !getFilterSubString().empty())
{
refresh();
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 65b8bc9e2c..eeb0232890 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -78,7 +78,7 @@
// Increment this if the inventory contents change in a non-backwards-compatible way.
// For viewer 2, the addition of link items makes a pre-viewer-2 cache incorrect.
-const S32 LLInventoryModel::sCurrentInvCacheVersion = 3;
+const S32 LLInventoryModel::sCurrentInvCacheVersion = 4;
BOOL LLInventoryModel::sFirstTimeInViewer2 = TRUE;
S32 LLInventoryModel::sPendingSystemFolders = 0;
@@ -1744,7 +1744,7 @@ void LLInventoryModel::changeItemParent(LLViewerInventoryItem* item,
<< " from " << make_inventory_info(item->getParentUUID())
<< " to " << make_inventory_info(new_parent_id) << LL_ENDL;
- LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(), -1);
+ LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
accountForUpdate(old_folder);
LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1, false);
accountForUpdate(new_folder);
@@ -2540,7 +2540,7 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const
cat->setDescendentCount(descendents_actual);
if (update.mChangeVersion)
{
- cat->setVersion(++version);
+ cat->setVersion(++version);
}
LL_DEBUGS(LOG_INV) << "accounted: '" << cat->getName() << "' "
<< version << " with " << descendents_actual
@@ -2776,8 +2776,9 @@ bool LLInventoryModel::loadSkeleton(
cached_ids.insert(tcat->getUUID());
// At the moment download does not provide a thumbnail
- // uuid, use the one from cache
+ // uuid or favorite, use values from cache
tcat->setThumbnailUUID(cat->getThumbnailUUID());
+ tcat->setFavorite(cat->getIsFavorite());
}
}
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index 1c76c154a1..130c23475d 100644
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -749,6 +749,13 @@ void LLInventoryCategoriesObserver::changed(U32 mask)
cat_changed = true;
}
+ bool is_favorite = category->getIsFavorite();
+ if (cat_data.mIsFavorite != is_favorite)
+ {
+ cat_data.mIsFavorite = is_favorite;
+ cat_changed = true;
+ }
+
// If anything has changed above, fire the callback.
if (cat_changed)
cat_data.mCallback();
@@ -766,6 +773,7 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
S32 version = LLViewerInventoryCategory::VERSION_UNKNOWN;
S32 current_num_known_descendents = LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN;
bool can_be_added = true;
+ bool favorite = false;
LLUUID thumbnail_id;
LLViewerInventoryCategory* category = gInventory.getCategory(cat_id);
@@ -779,6 +787,7 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
// to a category have been made.
version = category->getVersion();
thumbnail_id = category->getThumbnailUUID();
+ favorite = category->getIsFavorite();
LLInventoryModel::cat_array_t* cats;
LLInventoryModel::item_array_t* items;
@@ -804,11 +813,11 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
if(init_name_hash)
{
digest_t item_name_hash = gInventory.hashDirectDescendentNames(cat_id);
- mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, cb, version, current_num_known_descendents,item_name_hash)));
+ mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, favorite, cb, version, current_num_known_descendents,item_name_hash)));
}
else
{
- mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, cb, version, current_num_known_descendents)));
+ mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, favorite, cb, version, current_num_known_descendents)));
}
}
@@ -821,25 +830,37 @@ void LLInventoryCategoriesObserver::removeCategory(const LLUUID& cat_id)
}
LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData(
- const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents)
+ const LLUUID& cat_id,
+ const LLUUID& thumbnail_id,
+ bool is_favorite,
+ callback_t cb,
+ S32 version,
+ S32 num_descendents)
: mCatID(cat_id)
, mCallback(cb)
, mVersion(version)
, mDescendentsCount(num_descendents)
, mThumbnailId(thumbnail_id)
+ , mIsFavorite(is_favorite)
, mIsNameHashInitialized(false)
{
}
LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData(
- const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents, const digest_t& name_hash)
+ const LLUUID& cat_id,
+ const LLUUID& thumbnail_id,
+ bool is_favorite,
+ callback_t cb, S32 version,
+ S32 num_descendents,
+ const digest_t& name_hash)
: mCatID(cat_id)
, mCallback(cb)
, mVersion(version)
, mDescendentsCount(num_descendents)
, mThumbnailId(thumbnail_id)
+ , mIsFavorite(is_favorite)
, mIsNameHashInitialized(true)
, mItemNameHash(name_hash)
{
diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h
index 43bcf14d89..e992655685 100644
--- a/indra/newview/llinventoryobserver.h
+++ b/indra/newview/llinventoryobserver.h
@@ -60,6 +60,7 @@ public:
CREATE = 512, // With ADD, item has just been created.
// unfortunately a particular message is still associated with some unique semantics.
UPDATE_CREATE = 1024, // With ADD, item added via UpdateCreateInventoryItem
+ UPDATE_FAVORITE = 2048, // With ADD, item added via UpdateCreateInventoryItem
ALL = 0xffffffff
};
LLInventoryObserver();
@@ -276,12 +277,26 @@ protected:
typedef LLUUID digest_t; // To clarify the actual usage of this "UUID"
struct LLCategoryData
{
- LLCategoryData(const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents);
- LLCategoryData(const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents, const digest_t& name_hash);
+ LLCategoryData(
+ const LLUUID& cat_id,
+ const LLUUID& thumbnail_id,
+ bool is_favorite,
+ callback_t cb,
+ S32 version,
+ S32 num_descendents);
+ LLCategoryData(
+ const LLUUID& cat_id,
+ const LLUUID& thumbnail_id,
+ bool is_favorite,
+ callback_t cb,
+ S32 version,
+ S32 num_descendents,
+ const digest_t& name_hash);
callback_t mCallback;
S32 mVersion;
S32 mDescendentsCount;
digest_t mItemNameHash;
+ bool mIsFavorite;
bool mIsNameHashInitialized;
LLUUID mCatID;
LLUUID mThumbnailId;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index f1471e81c7..bc5f52dc4f 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -55,11 +55,13 @@
#include "llviewerfoldertype.h"
#include "llvoavatarself.h"
+class LLInventoryFavoritesItemsPanel;
class LLInventoryRecentItemsPanel;
class LLAssetFilteredInventoryPanel;
static LLDefaultChildRegistry::Register<LLInventoryPanel> r("inventory_panel");
static LLDefaultChildRegistry::Register<LLInventoryRecentItemsPanel> t_recent_inventory_panel("recent_inventory_panel");
+static LLDefaultChildRegistry::Register<LLInventoryFavoritesItemsPanel> t_favorites_inventory_panel("favorites_inventory_panel");
static LLDefaultChildRegistry::Register<LLAssetFilteredInventoryPanel> t_asset_filtered_inv_panel("asset_filtered_inv_panel");
const std::string LLInventoryPanel::DEFAULT_SORT_ORDER = std::string("InventorySortOrder");
@@ -563,7 +565,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
view_item->refresh();
}
LLFolderViewFolder* parent = view_item->getParentFolder();
- if(parent)
+ if(parent && parent->getViewModelItem())
{
parent->getViewModelItem()->dirtyDescendantsFilter();
}
@@ -614,12 +616,25 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
// Sort the folder.
if (mask & LLInventoryObserver::SORT)
{
- if (view_folder)
+ if (view_folder && view_folder->getViewModelItem())
{
view_folder->getViewModelItem()->requestSort();
}
}
+ if (mask & LLInventoryObserver::UPDATE_FAVORITE)
+ {
+ if (view_item)
+ {
+ view_item->refresh();
+ LLFolderViewFolder* parent = view_item->getParentFolder();
+ if (parent)
+ {
+ parent->updateHasFavorites(get_is_favorite(model_item));
+ }
+ }
+ }
+
// We don't typically care which of these masks the item is actually flagged with, since the masks
// may not be accurate (e.g. in the main inventory panel, I move an item from My Inventory into
// Landmarks; this is a STRUCTURE change for that panel but is an ADD change for the Landmarks
@@ -648,6 +663,16 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
setSelection(item_id, FALSE);
}
updateFolderLabel(model_item->getParentUUID());
+
+ if (get_is_favorite(model_item))
+ {
+ LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID());
+ if (new_parent)
+ {
+ new_parent->updateHasFavorites(true);
+ }
+ }
+
}
//////////////////////////////
@@ -659,7 +684,8 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
// Don't process the item if it is the root
if (old_parent)
{
- LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(old_parent->getViewModelItem());
+ LLFolderViewModelItem* old_parent_vmi = old_parent->getViewModelItem();
+ LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(old_parent_vmi);
LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID());
// Item has been moved.
if (old_parent != new_parent)
@@ -693,7 +719,16 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
{
updateFolderLabel(viewmodel_folder->getUUID());
}
- old_parent->getViewModelItem()->dirtyDescendantsFilter();
+ if (old_parent_vmi)
+ {
+ old_parent_vmi->dirtyDescendantsFilter();
+ }
+
+ if (view_item->isFavorite())
+ {
+ old_parent->updateHasFavorites(false); // favorite was removed
+ new_parent->updateHasFavorites(true); // favorite was added
+ }
}
}
}
@@ -709,11 +744,19 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
view_item->destroyView();
if(parent)
{
- parent->getViewModelItem()->dirtyDescendantsFilter();
- LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(parent->getViewModelItem());
- if(viewmodel_folder)
+ LLFolderViewModelItem* parent_wmi = parent->getViewModelItem();
+ if (parent_wmi)
{
- updateFolderLabel(viewmodel_folder->getUUID());
+ parent_wmi->dirtyDescendantsFilter();
+ LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(parent_wmi);
+ if (viewmodel_folder)
+ {
+ updateFolderLabel(viewmodel_folder->getUUID());
+ }
+ }
+ if (view_item->isFavorite())
+ {
+ parent->updateHasFavorites(false); // favorite was removed
}
}
}
@@ -832,7 +875,23 @@ void LLInventoryPanel::idle(void* user_data)
bool in_visible_chain = panel->isInVisibleChain();
- if (!panel->mBuildViewsQueue.empty())
+ if (!panel->mBuildRootQueue.empty())
+ {
+ const F64 max_time = in_visible_chain ? 0.006f : 0.001f; // 6 ms
+ F64 curent_time = LLTimer::getTotalSeconds();
+ panel->mBuildViewsEndTime = curent_time + max_time;
+
+ while (curent_time < panel->mBuildViewsEndTime
+ && !panel->mBuildRootQueue.empty())
+ {
+ LLUUID item_id = panel->mBuildRootQueue.back();
+ panel->mBuildRootQueue.pop_back();
+ panel->findAndInitRootContent(item_id);
+
+ curent_time = LLTimer::getTotalSeconds();
+ }
+ }
+ else if (!panel->mBuildViewsQueue.empty())
{
const F64 max_time = in_visible_chain ? 0.006f : 0.001f; // 6 ms
F64 curent_time = LLTimer::getTotalSeconds();
@@ -914,20 +973,9 @@ void LLInventoryPanel::initializeViews(F64 max_time)
mBuildViewsEndTime = curent_time + max_time;
// init everything
- LLUUID root_id = getRootFolderID();
- if (root_id.notNull())
- {
- buildNewViews(getRootFolderID());
- }
- else
- {
- // Default case: always add "My Inventory" root first, "Library" root second
- // If we run out of time, this still should create root folders
- buildNewViews(gInventory.getRootFolderID()); // My Inventory
- buildNewViews(gInventory.getLibraryRootFolderID()); // Library
- }
+ initRootContent();
- if (mBuildViewsQueue.empty())
+ if (mBuildViewsQueue.empty() && mBuildRootQueue.empty())
{
mViewsInitialized = VIEWS_INITIALIZED;
}
@@ -958,6 +1006,22 @@ void LLInventoryPanel::initializeViews(F64 max_time)
}
}
+void LLInventoryPanel::initRootContent()
+{
+ LLUUID root_id = getRootFolderID();
+ if (root_id.notNull())
+ {
+ buildNewViews(getRootFolderID());
+ }
+ else
+ {
+ // Default case: always add "My Inventory" root first, "Library" root second
+ // If we run out of time, this still should create root folders
+ buildNewViews(gInventory.getRootFolderID()); // My Inventory
+ buildNewViews(gInventory.getLibraryRootFolderID()); // Library
+ }
+}
+
LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop)
{
@@ -2176,6 +2240,247 @@ LLInventoryRecentItemsPanel::LLInventoryRecentItemsPanel( const Params& params)
mInvFVBridgeBuilder = &RECENT_ITEMS_BUILDER;
}
+/************************************************************************/
+/* Favorites Inventory Panel related class */
+/************************************************************************/
+static const LLFavoritesInventoryBridgeBuilder FAVORITES_BUILDER;
+class LLInventoryFavoritesItemsPanel : public LLInventoryPanel
+{
+public:
+ struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
+ {};
+
+ void initFromParams(const Params& p)
+ {
+ LLInventoryPanel::initFromParams(p);
+ // turn off trash
+ getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() | (1ULL << LLFolderType::FT_TRASH));
+ getFilter().setFilterNoTrashFolder();
+ // turn off marketplace for favorites
+ getFilter().setFilterNoMarketplaceFolder();
+ }
+
+ void removeItemID(const LLUUID& id) override;
+
+protected:
+ LLInventoryFavoritesItemsPanel(const Params&);
+ friend class LLUICtrlFactory;
+
+ void findAndInitRootContent(const LLUUID& folder_id) override;
+ void initRootContent() override;
+
+ bool removeFavorite(const LLUUID& id, const LLInventoryObject* model_item);
+ void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override;
+
+ std::set<LLUUID> mRootContentIDs;
+};
+
+LLInventoryFavoritesItemsPanel::LLInventoryFavoritesItemsPanel(const Params& params)
+ : LLInventoryPanel(params)
+{
+ // replace bridge builder to have necessary View bridges.
+ mInvFVBridgeBuilder = &FAVORITES_BUILDER;
+}
+
+void LLInventoryFavoritesItemsPanel::removeItemID(const LLUUID& id)
+{
+ std::set<LLUUID>::iterator found = mRootContentIDs.find(id);
+ if (found != mRootContentIDs.end())
+ {
+ mRootContentIDs.erase(found);
+ // check content for favorites
+ mBuildRootQueue.emplace_back(id);
+ }
+
+ LLInventoryPanel::removeItemID(id);
+}
+
+void LLInventoryFavoritesItemsPanel::findAndInitRootContent(const LLUUID& id)
+{
+ F64 curent_time = LLTimer::getTotalSeconds();
+ if (mBuildViewsEndTime < curent_time)
+ {
+ mBuildRootQueue.emplace_back(id);
+ return;
+ }
+ LLViewerInventoryCategory::cat_array_t* categories;
+ LLViewerInventoryItem::item_array_t* items;
+ mInventory->lockDirectDescendentArrays(id, categories, items);
+
+ if (categories)
+ {
+ S32 count = categories->size();
+ for (S32 i = 0; i < count; ++i)
+ {
+ LLViewerInventoryCategory* cat = categories->at(i);
+ if (cat->getPreferredType() == LLFolderType::FT_TRASH)
+ {
+ continue;
+ }
+ else if (cat->getIsFavorite())
+ {
+ LLFolderViewItem* folder_view_item = getItemByID(cat->getUUID());
+ if (!folder_view_item)
+ {
+ const LLUUID& parent_id = cat->getParentUUID();
+ mRootContentIDs.emplace(cat->getUUID());
+
+ buildViewsTree(cat->getUUID(), parent_id, cat, folder_view_item, mFolderRoot.get(), BUILD_TIMELIMIT);
+ }
+ }
+ else
+ {
+ findAndInitRootContent(cat->getUUID());
+ }
+ }
+ }
+
+ if (items)
+ {
+ S32 count = items->size();
+ for (S32 i = 0; i < count; ++i)
+ {
+ LLViewerInventoryItem* item = items->at(i);
+ const LLUUID item_id = item->getUUID();
+ if (item->getIsFavorite() && typedViewsFilter(item_id, item))
+ {
+ LLFolderViewItem* folder_view_item = getItemByID(id);
+ if (!folder_view_item)
+ {
+ const LLUUID& parent_id = item->getParentUUID();
+ mRootContentIDs.emplace(item_id);
+
+ buildViewsTree(item_id, parent_id, item, folder_view_item, mFolderRoot.get(), BUILD_TIMELIMIT);
+ }
+ }
+ }
+ }
+}
+
+void LLInventoryFavoritesItemsPanel::initRootContent()
+{
+ findAndInitRootContent(gInventory.getRootFolderID()); // My Inventory
+}
+
+bool LLInventoryFavoritesItemsPanel::removeFavorite(const LLUUID& id, const LLInventoryObject* model_item)
+{
+ std::set<LLUUID>::iterator found = mRootContentIDs.find(id);
+ if (found == mRootContentIDs.end())
+ {
+ return false;
+ }
+
+ mRootContentIDs.erase(found);
+
+ // This item is in root's content, remove item's UI.
+ LLFolderViewItem* view_item = getItemByID(id);
+ if (view_item)
+ {
+ LLFolderViewFolder* parent = view_item->getParentFolder();
+ LLFolderViewModelItemInventory* viewmodel_item = static_cast<LLFolderViewModelItemInventory*>(view_item->getViewModelItem());
+ if (viewmodel_item)
+ {
+ removeItemID(viewmodel_item->getUUID());
+ }
+ view_item->destroyView();
+ if (parent)
+ {
+ parent->getViewModelItem()->dirtyDescendantsFilter();
+ LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(parent->getViewModelItem());
+ if (viewmodel_folder)
+ {
+ updateFolderLabel(viewmodel_folder->getUUID());
+ }
+ if (view_item->isFavorite())
+ {
+ parent->updateHasFavorites(false); // favorite was removed
+ }
+ }
+ }
+
+ return true;
+}
+
+void LLInventoryFavoritesItemsPanel::itemChanged(const LLUUID& id, U32 mask, const LLInventoryObject* model_item)
+{
+ if (!model_item && !getItemByID(id))
+ {
+ // remove operation, but item is not in panel already
+ return;
+ }
+
+ bool handled = false;
+
+ if (mask & (LLInventoryObserver::UPDATE_FAVORITE |
+ LLInventoryObserver::STRUCTURE |
+ LLInventoryObserver::ADD |
+ LLInventoryObserver::REMOVE))
+ {
+ // specifically exlude links and not get_is_favorite(model_item)
+ if (model_item && model_item->getIsFavorite())
+ {
+ LLFolderViewItem* view_item = getItemByID(id);
+ if (!view_item)
+ {
+ const LLViewerInventoryCategory* cat = dynamic_cast<const LLViewerInventoryCategory*>(model_item);
+ if (cat)
+ {
+ // New favorite folder
+ if (cat->getPreferredType() != LLFolderType::FT_TRASH)
+ {
+ // If any descendants were in the list, remove them
+ LLFavoritesCollector is_favorite;
+ LLInventoryModel::cat_array_t cat_array;
+ LLInventoryModel::item_array_t item_array;
+ gInventory.collectDescendentsIf(id, cat_array, item_array, FALSE, is_favorite);
+ for (LLInventoryModel::cat_array_t::const_iterator it = cat_array.begin(); it != cat_array.end(); ++it)
+ {
+ removeFavorite((*it)->getUUID(), *it);
+ }
+ for (LLInventoryModel::item_array_t::const_iterator it = item_array.begin(); it != item_array.end(); ++it)
+ {
+ removeFavorite((*it)->getUUID(), *it);
+ }
+
+ LLFolderViewItem* folder_view_item = getItemByID(cat->getUUID());
+ if (!folder_view_item)
+ {
+ const LLUUID& parent_id = cat->getParentUUID();
+ mRootContentIDs.emplace(cat->getUUID());
+
+ buildViewsTree(cat->getUUID(), parent_id, cat, folder_view_item, mFolderRoot.get(), BUILD_ONE_FOLDER);
+ }
+ }
+ }
+ else
+ {
+ // New favorite item
+ if (model_item->getIsFavorite() && typedViewsFilter(id, model_item))
+ {
+ const LLUUID& parent_id = model_item->getParentUUID();
+ mRootContentIDs.emplace(id);
+
+ buildViewsTree(id, parent_id, model_item, NULL, mFolderRoot.get(), BUILD_ONE_FOLDER);
+ }
+ }
+ handled = true;
+ }
+ }
+ else
+ {
+ handled = removeFavorite(id, model_item);
+ }
+ }
+
+ if (!handled)
+ {
+ LLInventoryPanel::itemChanged(id, mask, model_item);
+ }
+}
+/************************************************************************/
+/* LLInventorySingleFolderPanel */
+/************************************************************************/
+
static LLDefaultChildRegistry::Register<LLInventorySingleFolderPanel> t_single_folder_inventory_panel("single_folder_inventory_panel");
LLInventorySingleFolderPanel::LLInventorySingleFolderPanel(const Params& params)
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index c6984fb53b..70a1f4e6c8 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -251,7 +251,7 @@ public:
bool reset_filter = false);
static void setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id);
void addItemID(const LLUUID& id, LLFolderViewItem* itemp);
- void removeItemID(const LLUUID& id);
+ virtual void removeItemID(const LLUUID& id);
LLFolderViewItem* getItemByID(const LLUUID& id);
LLFolderViewFolder* getFolderByID(const LLUUID& id);
void setSelectionByID(const LLUUID& obj_id, BOOL take_keyboard_focus);
@@ -334,6 +334,8 @@ public:
protected:
// Builds the UI. Call this once the inventory is usable.
void initializeViews(F64 max_time);
+ virtual void initRootContent();
+ virtual void findAndInitRootContent(const LLUUID& root_id) {};
// Specific inventory colors
static bool sColorSetInitialized;
@@ -371,7 +373,7 @@ protected:
virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge);
boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)> mSelectionCallback;
-private:
+protected:
// buildViewsTree does not include some checks and is meant
// for recursive use, use buildNewViews() for first call
LLFolderViewItem* buildViewsTree(const LLUUID& id,
@@ -394,6 +396,7 @@ private:
EViewsInitializationState mViewsInitialized; // Whether views have been generated
F64 mBuildViewsEndTime; // Stop building views past this timestamp
std::deque<LLUUID> mBuildViewsQueue;
+ std::deque<LLUUID> mBuildRootQueue;
};
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index 0b127b1b93..918c854e89 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -81,9 +81,16 @@ LLOutfitGallery::LLOutfitGallery(const LLOutfitGallery::Params& p)
mItemsInRow(p.items_in_row),
mRowPanWidthFactor(p.row_panel_width_factor),
mGalleryWidthFactor(p.gallery_width_factor),
- mTextureSelected(NULL)
+ mTextureSelected(NULL),
+ mSortMenu(nullptr)
{
updateGalleryWidth();
+
+ LLControlVariable* ctrl = gSavedSettings.getControl("InventoryFavoritesColorText");
+ if (ctrl)
+ {
+ mSavedSettingInvFavColor = ctrl->getSignal()->connect(boost::bind(&LLOutfitGallery::handleInvFavColorChange, this));
+ }
}
LLOutfitGallery::Params::Params()
@@ -416,18 +423,28 @@ void LLOutfitGallery::updateRowsIfNeeded()
bool compareGalleryItem(LLOutfitGalleryItem* item1, LLOutfitGalleryItem* item2)
{
- if(gSavedSettings.getBOOL("OutfitGallerySortByName") ||
- ((item1->isDefaultImage() && item2->isDefaultImage()) || (!item1->isDefaultImage() && !item2->isDefaultImage())))
- {
- std::string name1 = item1->getItemName();
- std::string name2 = item2->getItemName();
-
- return (LLStringUtil::compareDict(name1, name2) < 0);
- }
- else
+ static LLCachedControl<S32> sort_by_name(gSavedSettings, "OutfitGallerySortOrder", 0);
+ switch (sort_by_name())
{
- return item2->isDefaultImage();
+ case 2:
+ if (item1->isFavorite() != item2->isFavorite())
+ {
+ return item1->isFavorite();
+ }
+ break;
+ case 1:
+ if (item1->isDefaultImage() != item2->isDefaultImage())
+ {
+ return item2->isDefaultImage();
+ }
+ break;
+ default:
+ break;
}
+
+ std::string name1 = item1->getItemName();
+ std::string name2 = item2->getItemName();
+ return (LLStringUtil::compareDict(name1, name2) < 0);
}
void LLOutfitGallery::reArrangeRows(S32 row_diff)
@@ -470,6 +487,20 @@ void LLOutfitGallery::updateGalleryWidth()
mGalleryWidth = mGalleryWidthFactor * mItemsInRow - mItemHorizontalGap;
}
+void LLOutfitGallery::handleInvFavColorChange()
+{
+ for (outfit_map_t::iterator iter = mOutfitMap.begin();
+ iter != mOutfitMap.end();
+ ++iter)
+ {
+ if (!iter->second) continue;
+ LLOutfitGalleryItem* item = (LLOutfitGalleryItem*)iter->second;
+
+ // refresh font color
+ item->setOutfitFavorite(item->isFavorite());
+ }
+}
+
LLPanel* LLOutfitGallery::addLastRow()
{
mRowCount++;
@@ -617,7 +648,7 @@ void LLOutfitGallery::removeFromLastRow(LLOutfitGalleryItem* item)
mItemPanels.pop_back();
}
-LLOutfitGalleryItem* LLOutfitGallery::buildGalleryItem(std::string name, LLUUID outfit_id)
+LLOutfitGalleryItem* LLOutfitGallery::buildGalleryItem(std::string name, LLUUID outfit_id, bool is_favorite)
{
LLOutfitGalleryItem::Params giparams;
LLOutfitGalleryItem* gitem = LLUICtrlFactory::create<LLOutfitGalleryItem>(giparams);
@@ -626,6 +657,7 @@ LLOutfitGalleryItem* LLOutfitGallery::buildGalleryItem(std::string name, LLUUID
gitem->setFollowsLeft();
gitem->setFollowsTop();
gitem->setOutfitName(name);
+ gitem->setOutfitFavorite(is_favorite);
gitem->setUUID(outfit_id);
gitem->setGallery(this);
return gitem;
@@ -770,8 +802,7 @@ void LLOutfitGallery::updateAddedCategory(LLUUID cat_id)
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
if (!cat) return;
- std::string name = cat->getName();
- LLOutfitGalleryItem* item = buildGalleryItem(name, cat_id);
+ LLOutfitGalleryItem* item = buildGalleryItem(cat->getName(), cat_id, cat->getIsFavorite());
mOutfitMap.insert(LLOutfitGallery::outfit_map_value_t(cat_id, item));
item->setRightMouseDownCallback(boost::bind(&LLOutfitListBase::outfitRightClickCallBack, this,
_1, _2, _3, cat_id));
@@ -840,6 +871,7 @@ void LLOutfitGallery::updateChangedCategoryName(LLViewerInventoryCategory *cat,
if (item)
{
item->setOutfitName(name);
+ item->setOutfitFavorite(cat->getIsFavorite());
}
}
}
@@ -916,6 +948,10 @@ LLOutfitListGearMenuBase* LLOutfitGallery::createGearMenu()
static LLDefaultChildRegistry::Register<LLOutfitGalleryItem> r("outfit_gallery_item");
+bool LLOutfitGalleryItem::sColorSetInitialized = false;
+LLUIColor LLOutfitGalleryItem::sDefaultTextColor;
+LLUIColor LLOutfitGalleryItem::sDefaultFavoriteColor;
+
LLOutfitGalleryItem::LLOutfitGalleryItem(const Params& p)
: LLPanel(p),
mGallery(nullptr),
@@ -927,6 +963,12 @@ LLOutfitGalleryItem::LLOutfitGalleryItem(const Params& p)
mUUID(LLUUID())
{
buildFromFile("panel_outfit_gallery_item.xml");
+ if (!sColorSetInitialized)
+ {
+ sDefaultTextColor = LLUIColorTable::instance().getColor("White", LLColor4::white);
+ sDefaultFavoriteColor = LLUIColorTable::instance().getColor("InventoryFavoriteColor", LLColor4::white);
+ sColorSetInitialized = true;
+ }
}
LLOutfitGalleryItem::~LLOutfitGalleryItem()
@@ -980,6 +1022,18 @@ void LLOutfitGalleryItem::draw()
}
}
+ static LLUICachedControl<bool> draw_star("InventoryFavoritesUseStar", true);
+ if(mFavorite && draw_star())
+ {
+ const S32 HPAD = 3;
+ const S32 VPAD = 6; // includes padding for text and for the image
+ const S32 image_size = 14;
+ static LLPointer<LLUIImage> fav_img = LLRender2D::getInstance()->getUIImage("Inv_Favorite_Star_Full");
+
+ gl_draw_scaled_image(
+ border.getWidth() - image_size - HPAD, image_size + VPAD + mOutfitNameText->getRect().getHeight(),
+ image_size, image_size, fav_img->getImage(), UI_VERTEX_COLOR % alpha);
+ }
}
void LLOutfitGalleryItem::setOutfitName(std::string name)
@@ -989,18 +1043,27 @@ void LLOutfitGalleryItem::setOutfitName(std::string name)
mOutfitName = name;
}
+void LLOutfitGalleryItem::setOutfitFavorite(bool is_favorite)
+{
+ mFavorite = is_favorite;
+
+ static LLCachedControl<bool> use_color(gSavedSettings, "InventoryFavoritesColorText");
+ mOutfitNameText->setReadOnlyColor((mFavorite && use_color()) ? sDefaultFavoriteColor.get() : sDefaultTextColor.get());
+}
+
void LLOutfitGalleryItem::setOutfitWorn(bool value)
{
mWorn = value;
LLStringUtil::format_map_t worn_string_args;
std::string worn_string = getString("worn_string", worn_string_args);
- LLUIColor text_color = LLUIColorTable::instance().getColor("White", LLColor4::white);
- mOutfitWornText->setReadOnlyColor(text_color.get());
- mOutfitNameText->setReadOnlyColor(text_color.get());
+ mOutfitWornText->setReadOnlyColor(sDefaultTextColor.get());
mOutfitWornText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
mOutfitNameText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
mOutfitWornText->setValue(value ? worn_string : "");
mOutfitNameText->setText(mOutfitName); // refresh LLTextViewModel to pick up font changes
+
+ static LLCachedControl<bool> use_color(gSavedSettings, "InventoryFavoritesColorText");
+ mOutfitNameText->setReadOnlyColor((mFavorite && use_color()) ? sDefaultFavoriteColor.get() : sDefaultTextColor.get());
}
void LLOutfitGalleryItem::setSelected(bool value)
@@ -1149,6 +1212,7 @@ LLContextMenu* LLOutfitGalleryContextMenu::createMenu()
registrar.add("Outfit.Delete", boost::bind(LLOutfitGallery::onRemoveOutfit, selected_id));
registrar.add("Outfit.Create", boost::bind(&LLOutfitGalleryContextMenu::onCreate, this, _2));
registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitGalleryContextMenu::onThumbnail, this, selected_id));
+ registrar.add("Outfit.Favorite", boost::bind(&LLOutfitGalleryContextMenu::onFavorite, this, selected_id));
registrar.add("Outfit.Save", boost::bind(&LLOutfitGalleryContextMenu::onSave, this, selected_id));
enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitGalleryContextMenu::onEnable, this, _2));
enable_registrar.add("Outfit.OnVisible", boost::bind(&LLOutfitGalleryContextMenu::onVisible, this, _2));
@@ -1187,24 +1251,10 @@ void LLOutfitGalleryGearMenu::onUpdateItemsVisibility()
{
if (!mMenu) return;
bool have_selection = getSelectedOutfitID().notNull();
- mMenu->setItemVisible("expand", FALSE);
- mMenu->setItemVisible("collapse", FALSE);
mMenu->setItemVisible("thumbnail", have_selection);
- mMenu->setItemVisible("sort_folders_by_name", TRUE);
LLOutfitListGearMenuBase::onUpdateItemsVisibility();
}
-void LLOutfitGalleryGearMenu::onChangeSortOrder()
-{
- bool sort_by_name = !gSavedSettings.getBOOL("OutfitGallerySortByName");
- gSavedSettings.setBOOL("OutfitGallerySortByName", sort_by_name);
- LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mOutfitList);
- if (gallery)
- {
- gallery->reArrangeRows();
- }
-}
-
bool LLOutfitGalleryGearMenu::hasDefaultImage()
{
LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mOutfitList);
@@ -1305,6 +1355,15 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id)
}
}
+LLToggleableMenu* LLOutfitGallery::getSortMenu()
+{
+ if (!mSortMenu)
+ {
+ mSortMenu = new LLOutfitGallerySortMenu(this);
+ }
+ return mSortMenu->getMenu();
+}
+
LLUUID LLOutfitGallery::getPhotoAssetId(const LLUUID& outfit_id)
{
outfit_map_t::iterator outfit_it = mOutfitMap.find(outfit_id);
@@ -1320,3 +1379,84 @@ LLUUID LLOutfitGallery::getDefaultPhoto()
return LLUUID();
}
+
+//////////////////// LLOutfitGallerySortMenu ////////////////////
+
+LLOutfitGallerySortMenu::LLOutfitGallerySortMenu(LLOutfitListBase* parent_panel)
+ : mPanelHandle(parent_panel->getHandle())
+{
+ LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
+
+ registrar.add("Sort.OnSort", boost::bind(&LLOutfitGallerySortMenu::onSort, this, _2));
+ enable_registrar.add("Sort.OnEnable", boost::bind(&LLOutfitGallerySortMenu::onEnable, this, _2));
+
+ mMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
+ "menu_outfit_gallery_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
+ llassert(mMenu);
+}
+
+
+LLToggleableMenu* LLOutfitGallerySortMenu::getMenu()
+{
+ return mMenu;
+}
+
+void LLOutfitGallerySortMenu::updateItemsVisibility()
+{
+ onUpdateItemsVisibility();
+}
+
+void LLOutfitGallerySortMenu::onUpdateItemsVisibility()
+{
+ if (!mMenu) return;
+}
+
+bool LLOutfitGallerySortMenu::onEnable(LLSD::String param)
+{
+ static LLCachedControl<S32> sort_order(gSavedSettings, "OutfitGallerySortOrder", 0);
+ if ("favorites_to_top" == param)
+ {
+ return sort_order == 2;
+ }
+ else if ("images_to_top" == param)
+ {
+ return sort_order == 1;
+ }
+ else if ("by_name" == param)
+ {
+ return sort_order == 0;
+ }
+
+ return false;
+}
+
+void LLOutfitGallerySortMenu::onSort(LLSD::String param)
+{
+ S32 sort_order = gSavedSettings.getS32("OutfitGallerySortOrder");
+ S32 new_sort_order = 0;
+ if ("favorites_to_top" == param)
+ {
+ new_sort_order = 2;
+ }
+ else if ("images_to_top" == param)
+ {
+ new_sort_order = 1;
+ }
+ else if ("by_name" == param)
+ {
+ new_sort_order = 0;
+ }
+ if (sort_order == new_sort_order)
+ {
+ new_sort_order = sort_order ? 0 : 1;
+ }
+ gSavedSettings.setS32("OutfitGallerySortOrder", new_sort_order);
+
+ LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mPanelHandle.get());
+ if (gallery)
+ {
+ gallery->reArrangeRows();
+ }
+}
+
diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h
index 97a902ce6a..90674026fd 100644
--- a/indra/newview/lloutfitgallery.h
+++ b/indra/newview/lloutfitgallery.h
@@ -42,11 +42,13 @@ class LLOutfitGalleryItem;
class LLOutfitListGearMenuBase;
class LLOutfitGalleryGearMenu;
class LLOutfitGalleryContextMenu;
+class LLOutfitGallerySortMenu;
class LLOutfitGallery : public LLOutfitListBase
{
public:
friend class LLOutfitGalleryGearMenu;
+ friend class LLOutfitGallerySortMenu;
friend class LLOutfitGalleryContextMenu;
friend class LLUpdateGalleryOnPhotoLinked;
@@ -102,10 +104,12 @@ public:
/*virtual*/ bool getHasExpandableFolders() { return FALSE; }
+ /*virtual*/ void onChangeSortOrder(const LLSD& userdata) {};
void updateMessageVisibility();
bool hasDefaultImage(const LLUUID& outfit_cat_id);
void refreshOutfit(const LLUUID& category_id);
+ virtual LLToggleableMenu* getSortMenu();
protected:
/*virtual*/ void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id);
@@ -133,8 +137,9 @@ private:
void reArrangeRows(S32 row_diff = 0);
void updateRowsIfNeeded();
void updateGalleryWidth();
+ void handleInvFavColorChange();
- LLOutfitGalleryItem* buildGalleryItem(std::string name, LLUUID outfit_id);
+ LLOutfitGalleryItem* buildGalleryItem(std::string name, LLUUID outfit_id, bool is_favorite);
LLOutfitGalleryItem* getSelectedItem();
void onTextureSelectionChanged(LLInventoryItem* itemp);
@@ -175,6 +180,7 @@ private:
int mGalleryWidthFactor;
LLListContextMenu* mOutfitGalleryMenu;
+ LLOutfitGallerySortMenu* mSortMenu;
typedef std::map<LLUUID, LLOutfitGalleryItem*> outfit_map_t;
typedef outfit_map_t::value_type outfit_map_value_t;
@@ -186,6 +192,8 @@ private:
LLInventoryCategoriesObserver* mOutfitsObserver;
+
+ boost::signals2::connection mSavedSettingInvFavColor;
};
class LLOutfitGalleryContextMenu : public LLOutfitContextMenu
{
@@ -212,8 +220,6 @@ public:
protected:
/*virtual*/ void onUpdateItemsVisibility();
private:
- /*virtual*/ void onChangeSortOrder();
-
bool hasDefaultImage();
};
@@ -242,6 +248,7 @@ public:
bool setImageAssetId(LLUUID asset_id);
LLUUID getImageAssetId();
void setOutfitName(std::string name);
+ void setOutfitFavorite(bool is_favorite);
void setOutfitWorn(bool value);
void setSelected(bool value);
void setUUID(const LLUUID &outfit_id) {mUUID = outfit_id;}
@@ -249,6 +256,7 @@ public:
std::string getItemName() {return mOutfitName;}
bool isDefaultImage() {return mDefaultImage;}
+ bool isFavorite() { return mFavorite; }
bool isHidden() {return mHidden;}
void setHidden(bool hidden) {mHidden = hidden;}
@@ -266,7 +274,29 @@ private:
bool mDefaultImage;
bool mImageUpdatePending;
bool mHidden;
+ bool mFavorite;
std::string mOutfitName;
+
+ static bool sColorSetInitialized;
+ static LLUIColor sDefaultTextColor;
+ static LLUIColor sDefaultFavoriteColor;
+};
+
+class LLOutfitGallerySortMenu
+{
+public:
+ LLOutfitGallerySortMenu(LLOutfitListBase* parent_panel);
+
+ LLToggleableMenu* getMenu();
+ void updateItemsVisibility();
+
+private:
+ void onUpdateItemsVisibility();
+ bool onEnable(LLSD::String param);
+ void onSort(LLSD::String param);
+
+ LLToggleableMenu* mMenu;
+ LLHandle<LLPanel> mPanelHandle;
};
#endif // LL_LLOUTFITGALLERYCTRL_H
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index 0870211a8e..c5d7393384 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -35,6 +35,7 @@
#include "llaccordionctrltab.h"
#include "llagentwearables.h"
#include "llappearancemgr.h"
+#include "llappviewer.h"
#include "llfloaterreg.h"
#include "llfloatersidepanelcontainer.h"
#include "llinspecttexture.h"
@@ -45,6 +46,7 @@
#include "lloutfitobserver.h"
#include "lltoggleablemenu.h"
#include "lltransutil.h"
+#include "llviewercontrol.h"
#include "llviewermenu.h"
#include "llvoavatar.h"
#include "llvoavatarself.h"
@@ -53,14 +55,24 @@
static bool is_tab_header_clicked(LLAccordionCtrlTab* tab, S32 y);
static const LLOutfitTabNameComparator OUTFIT_TAB_NAME_COMPARATOR;
+static const LLOutfitTabFavComparator OUTFIT_TAB_FAV_COMPARATOR;
/*virtual*/
bool LLOutfitTabNameComparator::compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const
{
- std::string name1 = tab1->getTitle();
- std::string name2 = tab2->getTitle();
+ return (LLStringUtil::compareDict(tab1->getTitle(), tab2->getTitle()) < 0);
+}
+
+bool LLOutfitTabFavComparator::compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const
+{
+ LLOutfitAccordionCtrlTab* taba = (LLOutfitAccordionCtrlTab*)tab1;
+ LLOutfitAccordionCtrlTab* tabb = (LLOutfitAccordionCtrlTab*)tab2;
+ if (taba->getFavorite() != tabb->getFavorite())
+ {
+ return taba->getFavorite();
+ }
- return (LLStringUtil::compareDict(name1, name2) < 0);
+ return (LLStringUtil::compareDict(tab1->getTitle(), tab2->getTitle()) < 0);
}
struct outfit_accordion_tab_params : public LLInitParam::Block<outfit_accordion_tab_params, LLOutfitAccordionCtrlTab::Params>
@@ -80,6 +92,9 @@ const outfit_accordion_tab_params& get_accordion_tab_params()
{
initialized = true;
+ LLOutfitAccordionCtrlTab::sFavoriteIcon = LLUI::getUIImage("Inv_Favorite_Star_Full");
+ LLOutfitAccordionCtrlTab::sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", LLColor4U(255, 255, 255));
+
LLXMLNodePtr xmlNode;
if (LLUICtrlFactory::getLayeredXMLNode("outfit_accordion_tab.xml", xmlNode))
{
@@ -103,11 +118,20 @@ LLOutfitsList::LLOutfitsList()
, mAccordion(NULL)
, mListCommands(NULL)
, mItemSelected(false)
+ , mSortMenu(nullptr)
{
+ LLControlVariable* ctrl = gSavedSettings.getControl("InventoryFavoritesColorText");
+ if (ctrl)
+ {
+ mSavedSettingInvFavColor = ctrl->getSignal()->connect(boost::bind(&LLOutfitsList::handleInvFavColorChange, this));
+ }
}
LLOutfitsList::~LLOutfitsList()
{
+ delete mSortMenu;
+ mSavedSettingInvFavColor.disconnect();
+ mGearMenuConnection.disconnect();
}
BOOL LLOutfitsList::postBuild()
@@ -115,9 +139,25 @@ BOOL LLOutfitsList::postBuild()
mAccordion = getChild<LLAccordionCtrl>("outfits_accordion");
mAccordion->setComparator(&OUTFIT_TAB_NAME_COMPARATOR);
+ initComparator();
+
return LLOutfitListBase::postBuild();
}
+void LLOutfitsList::initComparator()
+{
+ S32 mode = gSavedSettings.getS32("OutfitListSortOrder");
+ if (mode == 0)
+ {
+ mAccordion->setComparator(&OUTFIT_TAB_NAME_COMPARATOR);
+ }
+ else
+ {
+ mAccordion->setComparator(&OUTFIT_TAB_FAV_COMPARATOR);
+ }
+ sortOutfits();
+}
+
//virtual
void LLOutfitsList::onOpen(const LLSD& info)
{
@@ -154,6 +194,7 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id)
tab->setName(name);
tab->setTitle(name);
+ tab->setFavorite(cat->getIsFavorite());
// *TODO: LLUICtrlFactory::defaultBuilder does not use "display_children" from xml. Should be investigated.
tab->setDisplayChildren(false);
@@ -183,8 +224,9 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id)
// Setting callback to reset items selection inside outfit on accordion collapsing and expanding (EXT-7875)
tab->setDropDownStateChangedCallback(boost::bind(&LLOutfitsList::resetItemSelection, this, list, cat_id));
- // force showing list items that don't match current filter(EXT-7158)
- list->setForceShowingUnmatchedItems(true);
+ // Depending on settings, force showing list items that don't match current filter(EXT-7158)
+ static LLCachedControl<bool> list_filter(gSavedSettings, "OutfitListFilterFullList");
+ list->setForceShowingUnmatchedItems(list_filter(), false);
// Setting list commit callback to monitor currently selected wearable item.
list->setCommitCallback(boost::bind(&LLOutfitsList::onListSelectionChange, this, _1));
@@ -249,13 +291,11 @@ void LLOutfitsList::onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id)
{
if (mOutfitsMap[prev_id])
{
- mOutfitsMap[prev_id]->setTitleFontStyle("NORMAL");
- mOutfitsMap[prev_id]->setTitleColor(LLUIColorTable::instance().getColor("AccordionHeaderTextColor"));
+ ((LLOutfitAccordionCtrlTab*)mOutfitsMap[prev_id])->setOutfitSelected(false);
}
if (mOutfitsMap[base_id])
{
- mOutfitsMap[base_id]->setTitleFontStyle("BOLD");
- mOutfitsMap[base_id]->setTitleColor(LLUIColorTable::instance().getColor("SelectedOutfitTextColor"));
+ ((LLOutfitAccordionCtrlTab*)mOutfitsMap[base_id])->setOutfitSelected(true);
}
}
@@ -313,6 +353,11 @@ void LLOutfitsList::onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid)
}
}
+void LLOutfitListBase::onAction(const LLSD& userdata)
+{
+ performAction(userdata.asString());
+}
+
// virtual
bool LLOutfitListBase::isActionEnabled(const LLSD& userdata)
{
@@ -425,11 +470,12 @@ void LLOutfitsList::updateChangedCategoryName(LLViewerInventoryCategory *cat, st
if (outfits_iter != mOutfitsMap.end())
{
// Update tab name with the new category name.
- LLAccordionCtrlTab* tab = outfits_iter->second;
+ LLOutfitAccordionCtrlTab* tab = (LLOutfitAccordionCtrlTab*) outfits_iter->second;
if (tab)
{
tab->setName(name);
tab->setTitle(name);
+ tab->setFavorite(cat->getIsFavorite());
}
}
}
@@ -521,7 +567,7 @@ void LLOutfitsList::onFilterSubStringChanged(const std::string& new_string, cons
LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView());
if (list)
{
- list->setFilterSubString(new_string, tab->getDisplayChildren());
+ list->setFilterSubString(new_string, true);
}
if (old_string.empty())
@@ -738,6 +784,75 @@ void LLOutfitsList::onOutfitRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUI
}
}
+void LLOutfitsList::handleInvFavColorChange()
+{
+ for (outfits_map_t::iterator iter = mOutfitsMap.begin();
+ iter != mOutfitsMap.end();
+ ++iter)
+ {
+ if (!iter->second) continue;
+ LLOutfitAccordionCtrlTab* tab = (LLOutfitAccordionCtrlTab*)iter->second;
+
+ // refresh font color
+ tab->setFavorite(tab->getFavorite());
+ }
+}
+
+void LLOutfitsList::onChangeSortOrder(const LLSD& userdata)
+{
+ std::string sort_data = userdata.asString();
+ if (sort_data == "favorites_to_top")
+ {
+ // at the moment this is a toggle
+ S32 val = gSavedSettings.getS32("OutfitListSortOrder");
+ gSavedSettings.setS32("OutfitListSortOrder", (val ? 0 : 1));
+
+ initComparator();
+ }
+ else if (sort_data == "show_entire_outfit")
+ {
+ bool new_val = !gSavedSettings.getBOOL("OutfitListFilterFullList");
+ gSavedSettings.setBOOL("OutfitListFilterFullList", new_val);
+
+ if (!getFilterSubString().empty())
+ {
+ for (outfits_map_t::value_type& outfit : mOutfitsMap)
+ {
+ LLAccordionCtrlTab* tab = outfit.second;
+ const LLUUID& category_id = outfit.first;
+ if (!tab) continue;
+
+ LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView());
+ if (list)
+ {
+ list->setForceRefresh(true);
+ list->setForceShowingUnmatchedItems(new_val, tab->getDisplayChildren());
+ }
+ applyFilterToTab(category_id, tab, getFilterSubString());
+ }
+ mAccordion->arrange();
+ }
+ }
+}
+
+LLToggleableMenu* LLOutfitsList::getSortMenu()
+{
+ if (!mSortMenu)
+ {
+ mSortMenu = new LLOutfitListSortMenu(this);
+ }
+ return mSortMenu->getMenu();
+}
+
+void LLOutfitsList::updateMenuItemsVisibility()
+{
+ if (mSortMenu)
+ {
+ mSortMenu->updateItemsVisibility();
+ }
+ LLOutfitListBase::updateMenuItemsVisibility();
+}
+
LLOutfitListGearMenuBase* LLOutfitsList::createGearMenu()
{
return new LLOutfitListGearMenu(this);
@@ -755,10 +870,10 @@ bool is_tab_header_clicked(LLAccordionCtrlTab* tab, S32 y)
LLOutfitListBase::LLOutfitListBase()
: LLPanelAppearanceTab()
, mIsInitialized(false)
+ , mGearMenu(nullptr)
{
mCategoriesObserver = new LLInventoryCategoriesObserver();
mOutfitMenu = new LLOutfitContextMenu(this);
- //mGearMenu = createGearMenu();
}
LLOutfitListBase::~LLOutfitListBase()
@@ -821,6 +936,10 @@ void LLOutfitListBase::observerCallback(const LLUUID& category_id)
void LLOutfitListBase::refreshList(const LLUUID& category_id)
{
+ if (LLAppViewer::instance()->quitRequested())
+ {
+ return;
+ }
bool wasNull = mRefreshListState.CategoryUUID.isNull();
mRefreshListState.CategoryUUID.setNull();
@@ -879,8 +998,18 @@ void LLOutfitListBase::onIdle(void* userdata)
void LLOutfitListBase::onIdleRefreshList()
{
+ if (LLAppViewer::instance()->quitRequested())
+ {
+ mRefreshListState.CategoryUUID.setNull();
+ gIdleCallbacks.deleteFunction(onIdle, this);
+ return;
+ }
if (mRefreshListState.CategoryUUID.isNull())
+ {
+ LL_WARNS() << "Called onIdleRefreshList without id" << LL_ENDL;
+ gIdleCallbacks.deleteFunction(onIdle, this);
return;
+ }
const F64 MAX_TIME = 0.05f;
F64 curent_time = LLTimer::getTotalSeconds();
@@ -1022,12 +1151,6 @@ void LLOutfitListBase::ChangeOutfitSelection(LLWearableItemsList* list, const LL
BOOL LLOutfitListBase::postBuild()
{
- mGearMenu = createGearMenu();
-
- LLMenuButton* menu_gear_btn = getChild<LLMenuButton>("options_gear_btn");
-
- menu_gear_btn->setMouseDownCallback(boost::bind(&LLOutfitListGearMenuBase::updateItemsVisibility, mGearMenu));
- menu_gear_btn->setMenu(mGearMenu->getMenu());
return TRUE;
}
@@ -1041,6 +1164,20 @@ void LLOutfitListBase::expandAllFolders()
onExpandAllFolders();
}
+void LLOutfitListBase::updateMenuItemsVisibility()
+{
+ mGearMenu->updateItemsVisibility();
+}
+
+LLToggleableMenu* LLOutfitListBase::getGearMenu()
+{
+ if (!mGearMenu)
+ {
+ mGearMenu = createGearMenu();
+ }
+ return mGearMenu->getMenu();
+};
+
void LLOutfitListBase::deselectOutfit(const LLUUID& category_id)
{
// Reset selection if the outfit is selected.
@@ -1067,6 +1204,7 @@ LLContextMenu* LLOutfitContextMenu::createMenu()
registrar.add("Outfit.Rename", boost::bind(renameOutfit, selected_id));
registrar.add("Outfit.Delete", boost::bind(&LLOutfitListBase::removeSelected, mOutfitList));
registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitContextMenu::onThumbnail, this, selected_id));
+ registrar.add("Outfit.Favorite", boost::bind(&LLOutfitContextMenu::onFavorite, this, selected_id));
registrar.add("Outfit.Save", boost::bind(&LLOutfitContextMenu::onSave, this, selected_id));
enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitContextMenu::onEnable, this, _2));
@@ -1117,6 +1255,16 @@ bool LLOutfitContextMenu::onVisible(LLSD::String param)
{
return LLAppearanceMgr::instance().getCanRemoveOutfit(outfit_cat_id);
}
+ else if ("favorites_add" == param)
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(outfit_cat_id);
+ return cat && !cat->getIsFavorite();
+ }
+ else if ("favorites_remove" == param)
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(outfit_cat_id);
+ return cat && cat->getIsFavorite();
+ }
return true;
}
@@ -1141,6 +1289,14 @@ void LLOutfitContextMenu::onThumbnail(const LLUUID &outfit_cat_id)
}
}
+void LLOutfitContextMenu::onFavorite(const LLUUID& outfit_cat_id)
+{
+ if (outfit_cat_id.notNull())
+ {
+ toggle_favorite(outfit_cat_id);
+ }
+}
+
void LLOutfitContextMenu::onSave(const LLUUID &outfit_cat_id)
{
if (outfit_cat_id.notNull())
@@ -1171,14 +1327,13 @@ LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist)
registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenuBase::onRename, this));
registrar.add("Gear.Delete", boost::bind(&LLOutfitListBase::removeSelected, mOutfitList));
registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenuBase::onCreate, this, _2));
- registrar.add("Gear.Collapse", boost::bind(&LLOutfitListBase::onCollapseAllFolders, mOutfitList));
- registrar.add("Gear.Expand", boost::bind(&LLOutfitListBase::onExpandAllFolders, mOutfitList));
registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenuBase::onAdd, this));
registrar.add("Gear.Save", boost::bind(&LLOutfitListGearMenuBase::onSave, this));
registrar.add("Gear.Thumbnail", boost::bind(&LLOutfitListGearMenuBase::onThumbnail, this));
- registrar.add("Gear.SortByName", boost::bind(&LLOutfitListGearMenuBase::onChangeSortOrder, this));
+ registrar.add("Gear.Favorite", boost::bind(&LLOutfitListGearMenuBase::onFavorite, this));
+ registrar.add("Gear.SortByImage", boost::bind(&LLOutfitListGearMenuBase::onChangeSortOrder, this));
enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitListGearMenuBase::onEnable, this, _2));
enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenuBase::onVisible, this, _2));
@@ -1312,6 +1467,16 @@ bool LLOutfitListGearMenuBase::onVisible(LLSD::String param)
{
return false;
}
+ else if ("favorites_add" == param)
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(selected_outfit_id);
+ return cat && !cat->getIsFavorite();
+ }
+ else if ("favorites_remove" == param)
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(selected_outfit_id);
+ return cat && cat->getIsFavorite();
+ }
return true;
}
@@ -1323,6 +1488,12 @@ void LLOutfitListGearMenuBase::onThumbnail()
LLFloaterReg::showInstance("change_item_thumbnail", data);
}
+void LLOutfitListGearMenuBase::onFavorite()
+{
+ const LLUUID& selected_outfit_id = getSelectedOutfitID();
+ toggle_favorite(selected_outfit_id);
+}
+
void LLOutfitListGearMenuBase::onChangeSortOrder()
{
@@ -1338,13 +1509,77 @@ LLOutfitListGearMenu::~LLOutfitListGearMenu()
void LLOutfitListGearMenu::onUpdateItemsVisibility()
{
if (!mMenu) return;
- mMenu->setItemVisible("expand", TRUE);
- mMenu->setItemVisible("collapse", TRUE);
mMenu->setItemVisible("thumbnail", getSelectedOutfitID().notNull());
- mMenu->setItemVisible("sort_folders_by_name", FALSE);
+ mMenu->setItemVisible("favorite", getSelectedOutfitID().notNull());
LLOutfitListGearMenuBase::onUpdateItemsVisibility();
}
+//////////////////// LLOutfitListSortMenu ////////////////////
+
+LLOutfitListSortMenu::LLOutfitListSortMenu(LLOutfitListBase* parent_panel)
+ : mPanelHandle(parent_panel->getHandle())
+{
+ LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
+
+ registrar.add("Sort.Collapse", boost::bind(&LLOutfitListBase::onCollapseAllFolders, parent_panel));
+ registrar.add("Sort.Expand", boost::bind(&LLOutfitListBase::onExpandAllFolders, parent_panel));
+ registrar.add("Sort.OnSort", boost::bind(&LLOutfitListBase::onChangeSortOrder, parent_panel, _2));
+ enable_registrar.add("Sort.OnEnable", boost::bind(&LLOutfitListSortMenu::onEnable, this, _2));
+
+ mMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
+ "menu_outfit_list_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
+ llassert(mMenu);
+}
+
+
+LLToggleableMenu* LLOutfitListSortMenu::getMenu()
+{
+ return mMenu;
+}
+
+void LLOutfitListSortMenu::updateItemsVisibility()
+{
+ onUpdateItemsVisibility();
+}
+
+void LLOutfitListSortMenu::onUpdateItemsVisibility()
+{
+ if (!mMenu) return;
+ mMenu->setItemVisible("expand", true);
+ mMenu->setItemVisible("collapse", true);
+ mMenu->setItemVisible("sort_favorites_to_top", true);
+ mMenu->setItemVisible("show_entire_outfit_in_search", true);
+}
+
+bool LLOutfitListSortMenu::onEnable(LLSD::String param)
+{
+ if ("favorites_to_top" == param)
+ {
+ static LLCachedControl<S32> sort_order(gSavedSettings, "OutfitListSortOrder", 0);
+ return sort_order == 1;
+ }
+ else if ("show_entire_outfit" == param)
+ {
+ static LLCachedControl<bool> filter_mode(gSavedSettings, "OutfitListFilterFullList", 0);
+ return filter_mode;
+ }
+
+ return false;
+}
+
+
+//////////////////// LLOutfitAccordionCtrlTab ////////////////////
+
+LLUIImage* LLOutfitAccordionCtrlTab::sFavoriteIcon;
+LLUIColor LLOutfitAccordionCtrlTab::sFgColor;
+
+void LLOutfitAccordionCtrlTab::draw()
+{
+ LLAccordionCtrlTab::draw();
+ drawFavoriteIcon();
+}
+
BOOL LLOutfitAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask)
{
if (y >= getLocalRect().getHeight() - getHeaderHeight())
@@ -1365,4 +1600,61 @@ BOOL LLOutfitAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask)
return LLAccordionCtrlTab::handleToolTip(x, y, mask);
}
+
+void LLOutfitAccordionCtrlTab::setFavorite(bool is_favorite)
+{
+ mIsFavorite = is_favorite;
+ static LLUICachedControl<bool> highlight_color("InventoryFavoritesColorText", true);
+ if (!mIsSelected && mIsFavorite && highlight_color())
+ {
+ setTitleColor(LLUIColorTable::instance().getColor("InventoryFavoriteColor"));
+ }
+ else
+ {
+ setTitleColor(LLUIColorTable::instance().getColor("AccordionHeaderTextColor"));
+ }
+}
+
+void LLOutfitAccordionCtrlTab::setOutfitSelected(bool val)
+{
+ mIsSelected = val;
+ if (val)
+ {
+ setTitleFontStyle("BOLD");
+ setTitleColor(LLUIColorTable::instance().getColor("SelectedOutfitTextColor"));
+ }
+ else
+ {
+ setTitleFontStyle("NORMAL");
+ static LLUICachedControl<bool> highlight_color("InventoryFavoritesColorText", true);
+ if (mIsFavorite && highlight_color())
+ {
+ setTitleColor(LLUIColorTable::instance().getColor("InventoryFavoriteColor"));
+ }
+ else
+ {
+ setTitleColor(LLUIColorTable::instance().getColor("AccordionHeaderTextColor"));
+ }
+ }
+}
+
+void LLOutfitAccordionCtrlTab::drawFavoriteIcon()
+{
+ if (!mIsFavorite)
+ {
+ return;
+ }
+ static LLUICachedControl<bool> draw_star("InventoryFavoritesUseStar", true);
+ if (!draw_star)
+ {
+ return;
+ }
+
+ const S32 PAD = 2;
+ const S32 image_size = 18;
+
+ gl_draw_scaled_image(
+ getRect().getWidth() - image_size - PAD, getRect().getHeight() - image_size - PAD,
+ image_size, image_size, sFavoriteIcon->getImage(), sFgColor);
+}
// EOF
diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h
index 11512b6731..852c3353a4 100644
--- a/indra/newview/lloutfitslist.h
+++ b/indra/newview/lloutfitslist.h
@@ -41,6 +41,7 @@
class LLAccordionCtrlTab;
class LLInventoryCategoriesObserver;
class LLOutfitListGearMenuBase;
+class LLOutfitListSortMenuBase;
class LLWearableItemsList;
class LLListContextMenu;
@@ -61,6 +62,17 @@ public:
/*virtual*/ bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const;
};
+class LLOutfitTabFavComparator : public LLAccordionCtrl::LLTabComparator
+{
+ LOG_CLASS(LLOutfitTabFavComparator);
+
+public:
+ LLOutfitTabFavComparator() {};
+ virtual ~LLOutfitTabFavComparator() {};
+
+ /*virtual*/ bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const;
+};
+
class LLOutfitListBase : public LLPanelAppearanceTab
{
public:
@@ -92,6 +104,7 @@ public:
boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb);
void outfitRightClickCallBack(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id);
+ void onAction(const LLSD& userdata);
virtual bool isActionEnabled(const LLSD& userdata);
virtual void performAction(std::string action);
virtual bool hasItemSelected() = 0;
@@ -109,6 +122,12 @@ public:
virtual bool getHasExpandableFolders() = 0;
+ virtual void onChangeSortOrder(const LLSD& userdata) = 0;
+
+ virtual void updateMenuItemsVisibility();
+ virtual LLToggleableMenu* getGearMenu();
+ virtual bool getTrashMenuVisible() { return true; };
+
protected:
void observerCallback(const LLUUID& category_id);
virtual LLOutfitListGearMenuBase* createGearMenu() = 0;
@@ -139,6 +158,7 @@ protected:
selection_change_signal_t mSelectionChangeSignal;
LLListContextMenu* mOutfitMenu;
LLOutfitListGearMenuBase* mGearMenu;
+ boost::signals2::connection mGearMenuConnection;
};
//////////////////////////////////////////////////////////////////////////
@@ -155,7 +175,6 @@ protected:
/* virtual */ LLContextMenu* createMenu();
bool onEnable(LLSD::String param);
-
bool onVisible(LLSD::String param);
static void editOutfit();
@@ -163,6 +182,7 @@ protected:
static void renameOutfit(const LLUUID& outfit_cat_id);
void onThumbnail(const LLUUID &outfit_cat_id);
+ void onFavorite(const LLUUID& outfit_cat_id);
void onSave(const LLUUID &outfit_cat_id);
private:
@@ -182,6 +202,7 @@ public:
protected:
virtual void onUpdateItemsVisibility();
virtual void onThumbnail();
+ virtual void onFavorite();
virtual void onChangeSortOrder();
const LLUUID& getSelectedOutfitID();
@@ -202,6 +223,23 @@ private:
bool onVisible(LLSD::String param);
};
+class LLOutfitListSortMenu
+{
+public:
+ LLOutfitListSortMenu(LLOutfitListBase* parent_panel);
+
+ LLToggleableMenu* getMenu();
+ void updateItemsVisibility();
+
+private:
+ void onUpdateItemsVisibility();
+ bool onEnable(LLSD::String param);
+
+ LLToggleableMenu* mMenu;
+ LLHandle<LLPanel> mPanelHandle;
+};
+
+
class LLOutfitListGearMenu : public LLOutfitListGearMenuBase
{
public:
@@ -221,8 +259,16 @@ public:
Params() : cat_id("cat_id") {}
};
+ virtual void draw();
virtual BOOL handleToolTip(S32 x, S32 y, MASK mask);
+ void setFavorite(bool is_favorite);
+ bool getFavorite() const { return mIsFavorite; }
+ void setOutfitSelected(bool val);
+
+ static LLUIImage* sFavoriteIcon;
+ static LLUIColor sFgColor;
+
protected:
LLOutfitAccordionCtrlTab(const LLOutfitAccordionCtrlTab::Params &p)
: LLAccordionCtrlTab(p),
@@ -230,7 +276,11 @@ public:
{}
friend class LLUICtrlFactory;
+ void drawFavoriteIcon();
+
LLUUID mFolderID;
+ bool mIsFavorite = false;
+ bool mIsSelected = false;
};
/**
* @class LLOutfitsList
@@ -249,6 +299,7 @@ public:
virtual ~LLOutfitsList();
/*virtual*/ BOOL postBuild();
+ void initComparator();
/*virtual*/ void onOpen(const LLSD& info);
@@ -287,6 +338,10 @@ public:
/*virtual*/ bool getHasExpandableFolders() { return TRUE; }
+ /*virtual*/ void onChangeSortOrder(const LLSD& userdata);
+ virtual LLToggleableMenu* getSortMenu();
+ void updateMenuItemsVisibility();
+
protected:
LLOutfitListGearMenuBase* createGearMenu();
@@ -357,6 +412,8 @@ private:
static void onOutfitRename(const LLSD& notification, const LLSD& response);
+ void handleInvFavColorChange();
+
//LLInventoryCategoriesObserver* mCategoriesObserver;
LLAccordionCtrl* mAccordion;
@@ -374,13 +431,15 @@ private:
// Used to monitor COF changes for updating items worn state. See EXT-8636.
uuid_vec_t mCOFLinkedItems;
- //LLOutfitListGearMenu* mGearMenu;
+ LLOutfitListSortMenu* mSortMenu;
//bool mIsInitialized;
/**
* True if there is a selection inside currently selected outfit
*/
bool mItemSelected;
+
+ boost::signals2::connection mSavedSettingInvFavColor;
};
#endif //LL_LLOUTFITSLIST_H
diff --git a/indra/newview/llpanelappearancetab.h b/indra/newview/llpanelappearancetab.h
index e4d16582de..e088c3e6f0 100644
--- a/indra/newview/llpanelappearancetab.h
+++ b/indra/newview/llpanelappearancetab.h
@@ -29,6 +29,8 @@
#include "llpanel.h"
+class LLToggleableMenu;
+
class LLPanelAppearanceTab : public LLPanel
{
public:
@@ -47,6 +49,11 @@ public:
const std::string& getFilterSubString() { return mFilterSubString; }
+ virtual void updateMenuItemsVisibility() = 0;
+ virtual LLToggleableMenu* getGearMenu() = 0;
+ virtual LLToggleableMenu* getSortMenu() = 0;
+ virtual bool getTrashMenuVisible() = 0;
+
protected:
/**
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 5111241e92..bf4689e294 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -67,6 +67,7 @@ const std::string FILTERS_FILENAME("filters.xml");
const std::string ALL_ITEMS("All Items");
const std::string RECENT_ITEMS("Recent Items");
const std::string WORN_ITEMS("Worn Items");
+const std::string FAVORITES("Favorites");
static LLPanelInjector<LLPanelMainInventory> t_inventory("panel_main_inventory");
@@ -193,6 +194,17 @@ BOOL LLPanelMainInventory::postBuild()
worn_filter.markDefault();
mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2));
}
+
+ LLInventoryPanel* favorites_panel = getChild<LLInventoryPanel>(FAVORITES);
+ if (favorites_panel)
+ {
+ favorites_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
+ LLInventoryFilter& favorites_filter = favorites_panel->getFilter();
+ favorites_filter.setEmptyLookupMessage("InventoryNoMatchingFavorites");
+ favorites_filter.markDefault();
+ favorites_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, favorites_panel, _1, _2));
+ }
+
mSearchTypeCombo = getChild<LLComboBox>("search_type");
if(mSearchTypeCombo)
{
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index f2a469bed4..7228f5a98b 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -129,6 +129,7 @@ public:
virtual void navigateToFolder(bool new_window = false, bool change_mode = false) {}
virtual BOOL isItemRenameable() const;
virtual BOOL renameItem(const std::string& new_name);
+ virtual bool isFavorite() const { return false; }
virtual BOOL isItemMovable() const;
virtual BOOL isItemRemovable(bool check_worn = true) const;
virtual BOOL removeItem();
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 1bfae630a0..1719a07eb1 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -404,7 +404,9 @@ LLPanelOutfitEdit::LLPanelOutfitEdit()
mWearableListManager(NULL),
mPlusBtn(NULL),
mWearablesGearMenuBtn(NULL),
- mGearMenuBtn(NULL)
+ mGearMenuBtn(NULL),
+ mStatus(NULL),
+ mCurrentOutfitName(NULL)
{
mSavedFolderState = new LLSaveFolderState();
mSavedFolderState->setApply(FALSE);
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index edeeb93560..4920698e4c 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -33,6 +33,7 @@
#include "llfloatersidepanelcontainer.h"
#include "llinventoryfunctions.h"
#include "llinventorymodelbackgroundfetch.h"
+#include "llmenubutton.h"
#include "llnotificationsutil.h"
#include "lloutfitgallery.h"
#include "lloutfitobserver.h"
@@ -53,12 +54,17 @@ static const std::string SAVE_BTN("save_btn");
static LLPanelInjector<LLPanelOutfitsInventory> t_inventory("panel_outfits_inventory");
-LLPanelOutfitsInventory::LLPanelOutfitsInventory() :
- mMyOutfitsPanel(NULL),
- mCurrentOutfitPanel(NULL),
- mActivePanel(NULL),
- mAppearanceTabs(NULL),
- mInitialized(false)
+LLPanelOutfitsInventory::LLPanelOutfitsInventory()
+ : mMyOutfitsPanel(nullptr)
+ , mCurrentOutfitPanel(nullptr)
+ , mActivePanel(nullptr)
+ , mAppearanceTabs(nullptr)
+ , mInitialized(false)
+ , mGearMenu(nullptr)
+ , mSortMenu(nullptr)
+ , mTrashBtn(nullptr)
+ , mSortMenuPanel(nullptr)
+ , mTrashMenuPanel(nullptr)
{
gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoaded, this));
gAgentWearables.addLoadingStartedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoading, this));
@@ -75,6 +81,9 @@ LLPanelOutfitsInventory::~LLPanelOutfitsInventory()
{
gSavedSettings.setS32("LastAppearanceTab", mAppearanceTabs->getCurrentPanelIndex());
}
+ mGearMenuConnection.disconnect();
+ mSortMenuConnection.disconnect();
+ mTrashMenuConnection.disconnect();
}
// virtual
@@ -257,6 +266,22 @@ void LLPanelOutfitsInventory::initListCommandsHandlers()
mOutfitGalleryPanel->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this));
}
+void LLPanelOutfitsInventory::setMenuButtons(LLMenuButton* gear_menu, LLMenuButton* sort_menu, LLButton* trash_btn, LLPanel* sort_menu_panel, LLPanel* trash_menu_panel)
+{
+ mGearMenu = gear_menu;
+ mSortMenu = sort_menu;
+ mTrashBtn = trash_btn;
+ mSortMenuPanel = sort_menu_panel;
+ mTrashMenuPanel = trash_menu_panel;
+
+ mGearMenuConnection.disconnect();
+ mSortMenuConnection.disconnect();
+ mTrashMenuConnection.disconnect();
+ mGearMenuConnection = mGearMenu->setMouseDownCallback(boost::bind(&LLPanelOutfitsInventory::onGearMouseDown, this));
+ mSortMenuConnection = mSortMenu->setMouseDownCallback(boost::bind(&LLPanelOutfitsInventory::onGearMouseDown, this));
+ mTrashMenuConnection = mTrashBtn->setClickedCallback(boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this));
+}
+
void LLPanelOutfitsInventory::updateListCommands()
{
bool trash_enabled = isActionEnabled("delete");
@@ -285,6 +310,14 @@ void LLPanelOutfitsInventory::onTrashButtonClick()
}
}
+void LLPanelOutfitsInventory::onGearMouseDown()
+{
+ if (mActivePanel)
+ {
+ mActivePanel->updateMenuItemsVisibility();
+ }
+}
+
bool LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
{
return mActivePanel && mActivePanel->isActionEnabled(userdata);
@@ -321,6 +354,28 @@ void LLPanelOutfitsInventory::onTabChange()
mActivePanel->checkFilterSubString();
mActivePanel->onOpen(LLSD());
+ if (mGearMenu)
+ {
+ mGearMenu->setMenu(mActivePanel->getGearMenu(), LLMenuButton::MP_BOTTOM_LEFT);
+ }
+ if (mSortMenu && mSortMenuPanel)
+ {
+ LLToggleableMenu* menu = mActivePanel->getSortMenu();
+ if (menu)
+ {
+ mSortMenu->setMenu(menu, LLMenuButton::MP_BOTTOM_LEFT);
+ mSortMenuPanel->setVisible(true);
+ }
+ else
+ {
+ mSortMenuPanel->setVisible(false);
+ }
+ }
+ if (mTrashMenuPanel)
+ {
+ mTrashMenuPanel->setVisible(mActivePanel->getTrashMenuVisible());
+ }
+
updateVerbs();
}
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index c858803ede..3d8c7316be 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -30,11 +30,13 @@
#include "llpanel.h"
+class LLButton;
class LLOutfitGallery;
class LLOutfitsList;
class LLOutfitListGearMenuBase;
class LLPanelAppearanceTab;
class LLPanelWearing;
+class LLMenuButton;
class LLMenuGL;
class LLSidepanelAppearance;
class LLTabContainer;
@@ -63,6 +65,13 @@ public:
bool isCOFPanelActive() const;
+ void setMenuButtons(
+ LLMenuButton* gear_menu,
+ LLMenuButton* sort_menu,
+ LLButton* trash_btn,
+ LLPanel* sort_menu_panel,
+ LLPanel* trash_menu_panel);
+
protected:
void updateVerbs();
@@ -92,19 +101,28 @@ protected:
void initListCommandsHandlers();
void updateListCommands();
void onWearButtonClick();
- void showGearMenu();
void onTrashButtonClick();
+ void onGearMouseDown();
bool isActionEnabled(const LLSD& userdata);
void setWearablesLoading(bool val);
void onWearablesLoaded();
void onWearablesLoading();
private:
LLPanel* mListCommands;
- LLMenuGL* mMenuAdd;
// List Commands //
//////////////////////////////////////////////////////////////////////////////////
bool mInitialized;
+
+ // not owned items
+ LLMenuButton* mGearMenu;
+ LLMenuButton* mSortMenu;
+ LLButton* mTrashBtn;
+ LLPanel* mSortMenuPanel;
+ LLPanel* mTrashMenuPanel;
+ boost::signals2::connection mGearMenuConnection;
+ boost::signals2::connection mSortMenuConnection;
+ boost::signals2::connection mTrashMenuConnection;
};
#endif //LL_LLPANELOUTFITSINVENTORY_H
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index 9a7281cda4..be8321e7bc 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -113,6 +113,7 @@ protected:
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs, no_op));
registrar.add("Wearing.Detach",
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs, no_op));
+ registrar.add("Wearing.Favorite", boost::bind(toggle_favorite, mUUIDs.front()));
LLContextMenu* menu = createFromFile("menu_wearing_tab.xml");
updateMenuItemsVisibility(menu);
@@ -125,6 +126,8 @@ protected:
bool bp_selected = false; // true if body parts selected
bool clothes_selected = false;
bool attachments_selected = false;
+ bool can_favorite = false;
+ bool can_unfavorite = false;
// See what types of wearables are selected.
for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it)
@@ -137,6 +140,9 @@ protected:
continue;
}
+ LLUUID linked_id = item->getLinkedUUID();
+ LLViewerInventoryItem* linked_item = gInventory.getItem(linked_id);
+
LLAssetType::EType type = item->getType();
if (type == LLAssetType::AT_CLOTHING)
{
@@ -150,6 +156,8 @@ protected:
{
attachments_selected = true;
}
+ can_favorite |= !linked_item->getIsFavorite();
+ can_unfavorite |= linked_item->getIsFavorite();
}
// Enable/disable some menu items depending on the selection.
@@ -166,6 +174,8 @@ protected:
menu->setItemVisible("detach", allow_detach);
menu->setItemVisible("edit_outfit_separator", show_touch | show_edit | allow_take_off || allow_detach);
menu->setItemVisible("show_original", mUUIDs.size() == 1);
+ menu->setItemVisible("favorites_add", can_favorite);
+ menu->setItemVisible("favorites_remove", can_unfavorite);
}
};
@@ -232,6 +242,10 @@ LLPanelWearing::~LLPanelWearing()
{
mAttachmentsChangedConnection.disconnect();
}
+ if (mGearMenuConnection.connected())
+ {
+ mGearMenuConnection.disconnect();
+ }
}
BOOL LLPanelWearing::postBuild()
@@ -249,10 +263,6 @@ BOOL LLPanelWearing::postBuild()
mTempItemsList->setFgUnselectedColor(LLColor4::white);
mTempItemsList->setRightMouseDownCallback(boost::bind(&LLPanelWearing::onTempAttachmentsListRightClick, this, _1, _2, _3));
- LLMenuButton* menu_gear_btn = getChild<LLMenuButton>("options_gear_btn");
-
- menu_gear_btn->setMenu(mGearMenu->getMenu());
-
return TRUE;
}
@@ -560,6 +570,16 @@ void LLPanelWearing::onRemoveAttachment()
}
}
+LLToggleableMenu* LLPanelWearing::getGearMenu()
+{
+ return mGearMenu->getMenu();
+}
+
+LLToggleableMenu* LLPanelWearing::getSortMenu()
+{
+ return NULL;
+}
+
void LLPanelWearing::onRemoveItem()
{
if (mWearablesTab->isExpanded())
diff --git a/indra/newview/llpanelwearing.h b/indra/newview/llpanelwearing.h
index bc1d0afc1b..4f71bf4488 100644
--- a/indra/newview/llpanelwearing.h
+++ b/indra/newview/llpanelwearing.h
@@ -84,6 +84,11 @@ public:
void onEditAttachment();
void onRemoveAttachment();
+ void updateMenuItemsVisibility() {};
+ LLToggleableMenu* getGearMenu();
+ LLToggleableMenu* getSortMenu();
+ bool getTrashMenuVisible() { return false; }
+
private:
void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y);
void onTempAttachmentsListRightClick(LLUICtrl* ctrl, S32 x, S32 y);
@@ -93,6 +98,7 @@ private:
LLWearableItemsList* mCOFItemsList;
LLScrollListCtrl* mTempItemsList;
LLWearingGearMenu* mGearMenu;
+ boost::signals2::connection mGearMenuConnection;
LLListContextMenu* mContextMenu;
LLListContextMenu* mAttachmentsMenu;
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index eb3dbdbd2e..5787c0d242 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -39,6 +39,7 @@
#include "llfloaterreg.h"
#include "llfloaterworldmap.h"
#include "llfolderviewmodel.h"
+#include "llmenubutton.h"
#include "lloutfitobserver.h"
#include "llpaneleditwearable.h"
#include "llpaneloutfitsinventory.h"
@@ -142,6 +143,14 @@ BOOL LLSidepanelAppearance::postBuild()
setWearablesLoading(gAgentWearables.isCOFChangeInProgress());
+
+ LLMenuButton* menu_gear_btn = getChild<LLMenuButton>("options_gear_btn");
+ LLMenuButton* menu_sort_btn = getChild<LLMenuButton>("sorting_menu_btn");
+ LLButton* menu_trash_btn = getChild<LLButton>("trash_btn");
+ LLPanel* menu_sort_btn_panel = getChild<LLPanel>("options_sort_btn_panel");
+ LLPanel* menu_trash_btn_panel = getChild<LLPanel>("trash_btn_panel");
+ mPanelOutfitsInventory->setMenuButtons(menu_gear_btn, menu_sort_btn, menu_trash_btn, menu_sort_btn_panel, menu_trash_btn_panel);
+
return TRUE;
}
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 2091a92d5d..425fc17aa9 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1436,7 +1436,8 @@ void update_inventory_category(
if(obj)
{
if (LLFolderType::lookupIsProtectedType(obj->getPreferredType())
- && (updates.size() != 1 || !updates.has("thumbnail")))
+ && (updates.size() != 1
+ || !(updates.has("thumbnail") || updates.has("favorite"))))
{
LLNotificationsUtil::add("CannotModifyProtectedCategories");
return;
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 187c4ed638..3ddd0c30ea 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -925,8 +925,8 @@ LLContextMenu* LLWearableItemsList::ContextMenu::createMenu()
registrar.add("Wearable.CreateNew", boost::bind(createNewWearable, selected_id));
registrar.add("Wearable.ShowOriginal", boost::bind(show_item_original, selected_id));
registrar.add("Wearable.TakeOffDetach",
- boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), ids, no_op));
+ boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), ids, no_op));
// Register handlers for clothing.
registrar.add("Clothing.TakeOff",
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), ids, no_op));
@@ -936,6 +936,7 @@ LLContextMenu* LLWearableItemsList::ContextMenu::createMenu()
// Register handlers for attachments.
registrar.add("Attachment.Detach",
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), ids, no_op));
+ registrar.add("Attachment.Favorite", boost::bind(toggle_favorite, selected_id));
registrar.add("Attachment.Touch", boost::bind(handle_attachment_touch, selected_id));
registrar.add("Attachment.Profile", boost::bind(show_item_profile, selected_id));
registrar.add("Object.Attach", boost::bind(LLViewerAttachMenu::attachObjects, ids, _2));
@@ -969,6 +970,8 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
U32 n_touchable = 0; // number of touchable items among the selected ones
bool can_be_worn = true;
+ bool can_favorite = false;
+ bool can_unfavorite = false;
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
@@ -990,6 +993,12 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
const bool is_editable = get_is_item_editable(id);
const bool is_touchable = enable_attachment_touch(id);
const bool is_already_worn = gAgentWearables.selfHasWearable(wearable_type);
+
+ LLUUID linked_id = item->getLinkedUUID();
+ LLViewerInventoryItem* linked_item = gInventory.getItem(linked_id);
+ can_favorite |= !linked_item->getIsFavorite();
+ can_unfavorite |= linked_item->getIsFavorite();
+
if (is_worn)
{
++n_worn;
@@ -1013,7 +1022,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
if (can_be_worn)
{
- can_be_worn = get_can_item_be_worn(item->getLinkedUUID());
+ can_be_worn = get_can_item_be_worn(linked_id);
}
} // for
@@ -1035,6 +1044,8 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
setMenuItemEnabled(menu, "create_new", LLAppearanceMgr::instance().canAddWearables(ids));
setMenuItemVisible(menu, "show_original", !standalone);
setMenuItemEnabled(menu, "show_original", n_items == 1 && n_links == n_items);
+ setMenuItemVisible(menu, "favorites_add", can_favorite);
+ setMenuItemVisible(menu, "favorites_remove", can_unfavorite);
setMenuItemVisible(menu, "take_off", mask == MASK_CLOTHING && n_worn == n_items);
setMenuItemVisible(menu, "detach", mask == MASK_ATTACHMENT && n_worn == n_items);
setMenuItemVisible(menu, "take_off_or_detach", mask == (MASK_ATTACHMENT|MASK_CLOTHING));
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index 92f63a1820..60d9a5da23 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -454,6 +454,9 @@
name="InventoryBackgroundColor"
reference="DkGray2" />
<color
+ name="InventoryFavoriteColor"
+ reference="Yellow" />
+ <color
name="InventoryFocusOutlineColor"
reference="White_25" />
<color
diff --git a/indra/newview/skins/default/textures/icons/Icon_Pointer.png b/indra/newview/skins/default/textures/icons/Icon_Pointer.png
new file mode 100644
index 0000000000..021942a8aa
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Icon_Pointer.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png
new file mode 100644
index 0000000000..b71b202234
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png
new file mode 100644
index 0000000000..7d55fb5cfe
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 97468c3b2e..d650e7e791 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -306,6 +306,8 @@ with the same filename but different name
<texture name="Inv_CallingCard" file_name="icons/Inv_CallingCard.png" preload="false" />
<texture name="Inv_Clothing" file_name="icons/Inv_Clothing.png" preload="false" />
<texture name="Inv_Eye" file_name="icons/Inv_Eye.png" preload="false" />
+ <texture name="Inv_Favorite_Star_Content" file_name="icons/Inv_Favorite_Star_Content.png" preload="false" />
+ <texture name="Inv_Favorite_Star_Full" file_name="icons/Inv_Favorite_Star_Full.png" preload="false" />
<texture name="Inv_FolderClosed" file_name="icons/Inv_FolderClosed.png" preload="false" />
<texture name="Inv_FolderOpen" file_name="icons/Inv_FolderOpen.png" preload="false" />
<texture name="Inv_Gesture" file_name="icons/Inv_Gesture.png" preload="false" />
@@ -907,4 +909,5 @@ with the same filename but different name
<texture name="Single_Folder_Up" file_name="icons/single_folder_up.png" preload="true"/>
<texture name="Icon_Color_Palette" file_name="icons/Icon_Color_Palette.png" preload="false"/>
<texture name="Icon_Font_Size" file_name="icons/Icon_Font_Size.png" preload="false"/>
+ <texture name="Icon_Pointer" file_name="icons/Icon_Pointer.png" preload="false"/>
</textures>
diff --git a/indra/newview/skins/default/xui/en/floater_inventory_settings.xml b/indra/newview/skins/default/xui/en/floater_inventory_settings.xml
index 156bba6c27..08b7a7af05 100644
--- a/indra/newview/skins/default/xui/en/floater_inventory_settings.xml
+++ b/indra/newview/skins/default/xui/en/floater_inventory_settings.xml
@@ -4,8 +4,8 @@
can_minimize="true"
can_resize="false"
save_rect="true"
- height="370"
- width="370"
+ height="483"
+ width="483"
name="inventory_settings"
title="INVENTORY SETTINGS">
<icon
@@ -16,7 +16,7 @@
left="18"
mouse_opaque="true"
name="multi_folder_icon"
- top="25"
+ top="20"
width="18" />
<text
type="string"
@@ -40,10 +40,10 @@
font="SansSerifMedium"
left="60"
width="300"
- height="70"
+ height="66"
name="multi_double_click_setting">
<radio_item
- height="20"
+ height="18"
label="Expands &amp; collapses folder"
label_text.text_color="White"
follows="left|top"
@@ -51,24 +51,24 @@
name="0"
width="200"/>
<radio_item
- height="20"
+ height="18"
follows="left|top"
label="Opens a new window"
label_text.text_color="White"
layout="topleft"
left_delta="0"
name="1"
- top_pad ="5"
+ top_pad ="3"
width="200" />
<radio_item
- height="20"
+ height="18"
follows="left|top"
label="Switches view"
label_text.text_color="White"
layout="topleft"
left_delta="0"
name="2"
- top_pad ="5"
+ top_pad ="3"
width="200" />
</radio_group>
<icon
@@ -79,7 +79,7 @@
left="18"
mouse_opaque="true"
name="single_folder_icon"
- top_pad="30"
+ top_pad="19"
width="18" />
<text
type="string"
@@ -103,10 +103,10 @@
font="SansSerifMedium"
left="60"
width="300"
- height="45"
+ height="44"
name="single_double_click_setting">
<radio_item
- height="20"
+ height="18"
label="Stays in current window"
label_text.text_color="White"
follows="left|top"
@@ -114,27 +114,37 @@
name="false"
width="200"/>
<radio_item
- height="20"
+ height="18"
follows="left|top"
label="Opens a new window"
label_text.text_color="White"
layout="topleft"
left_delta="0"
name="true"
- top_pad ="5"
+ top_pad ="3"
width="200" />
</radio_group>
+ <icon
+ follows="top|left"
+ height="15"
+ image_name="Icon_Pointer"
+ layout="topleft"
+ left="20"
+ mouse_opaque="true"
+ name="single_folder_icon"
+ top_pad="20"
+ width="15" />
<text
type="string"
length="1"
follows="left|top|right"
height="13"
layout="topleft"
- left="48"
+ left_pad="13"
name="find_original_txt"
font="SansSerifMedium"
text_color="White"
- top_pad="30"
+ top_delta="1"
width="300">
Clicking on "Show in inventory" or "Find original"
</text>
@@ -146,10 +156,10 @@
font="SansSerifMedium"
left="60"
width="300"
- height="45"
+ height="44"
name="find_original_settings">
<radio_item
- height="20"
+ height="18"
label="Shows item in main inventory window"
label_text.text_color="White"
follows="left|top"
@@ -157,23 +167,136 @@
name="false"
width="200"/>
<radio_item
- height="20"
+ height="18"
follows="left|top"
label="Opens a new single-folder window"
label_text.text_color="White"
layout="topleft"
left_delta="0"
name="true"
- top_pad ="5"
+ top_pad ="3"
width="200" />
</radio_group>
- <button
- height="20"
- label="OK"
- layout="topleft"
- left="140"
- bottom="-20"
- name="ok_btn"
- label_color="White"
- width="90" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="Inv_Favorite_Star_Full"
+ layout="topleft"
+ left="18"
+ mouse_opaque="true"
+ name="favorites_icon"
+ top_pad="19"
+ width="18" />
+ <text
+ type="string"
+ length="1"
+ layout="topleft"
+ follows="left|top|right"
+ height="13"
+ left_pad="12"
+ top_delta="2"
+ name="favorites_txt"
+ font="SansSerifMedium"
+ text_color="White"
+ width="300">
+ Favorites
+ </text>
+ <check_box
+ control_name="InventoryFavoritesUseStar"
+ layout="topleft"
+ follows="left|top"
+ top_pad="8"
+ font="SansSerifMedium"
+ left="60"
+ width="300"
+ height="18"
+ label="Star on favorite items"
+ name="favorite_star"
+ label_text.text_color="White"
+ initial_value="false"/>
+ <check_box
+ control_name="InventoryFavoritesUseHollowStar"
+ follows="left|top"
+ top_pad="5"
+ layout="topleft"
+ font="SansSerifMedium"
+ left="60"
+ width="150"
+ height="18"
+ label="Star on folders containing a favorite"
+ name="favorite_hollow_star"
+ label_text.text_color="White"
+ initial_value="false"/>
+ <check_box
+ control_name="InventoryFavoritesColorText"
+ follows="left|top"
+ top_pad="5"
+ layout="topleft"
+ font="SansSerifMedium"
+ left="60"
+ width="150"
+ height="18"
+ label="Colored text"
+ name="favorites_color"
+ label_text.text_color="White"
+ initial_value="false"/>
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ layout="topleft"
+ height="24"
+ label_height="0"
+ left_pad="40"
+ name="favorites_swatch"
+ top_delta="-6"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="InventoryFavoriteColor" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="InventoryFavoriteColor" />
+ </color_swatch>
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="Inv_Object"
+ layout="topleft"
+ left="18"
+ mouse_opaque="true"
+ name="obj_icon"
+ top_pad="19"
+ width="18" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top|right"
+ height="13"
+ layout="topleft"
+ left_pad="12"
+ top_delta="2"
+ name="single_folder_txt"
+ font="SansSerifMedium"
+ text_color="White"
+ width="300">
+ Pressing return on an avatar attachment
+ </text>
+ <combo_box
+ control_name="InventoryAddAttachmentBehavior"
+ layout="topleft"
+ follows="left|top"
+ top_pad="8"
+ height="24"
+ left="60"
+ name="attach_combo"
+ width="300">
+ <combo_box.item
+ label="Adds attachment (recommended)"
+ name="0"
+ value="0"/>
+ <combo_box.item
+ label="Wear (removes attachment at that point)"
+ name="1"
+ value="1"/>
+ </combo_box>
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_preview_trash.xml b/indra/newview/skins/default/xui/en/floater_preview_trash.xml
index f1c87c8c5a..ebb5cd9251 100644
--- a/indra/newview/skins/default/xui/en/floater_preview_trash.xml
+++ b/indra/newview/skins/default/xui/en/floater_preview_trash.xml
@@ -29,6 +29,8 @@
bevel_style="none"
scroll.reserve_scroll_corner="false">
<folder folder_arrow_image="Folder_Arrow"
+ favorite_image="Inv_Favorite_Star_Full"
+ favorite_content_image="Inv_Favorite_Star_Content"
folder_indentation="8"
item_height="20"
item_top_pad="4"
diff --git a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml
index ef9e26d8be..3c2c581d2c 100644
--- a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml
@@ -442,6 +442,22 @@
function="Inventory.DoToSelected"
parameter="ungroup_folder_items" />
</menu_item_call>
+ <menu_item_call
+ label="Add to Favorites"
+ layout="topleft"
+ name="Add to Favorites">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="add_to_favorites" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from Favorites"
+ layout="topleft"
+ name="Remove from Favorites">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="remove_from_favorites" />
+ </menu_item_call>
<menu
label="Use as default for"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
index 99cee83f4e..fb68193006 100755
--- a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
+++ b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
@@ -50,6 +50,26 @@
function="Outfit.Thumbnail" />
</menu_item_call>
<menu_item_call
+ label="Add to favorites"
+ layout="topleft"
+ name="favorites_add">
+ <on_visible
+ function="Outfit.OnVisible"
+ parameter="favorites_add" />
+ <on_click
+ function="Outfit.Favorite" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from favorites"
+ layout="topleft"
+ name="favorites_remove">
+ <on_visible
+ function="Outfit.OnVisible"
+ parameter="favorites_remove" />
+ <on_click
+ function="Outfit.Favorite" />
+ </menu_item_call>
+ <menu_item_call
label="Edit outfit"
layout="topleft"
name="edit">
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index 60e73ebb10..de2326165e 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -934,7 +934,7 @@
function="Inventory.EnvironmentEnabled" />
</menu_item_call>
</menu>
- </menu>
+ </menu>
<menu_item_call
label="Create folder from selected"
layout="topleft"
@@ -951,6 +951,22 @@
function="Inventory.DoToSelected"
parameter="ungroup_folder_items" />
</menu_item_call>
+ <menu_item_call
+ label="Add to Favorites"
+ layout="topleft"
+ name="Add to Favorites">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="add_to_favorites" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from Favorites"
+ layout="topleft"
+ name="Remove from Favorites">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="remove_from_favorites" />
+ </menu_item_call>
<menu
label="Upload to folder"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
index e249acaccd..d17fbf84b3 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
@@ -138,4 +138,15 @@
function="Inventory.GearDefault.Visible"
parameter="multi_folder_view" />
</menu_item_call>
+ <menu_item_separator/>
+ <menu_item_check
+ label="Inventory settings..."
+ name="inv_settings">
+ <menu_item_check.on_check
+ function="Floater.Visible"
+ parameter="inventory_settings" />
+ <menu_item_check.on_click
+ function="Floater.Toggle"
+ parameter="inventory_settings" />
+ </menu_item_check>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml
index 33cf01493d..97f53d3a17 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml
@@ -100,15 +100,4 @@
function="Inventory.GearDefault.Visible"
parameter="single_folder_view" />
</menu_item_check>
- <menu_item_separator/>
- <menu_item_check
- label="Inventory settings..."
- name="inv_settings">
- <menu_item_check.on_check
- function="Floater.Visible"
- parameter="inventory_settings" />
- <menu_item_check.on_click
- function="Floater.Toggle"
- parameter="inventory_settings" />
- </menu_item_check>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gallery_sort.xml b/indra/newview/skins/default/xui/en/menu_outfit_gallery_sort.xml
new file mode 100644
index 0000000000..aa4cd1483d
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_outfit_gallery_sort.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<toggleable_menu
+ layout="topleft"
+ visible="false"
+ name="Sort Outfit">
+ <menu_item_check
+ label="Sort favorites to top"
+ layout="topleft"
+ visible="true"
+ name="sort_favorites_to_top">
+ <on_click
+ function="Sort.OnSort"
+ parameter="favorites_to_top" />
+ <on_check
+ function="Sort.OnEnable"
+ parameter="favorites_to_top" />
+ </menu_item_check>
+ <menu_item_check
+ label="Sort images to top"
+ layout="topleft"
+ visible="true"
+ name="sort_images_to_top">
+ <on_click
+ function="Sort.OnSort"
+ parameter="images_to_top" />
+ <on_check
+ function="Sort.OnEnable"
+ parameter="images_to_top" />
+ </menu_item_check>
+ <menu_item_check
+ label="Sort by name"
+ layout="topleft"
+ visible="true"
+ name="sort_by_name">
+ <on_click
+ function="Sort.OnSort"
+ parameter="by_name" />
+ <on_check
+ function="Sort.OnEnable"
+ parameter="by_name" />
+ </menu_item_check>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
index 8f36c7a00a..e333b05d3e 100644
--- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
@@ -50,6 +50,26 @@
function="Gear.Thumbnail" />
</menu_item_call>
<menu_item_call
+ label="Add to favorite outfits"
+ layout="topleft"
+ name="favorites_add">
+ <on_visible
+ function="Gear.OnVisible"
+ parameter="favorites_add" />
+ <on_click
+ function="Gear.Favorite" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from favorite outfits"
+ layout="topleft"
+ name="favorites_remove">
+ <on_visible
+ function="Gear.OnVisible"
+ parameter="favorites_remove" />
+ <on_click
+ function="Gear.Favorite" />
+ </menu_item_call>
+ <menu_item_call
label="Rename outfit"
layout="topleft"
name="rename">
@@ -89,34 +109,6 @@
function="Gear.OnVisible"
parameter="delete" />
</menu_item_call>
- <menu_item_separator>
- <on_visible
- function="Gear.OnVisible"/>
- </menu_item_separator>
- <menu_item_check
- label="Sort folders always by name"
- layout="topleft"
- name="sort_folders_by_name">
- <on_click
- function="Gear.SortByName" />
- <on_check
- function="CheckControl"
- parameter="OutfitGallerySortByName" />
- </menu_item_check>
- <menu_item_call
- label="Expand all folders"
- layout="topleft"
- name="expand">
- <on_click
- function="Gear.Expand" />
- </menu_item_call>
- <menu_item_call
- label="Collapse all folders"
- layout="topleft"
- name="collapse">
- <on_click
- function="Gear.Collapse" />
- </menu_item_call>
<menu_item_separator/>
<!-- copied (with minor modifications) from menu_inventory_add.xml -->
<!-- *TODO: generate dynamically? -->
@@ -277,4 +269,19 @@
</menu_item_call>
</menu>
<!-- copied from menu_inventory_add.xml -->
+
+ <menu_item_separator/>
+
+ <menu_item_check
+ label="Inventory settings..."
+ layout="topleft"
+ visible="true"
+ name="inventory_settings">
+ <menu_item_check.on_check
+ function="Floater.Visible"
+ parameter="inventory_settings" />
+ <menu_item_check.on_click
+ function="Floater.Toggle"
+ parameter="inventory_settings" />
+ </menu_item_check>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_list_sort.xml b/indra/newview/skins/default/xui/en/menu_outfit_list_sort.xml
new file mode 100644
index 0000000000..0a4d1ea877
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_outfit_list_sort.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<toggleable_menu
+ layout="topleft"
+ visible="false"
+ name="Sort Outfit">
+ <menu_item_call
+ label="Expand all folders"
+ layout="topleft"
+ name="expand">
+ <on_click
+ function="Sort.Expand" />
+ </menu_item_call>
+ <menu_item_call
+ label="Collapse all folders"
+ layout="topleft"
+ visible="true"
+ name="collapse">
+ <on_click
+ function="Sort.Collapse" />
+ </menu_item_call>
+
+ <menu_item_separator/>
+
+ <menu_item_check
+ label="Sort favorites to top"
+ layout="topleft"
+ name="sort_favorites_to_top">
+ <on_click
+ function="Sort.OnSort"
+ parameter="favorites_to_top" />
+ <on_check
+ function="Sort.OnEnable"
+ parameter="favorites_to_top" />
+ </menu_item_check>
+
+ <menu_item_separator/>
+
+ <menu_item_check
+ label="Show entire outfit in search"
+ layout="topleft"
+ name="show_entire_outfit_in_search">
+ <on_click
+ function="Sort.OnSort"
+ parameter="show_entire_outfit" />
+ <on_check
+ function="Sort.OnEnable"
+ parameter="show_entire_outfit" />
+ </menu_item_check>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_outfit_tab.xml
index c6805edd63..0d45e7c95c 100644
--- a/indra/newview/skins/default/xui/en/menu_outfit_tab.xml
+++ b/indra/newview/skins/default/xui/en/menu_outfit_tab.xml
@@ -50,6 +50,26 @@
function="Outfit.Thumbnail" />
</menu_item_call>
<menu_item_call
+ label="Add to favorites"
+ layout="topleft"
+ name="favorites_add">
+ <on_visible
+ function="Outfit.OnVisible"
+ parameter="favorites_add" />
+ <on_click
+ function="Outfit.Favorite" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from favorites"
+ layout="topleft"
+ name="favorites_remove">
+ <on_visible
+ function="Outfit.OnVisible"
+ parameter="favorites_remove" />
+ <on_click
+ function="Outfit.Favorite" />
+ </menu_item_call>
+ <menu_item_call
label="Edit outfit"
layout="topleft"
name="edit">
diff --git a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
index ee77ef23f0..63d37edf38 100644
--- a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
+++ b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
@@ -80,6 +80,20 @@
function="Attachment.Profile" />
</menu_item_call>
<menu_item_call
+ label="Add to favorites"
+ layout="topleft"
+ name="favorites_add">
+ <on_click
+ function="Attachment.Favorite" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from favorites"
+ layout="topleft"
+ name="favorites_remove">
+ <on_click
+ function="Attachment.Favorite" />
+ </menu_item_call>
+ <menu_item_call
label="Show Original"
layout="topleft"
visible="false"
diff --git a/indra/newview/skins/default/xui/en/menu_wearing_tab.xml b/indra/newview/skins/default/xui/en/menu_wearing_tab.xml
index 321e8a0831..9a752a1643 100644
--- a/indra/newview/skins/default/xui/en/menu_wearing_tab.xml
+++ b/indra/newview/skins/default/xui/en/menu_wearing_tab.xml
@@ -31,6 +31,20 @@
function="Wearing.Detach"
parameter="detach"/>
</menu_item_call>
+ <menu_item_call
+ label="Add to favorites"
+ layout="topleft"
+ name="favorites_add">
+ <on_click
+ function="Wearing.Favorite" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from favorites"
+ layout="topleft"
+ name="favorites_remove">
+ <on_click
+ function="Wearing.Favorite" />
+ </menu_item_call>
<menu_item_separator
layout="topleft"
name="edit_outfit_separator" />
diff --git a/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml b/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml
index 73cb9b080f..f5906c17fd 100644
--- a/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml
@@ -43,6 +43,16 @@
follows="left|top"
visible="false"
image_name="Inv_Link"/>
+ <icon
+ layout="topleft"
+ follows="left|top"
+ name="fav_icon"
+ left="110"
+ top_pad="-14"
+ height="14"
+ width="14"
+ visible="true"
+ image_name="Inv_Favorite_Star_Full"/>
<panel
background_visible="false"
background_opaque="true"
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 498dab1ef3..6e1e6facbe 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -269,6 +269,22 @@
scroll.reserve_scroll_corner="false">
<folder double_click_override="true"/>
</inventory_panel>
+ <favorites_inventory_panel
+ bg_opaque_color="DkGray2"
+ bg_alpha_color="DkGray2"
+ background_visible="true"
+ border="false"
+ bevel_style="none"
+ follows="all"
+ label="FAVORITES"
+ help_topic="recent_inventory_tab"
+ layout="topleft"
+ name="Favorites"
+ show_item_link_overlays="true"
+ preinitialize_views="false"
+ scroll.reserve_scroll_corner="false">
+ <folder double_click_override="true"/>
+ </favorites_inventory_panel>
</tab_container>
</panel>
<panel
diff --git a/indra/newview/skins/default/xui/en/panel_outfit_gallery.xml b/indra/newview/skins/default/xui/en/panel_outfit_gallery.xml
index 6bd491f7a3..96624e7aa2 100644
--- a/indra/newview/skins/default/xui/en/panel_outfit_gallery.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfit_gallery.xml
@@ -35,7 +35,7 @@
</text>
<scroll_container
follows="all"
- height="400"
+ height="429"
width="312"
layout="topleft"
left="4"
@@ -44,49 +44,5 @@
name="gallery_scroll_panel"
opaque="false"
top_pad="0">
- </scroll_container>
- <panel
- background_visible="true"
- follows="bottom|left|right"
- height="28"
- layout="topleft"
- left="4"
- top_pad="0"
- visible="true"
- name="bottom_panel"
- width="312">
- <menu_button
- follows="bottom|left"
- tool_tip="Show additional options"
- height="25"
- image_hover_unselected="Toolbar_Left_Over"
- image_overlay="OptionsMenu_Off"
- image_selected="Toolbar_Left_Selected"
- image_unselected="Toolbar_Left_Off"
- layout="topleft"
- left="0"
- name="options_gear_btn"
- top="1"
- width="31" />
- <icon
- follows="bottom|left|right"
- height="25"
- image_name="Toolbar_Middle_Off"
- layout="topleft"
- left_pad="1"
- name="dummy_icon"
- width="243"/>
- <button
- follows="bottom|right"
- height="25"
- image_hover_unselected="Toolbar_Right_Over"
- image_overlay="TrashItem_Off"
- image_selected="Toolbar_Right_Selected"
- image_unselected="Toolbar_Right_Off"
- layout="topleft"
- left_pad="1"
- name="trash_btn"
- tool_tip="Delete selected outfit"
- width="31"/>
- </panel>
+ </scroll_container>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_outfits_list.xml b/indra/newview/skins/default/xui/en/panel_outfits_list.xml
index 9281a21fbf..b38e2b2b50 100644
--- a/indra/newview/skins/default/xui/en/panel_outfits_list.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfits_list.xml
@@ -16,7 +16,7 @@
bg_opaque_color="DkGray2"
follows="all"
- height="400"
+ height="428"
layout="topleft"
left="3"
name="outfits_accordion"
@@ -30,48 +30,4 @@
name="no_outfits_msg"
value="You don't have any outfits yet. Try [secondlife:///app/search/all/ Search]"/>
</accordion>
- <panel
- background_visible="true"
- follows="bottom|left|right"
- height="28"
- layout="topleft"
- left="4"
- top_pad="0"
- visible="true"
- name="bottom_panel"
- width="312">
- <menu_button
- follows="bottom|left"
- tool_tip="Show additional options"
- height="25"
- image_hover_unselected="Toolbar_Left_Over"
- image_overlay="OptionsMenu_Off"
- image_selected="Toolbar_Left_Selected"
- image_unselected="Toolbar_Left_Off"
- layout="topleft"
- left="0"
- name="options_gear_btn"
- top="1"
- width="31" />
- <icon
- follows="bottom|left|right"
- height="25"
- image_name="Toolbar_Middle_Off"
- layout="topleft"
- left_pad="1"
- name="dummy_icon"
- width="243"/>
- <button
- follows="bottom|right"
- height="25"
- image_hover_unselected="Toolbar_Right_Over"
- image_overlay="TrashItem_Off"
- image_selected="Toolbar_Right_Selected"
- image_unselected="Toolbar_Right_Off"
- layout="topleft"
- left_pad="1"
- name="trash_btn"
- tool_tip="Delete selected outfit"
- width="31"/>
- </panel>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml b/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml
index a486c03ac7..ceefe9f6fb 100644
--- a/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml
@@ -16,7 +16,7 @@
<accordion
fit_parent="true"
follows="all"
- height="400"
+ height="429"
layout="topleft"
left="3"
single_expansion="true"
@@ -62,35 +62,4 @@
</scroll_list>
</accordion_tab>
</accordion>
- <panel
- background_visible="true"
- follows="bottom|left|right"
- height="28"
- layout="topleft"
- left="4"
- name="bottom_panel"
- top_pad="0"
- width="312">
- <menu_button
- follows="bottom|left"
- height="25"
- image_hover_unselected="Toolbar_Left_Over"
- image_overlay="OptionsMenu_Off"
- image_selected="Toolbar_Left_Selected"
- image_unselected="Toolbar_Left_Off"
- layout="topleft"
- left="0"
- name="options_gear_btn"
- tool_tip="Show additional options"
- top="1"
- width="31" />
- <icon
- follows="bottom|left|right"
- height="25"
- image_name="Toolbar_Right_Off"
- layout="topleft"
- left_pad="1"
- name="dummy_icon"
- width="274" />
- </panel>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml
index a3a2f7c47e..1bda5c019c 100644
--- a/indra/newview/skins/default/xui/en/panel_places.xml
+++ b/indra/newview/skins/default/xui/en/panel_places.xml
@@ -19,7 +19,7 @@ background_visible="true"
value="VISITED" />
<string
name="favorites_tab_title"
- value="FAVORITES" />
+ value="FAVORITES BAR" />
<string
name="tooltip_trash_items"
value="Remove selected landmark or folder" />
diff --git a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml
index c898b0989e..a16b0b58da 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml
@@ -64,7 +64,7 @@ width="333">
font="SansSerifSmall"
text_color="EmphasisColor"
width="300"
- height="10"
+ height="13"
follows="top|left|right"
layout="topleft"
left="35"
@@ -94,7 +94,7 @@ width="333">
image_overlay="Edit_Wrench"
label=""
layout="topleft"
- left="265"
+ right="-3"
name="edit_outfit_btn"
tool_tip="Edit this outfit"
top="3"
@@ -108,17 +108,100 @@ width="333">
top="6"
width="24" />
</panel>
- <filter_editor
- height="23"
- follows="left|top|right"
- layout="topleft"
- left="10"
- label="Filter Outfits"
- max_length_chars="300"
- name="Filter"
- search_button_visible="true"
- top_pad="10"
- width="307" />
+ <layout_stack
+ animate="false"
+ border_size="0"
+ follows="left|top|right"
+ height="27"
+ layout="topleft"
+ orientation="horizontal"
+ top_pad="6"
+ left="0"
+ name="top_menu_panel"
+ width="320">
+ <layout_panel
+ auto_resize="true"
+ layout="topleft"
+ name="filter_panel"
+ width="193">
+ <filter_editor
+ text_pad_left="10"
+ follows="left|top|right"
+ font="SansSerifSmall"
+ height="23"
+ layout="topleft"
+ left="10"
+ label="Filter Outfits"
+ max_length_chars="300"
+ name="Filter"
+ search_button_visible="true"
+ tab_group="1"
+ top="3"
+ width="181" />
+ </layout_panel>
+ <layout_panel
+ auto_resize="false"
+ height="25"
+ layout="topleft"
+ name="options_gear_btn_panel"
+ width="32">
+ <menu_button
+ follows="bottom|left"
+ tool_tip="Show additional options"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="OptionsMenu_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ menu_position="bottomleft"
+ layout="topleft"
+ left="0"
+ name="options_gear_btn"
+ top="0"
+ width="31" />
+ </layout_panel>
+ <layout_panel
+ auto_resize="false"
+ height="25"
+ layout="topleft"
+ name="options_sort_btn_panel"
+ width="32">
+ <menu_button
+ follows="bottom|left"
+ tool_tip="Show sorting options"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="Conv_toolbar_sort"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ menu_position="bottomleft"
+ layout="topleft"
+ left="0"
+ name="sorting_menu_btn"
+ top="0"
+ width="31" />
+ </layout_panel>
+ <layout_panel
+ auto_resize="false"
+ height="25"
+ layout="topleft"
+ name="trash_btn_panel"
+ width="31">
+ <dnd_button
+ follows="bottom|left"
+ height="25"
+ image_hover_unselected="Toolbar_Right_Over"
+ image_overlay="TrashItem_Off"
+ image_selected="Toolbar_Right_Selected"
+ image_unselected="Toolbar_Right_Off"
+ left="0"
+ layout="topleft"
+ name="trash_btn"
+ tool_tip="Delete selected outfit"
+ top="0"
+ width="31"/>
+ </layout_panel>
+ </layout_stack>
<panel
class="panel_outfits_inventory"
filename="panel_outfits_inventory.xml"
@@ -129,7 +212,7 @@ width="333">
visible="false"
left="0"
tab_group="1"
- top_pad="6"
+ top_pad="4"
follows="all" />
<panel
class="panel_outfit_edit"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index bee58da6b0..d3cb997825 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -594,7 +594,7 @@ http://secondlife.com/support for help fixing this problem.
<string name="Validator_ShouldBeASCII">Invalid character [NR]: '[CH]' (should only be an ASCII character)</string>
<string name="Validator_ShouldBeNewLineOrASCII">Invalid character [NR]: '[CH]' (should only be an ASCII character or a new line)</string>
- <!-- LSL Usage Hover Tips -->
+ <!-- LSL Usage Hover Tips -->
<!-- NOTE: For now these are set as translate="false", until DEV-40761 is implemented (to internationalize the rest of tooltips in the same window).
This has no effect on viewer code, but prevents Linden Lab internal localization tool from scraping these strings. -->
<string name="LSLTipSleepTime" translate="false">
@@ -2320,8 +2320,9 @@ 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="PlacesNoMatchingItems">To add a place to your landmarks, click the star to the right of the location name.</string>
+ <string name="InventoryNoMatchingRecentItems">Didn't find what you're looking for? Try [secondlife:///app/inventory/filters Show filters].</string>
+ <string name="InventoryNoMatchingFavorites">You haven't marked any items as favorites.</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, click the star to the right of the location name, then save the landmark to "Favorites bar".</string>
<string name="MarketplaceNoListing">You have no listings yet.</string>
<string name="MarketplaceNoMatchingItems">No items found. Check the spelling of your search string and try again.</string>
diff --git a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
index b598bbccd8..50c5285e04 100644
--- a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<folder_view_item
folder_arrow_image="Folder_Arrow"
+ favorite_image="Inv_Favorite_Star_Full"
+ favorite_content_image="Inv_Favorite_Star_Content"
folder_indentation="8"
item_height="20"
item_top_pad="4"
diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
index 27ec6ded81..865c145022 100644
--- a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
+++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<inbox_folder_view_folder
folder_arrow_image="Folder_Arrow"
+ favorite_image="Inv_Favorite_Star_Full"
+ favorite_content_image="Inv_Favorite_Star_Content"
folder_indentation="8"
item_height="20"
item_top_pad="4"