From 0480e29597a354279119c28839710b54bc030bc7 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 10 Jun 2010 15:42:23 +0300 Subject: EXT-7609 FIXED Added worn items indication in Appearance panel. - Added (worn) suffix to indicate worn item of LLPanelInventoryListItemBase type (all flat list items in Appearance panel). - Used LLOutfitObserver for updating (worn) suffix when user wears an item from My Outfits list. - Added updating only items and links to items with specific UUIDs in LLWearableItemsList. Reviewed by Vadim Savchuk https://codereview.productengine.com/secondlife/r/551/ --HG-- branch : product-engine --- indra/newview/llwearableitemslist.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'indra/newview/llwearableitemslist.cpp') diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 6c410cf7a5..888dedb340 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -38,7 +38,6 @@ #include "llagentwearables.h" #include "llappearancemgr.h" #include "llinventoryfunctions.h" -#include "llinventorymodel.h" #include "llmenugl.h" // for LLContextMenu #include "lltransutil.h" #include "llviewerattachmenu.h" @@ -510,6 +509,37 @@ void LLWearableItemsList::updateList(const LLUUID& category_id) refreshList(item_array); } +void LLWearableItemsList::updateChangedItems(const LLInventoryModel::changed_items_t& changed_items_uuids) +{ + typedef std::vector item_panel_list_t; + + item_panel_list_t items; + getItems(items); + + for (item_panel_list_t::iterator items_iter = items.begin(); + items_iter != items.end(); + ++items_iter) + { + LLPanelInventoryListItemBase* item = dynamic_cast(*items_iter); + if (!item) continue; + + LLViewerInventoryItem* inv_item = item->getItem(); + if (!inv_item) continue; + + LLUUID linked_uuid = inv_item->getLinkedUUID(); + + for (LLInventoryModel::changed_items_t::iterator iter = changed_items_uuids.begin(); + iter != changed_items_uuids.end(); + ++iter) + { + if (linked_uuid == *iter) + { + item->setNeedsRefresh(true); + } + } + } +} + void LLWearableItemsList::onRightClick(S32 x, S32 y) { uuid_vec_t selected_uuids; -- cgit v1.2.3 From d73001043471156b90224b7ab4f886a99add577c Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 10 Jun 2010 17:24:37 +0300 Subject: FIXED win build. --HG-- branch : product-engine --- indra/newview/llwearableitemslist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llwearableitemslist.cpp') diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 888dedb340..283a510ccd 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -528,7 +528,7 @@ void LLWearableItemsList::updateChangedItems(const LLInventoryModel::changed_ite LLUUID linked_uuid = inv_item->getLinkedUUID(); - for (LLInventoryModel::changed_items_t::iterator iter = changed_items_uuids.begin(); + for (LLInventoryModel::changed_items_t::const_iterator iter = changed_items_uuids.begin(); iter != changed_items_uuids.end(); ++iter) { -- cgit v1.2.3 From 968c7cf90685acbe8554a1843d5bb0c9fd9658e7 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Thu, 10 Jun 2010 21:33:07 +0300 Subject: EXT-7511 FIXED Resolved newly reported problems in appearance UI - Selection top cropping problem reproduces only for some systems and is caused by deeper problems in flatlist, so in this case it was fixed via workaround (increasing of item pad in flatlists) and the cause of it is in new ticket- EXT-7752 (Flatlist selection is a bit different on different systems). - '+' button now has a 3 px pad from right for consistensy with "wrench" from other items. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/549/ --HG-- branch : product-engine --- indra/newview/llwearableitemslist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llwearableitemslist.cpp') diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 283a510ccd..abcc442170 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -306,7 +306,7 @@ BOOL LLPanelDummyClothingListItem::postBuild() setIconCtrl(icon); setTitleCtrl(getChild("item_name")); - addWidgetToRightSide("btn_add"); + addWidgetToRightSide("btn_add_panel"); setIconImage(LLInventoryIcon::getIcon(LLAssetType::AT_CLOTHING, LLInventoryType::IT_NONE, FALSE, mWearableType, FALSE)); updateItem(); -- cgit v1.2.3 From 680ef887a24dd8adb35514bcf10ca60671867fee Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 11 Jun 2010 17:47:11 +0300 Subject: EXT-7625 FIXED Removed inappropriate items from the Add Wearables panel context menu. We can now distinguish LLWearableItemsList instances used in My Outfits from the one used in the Add Wearable panels, and show/enable different menu items for them. Being limited in time, I implemented this via a XUI parameter called "standalone": the Add Wearable list is standalone, the others aren't. Although it would be of course more flexible to have separate subclasses. --HG-- branch : product-engine --- indra/newview/llwearableitemslist.cpp | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'indra/newview/llwearableitemslist.cpp') diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 54695e9d40..2eb6bd0df2 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -452,15 +452,17 @@ static const LLWearableItemTypeNameComparator WEARABLE_TYPE_NAME_COMPARATOR; static const LLDefaultChildRegistry::Register r("wearable_items_list"); LLWearableItemsList::Params::Params() -: use_internal_context_menu("use_internal_context_menu", true) +: standalone("standalone", true) {} LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p) : LLInventoryItemsList(p) { setComparator(&WEARABLE_TYPE_NAME_COMPARATOR); - if (p.use_internal_context_menu) + mIsStandalone = p.standalone; + if (mIsStandalone) { + // Use built-in context menu. setRightMouseDownCallback(boost::bind(&LLWearableItemsList::onRightClick, this, _2, _3)); } } @@ -555,6 +557,18 @@ void LLWearableItemsList::onRightClick(S32 x, S32 y) /// ContextMenu ////////////////////////////////////////////////////////////////////////// +LLWearableItemsList::ContextMenu::ContextMenu() +: mParent(NULL) +{ +} + +void LLWearableItemsList::ContextMenu::show(LLView* spawning_view, const uuid_vec_t& uuids, S32 x, S32 y) +{ + mParent = dynamic_cast(spawning_view); + LLListContextMenu::show(spawning_view, uuids, x, y); + mParent = NULL; // to avoid dereferencing an invalid pointer +} + // virtual LLContextMenu* LLWearableItemsList::ContextMenu::createMenu() { @@ -642,17 +656,21 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu } } // for + bool standalone = mParent ? mParent->isStandalone() : false; + // *TODO: eliminate multiple traversals over the menu items + setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0); setMenuItemVisible(menu, "wear", n_worn == 0); - setMenuItemVisible(menu, "edit", mask & (MASK_CLOTHING|MASK_BODYPART) && n_items == 1); - setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1); + setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART)); + setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1); setMenuItemVisible(menu, "create_new", mask & (MASK_CLOTHING|MASK_BODYPART) && n_items == 1); + setMenuItemVisible(menu, "show_original", !standalone); setMenuItemEnabled(menu, "show_original", n_items == 1 && n_links == n_items); 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)); setMenuItemEnabled(menu, "take_off_or_detach", n_worn == n_items); - setMenuItemVisible(menu, "object_profile", mask & (MASK_ATTACHMENT|MASK_CLOTHING)); + setMenuItemVisible(menu, "object_profile", !standalone); setMenuItemEnabled(menu, "object_profile", n_items == 1); // Populate or hide the "Attach to..." / "Attach to HUD..." submenus. -- cgit v1.2.3 From ab399e0cd5dfe4045f275ac3e8ee9b02266ac780 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 10 Jun 2010 22:49:25 +0300 Subject: EXT-7609 FIXED Item name (worn) suffix made searchable. - Wearable list items filter now searches sub-string in whole item title including (worn) suffix. - Removed (worn) indication from items which don't need it in Edit Outfit. Only worn items can be edited there. - Added null pointer checks for inventory item member of LLPanelInventoryListItemBase class and its descendants. Reviewed by Vadim Savchuk https://codereview.productengine.com/secondlife/r/551/. --HG-- branch : product-engine --- indra/newview/llwearableitemslist.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'indra/newview/llwearableitemslist.cpp') diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 2eb6bd0df2..f86838194e 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -126,6 +126,19 @@ BOOL LLPanelWearableOutfitItem::handleDoubleClick(S32 x, S32 y, MASK mask) return LLUICtrl::handleDoubleClick(x, y, mask); } +// virtual +void LLPanelWearableOutfitItem::updateItem(const std::string& name) +{ + std::string search_label = name; + + if (mItem && get_is_item_worn(mItem->getUUID())) + { + search_label += LLTrans::getString("worn"); + } + + LLPanelInventoryListItemBase::updateItem(search_label); +} + LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item) : LLPanelInventoryListItemBase(item) { @@ -292,12 +305,6 @@ LLPanelDummyClothingListItem* LLPanelDummyClothingListItem::create(LLWearableTyp return list_item; } -void LLPanelDummyClothingListItem::updateItem() -{ - std::string title = wearableTypeToString(mWearableType); - setTitle(title, LLStringUtil::null); -} - BOOL LLPanelDummyClothingListItem::postBuild() { LLIconCtrl* icon = getChild("item_icon"); @@ -307,7 +314,7 @@ BOOL LLPanelDummyClothingListItem::postBuild() addWidgetToRightSide("btn_add_panel"); setIconImage(LLInventoryIcon::getIcon(LLAssetType::AT_CLOTHING, LLInventoryType::IT_NONE, mWearableType, FALSE)); - updateItem(); + updateItem(wearableTypeToString(mWearableType)); // Make it look loke clothing item - reserve space for 'delete' button setLeftWidgetsWidth(icon->getRect().mLeft); -- cgit v1.2.3