diff options
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llinventoryfunctions.h | 1 | ||||
-rw-r--r-- | indra/newview/llinventorygallerymenu.cpp | 23 | ||||
-rw-r--r-- | indra/newview/lloutfitgallery.cpp | 3 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 46 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png | bin | 474 -> 620 bytes | |||
-rw-r--r-- | indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png | bin | 582 -> 485 bytes | |||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_gallery_inventory.xml | 16 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml | 20 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_outfit_gear.xml | 30 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_outfit_tab.xml | 14 |
13 files changed, 169 insertions, 9 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index b473b3b395..59be1444d9 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -785,7 +785,7 @@ void LLFolderViewItem::drawFavoriteIcon(const Params& default_params, const LLUI if (favorite_image) { const S32 PAD = 2; - const S32 image_size = 30; + const S32 image_size = 18; gl_draw_scaled_image( getRect().getWidth() - image_size - PAD, getRect().getHeight() - mItemHeight + PAD, diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 81be2c1f24..604adea125 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2382,6 +2382,27 @@ void set_favorite(const LLUUID& obj_id, bool favorite) } } +void toggle_favorite(const LLUUID& obj_id) +{ + LLInventoryObject* obj = gInventory.getObject(obj_id); + + LLSD updates; + updates["favorite"] = LLSD().with("toggled", !obj->getIsFavorite()); + + 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); + } +} + std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id) { if (model) diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 44f85bfb3e..fe05e30353 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -115,6 +115,7 @@ 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); 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); diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index 6e5d8802a4..de7ebd5ca8 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -547,6 +547,18 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men items.push_back(std::string("New Outfit")); } + if (!is_trash && !is_in_trash && gInventory.getRootFolderID() != selected_id) + { + if (obj->getIsFavorite()) + { + 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()) { @@ -587,6 +599,17 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men if(is_agent_inventory) { items.push_back(std::string("Cut")); + if (!is_in_trash) + { + if (obj->getIsFavorite()) + { + 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")); diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index efffcefc4a..da2fbebc14 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -1149,6 +1149,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)); @@ -1190,7 +1191,7 @@ void LLOutfitGalleryGearMenu::onUpdateItemsVisibility() mMenu->setItemVisible("expand", FALSE); mMenu->setItemVisible("collapse", FALSE); mMenu->setItemVisible("thumbnail", have_selection); - mMenu->setItemVisible("sort_folders_by_name", TRUE); + mMenu->setItemVisible("sort_order_by_image", TRUE); LLOutfitListGearMenuBase::onUpdateItemsVisibility(); } diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 1a6c5db535..c01e04f88d 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -45,6 +45,7 @@ #include "lloutfitobserver.h" #include "lltoggleablemenu.h" #include "lltransutil.h" +#include "llviewercontrol.h" #include "llviewermenu.h" #include "llvoavatar.h" #include "llvoavatarself.h" @@ -1062,6 +1063,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)); @@ -1112,6 +1114,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; } @@ -1136,6 +1148,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()) @@ -1173,7 +1193,8 @@ LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist) 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)); @@ -1296,6 +1317,10 @@ bool LLOutfitListGearMenuBase::onEnable(LLSD::String param) { return LLAppearanceMgr::instance().getCanReplaceCOF(mOutfitList->getSelectedOutfitUUID()); } + if ("sort_by_image" == param) + { + return !gSavedSettings.getBOOL("OutfitGallerySortByName"); + } return mOutfitList->isActionEnabled(param); } @@ -1307,6 +1332,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; } @@ -1318,6 +1353,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() { @@ -1336,7 +1377,8 @@ void LLOutfitListGearMenu::onUpdateItemsVisibility() 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()); + mMenu->setItemVisible("sort_order_by_image", FALSE); LLOutfitListGearMenuBase::onUpdateItemsVisibility(); } diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 89821f9333..86702cedfb 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -161,6 +161,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: @@ -180,6 +181,7 @@ public: protected: virtual void onUpdateItemsVisibility(); virtual void onThumbnail(); + virtual void onFavorite(); virtual void onChangeSortOrder(); const LLUUID& getSelectedOutfitID(); 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 Binary files differindex bf7ec1599a..b71b202234 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png +++ b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png 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 Binary files differindex 916b57f3c5..7d55fb5cfe 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png +++ b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png 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 929c626947..11c9988dd6 100644 --- a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml @@ -126,6 +126,22 @@ parameter="thumbnail" /> </menu_item_call> <menu_item_call + label="Add to favorites" + layout="topleft" + name="favorites_add"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="favorite" /> + </menu_item_call> + <menu_item_call + label="Remove from favorites" + layout="topleft" + name="favorites_remove"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="favorite" /> + </menu_item_call> + <menu_item_call label="Copy Asset UUID" layout="topleft" name="Copy Asset UUID"> 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..77de521154 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_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml index 8f36c7a00a..794041c083 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"> @@ -94,14 +114,14 @@ function="Gear.OnVisible"/> </menu_item_separator> <menu_item_check - label="Sort folders always by name" + label="Show outfits with images first" layout="topleft" - name="sort_folders_by_name"> + name="sort_order_by_image"> <on_click - function="Gear.SortByName" /> + function="Gear.SortByImage" /> <on_check - function="CheckControl" - parameter="OutfitGallerySortByName" /> + function="Gear.OnEnable" + parameter="sort_by_image" /> </menu_item_check> <menu_item_call label="Expand all folders" 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..070efe9d78 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,20 @@ function="Outfit.Thumbnail" /> </menu_item_call> <menu_item_call + label="Add to favorites" + layout="topleft" + name="favorites_add"> + <on_click + function="Outfit.Favorite" /> + </menu_item_call> + <menu_item_call + label="Remove from favorites" + layout="topleft" + name="favorites_remove"> + <on_click + function="Outfit.Favorite" /> + </menu_item_call> + <menu_item_call label="Edit outfit" layout="topleft" name="edit"> |