diff options
-rw-r--r-- | indra/newview/CMakeLists.txt | 3 | ||||
-rw-r--r-- | indra/newview/llagentwearables.cpp | 40 | ||||
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 64 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.h | 1 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 78 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.h | 22 | ||||
-rw-r--r-- | indra/newview/llpanelappearancetab.h | 22 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitsinventory.cpp | 424 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitsinventory.h | 54 | ||||
-rw-r--r-- | indra/newview/llpanelwearing.cpp | 130 | ||||
-rw-r--r-- | indra/newview/llpanelwearing.h | 73 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.h | 11 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_outfits_inventory.xml | 37 |
15 files changed, 400 insertions, 591 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c1b2d680be..ce42cb6038 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -363,6 +363,7 @@ set(viewer_SOURCE_FILES llpaneltopinfobar.cpp llpanelvolume.cpp llpanelvolumepulldown.cpp + llpanelwearing.cpp llparcelselection.cpp llparticipantlist.cpp llpatchvertexarray.cpp @@ -830,6 +831,7 @@ set(viewer_HEADER_FILES lloutfitslist.h lloutfitobserver.h lloutputmonitorctrl.h + llpanelappearancetab.h llpanelavatar.h llpanelavatartag.h llpanelblockedlist.h @@ -883,6 +885,7 @@ set(viewer_HEADER_FILES llpaneltopinfobar.h llpanelvolume.h llpanelvolumepulldown.h + llpanelwearing.h llparcelselection.h llparticipantlist.h llpatchvertexarray.h diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 5728256dba..017fcf6e2b 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -48,7 +48,6 @@ #include "llmd5.h" #include "llnotificationsutil.h" #include "lloutfitobserver.h" -#include "llpaneloutfitsinventory.h" #include "llsidepanelappearance.h" #include "llsidetray.h" #include "lltexlayer.h" @@ -1232,45 +1231,6 @@ void LLAgentWearables::createStandardWearablesAllDone() gAgentAvatarp->onFirstTEMessageReceived(); } - -class LLShowCreatedOutfit: public LLInventoryCallback -{ -public: - LLShowCreatedOutfit(LLUUID& folder_id): - mFolderID(folder_id) - { - } - - virtual ~LLShowCreatedOutfit() - { - LLSD key; - LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key); - LLPanelOutfitsInventory *outfit_panel = - dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory")); - // TODO: add handling "My Outfits" tab. - if (outfit_panel && outfit_panel->isCOFPanelActive()) - { - outfit_panel->getRootFolder()->clearSelection(); - outfit_panel->getRootFolder()->setSelectionByID(mFolderID, TRUE); - } - LLAccordionCtrlTab* tab_outfits = outfit_panel ? outfit_panel->findChild<LLAccordionCtrlTab>("tab_outfits") : 0; - if (tab_outfits && !tab_outfits->getDisplayChildren()) - { - tab_outfits->changeOpenClose(tab_outfits->getDisplayChildren()); - } - - LLAppearanceMgr::instance().updateIsDirty(); - LLAppearanceMgr::instance().updatePanelOutfitName(""); - } - - virtual void fire(const LLUUID&) - { - } - -private: - LLUUID mFolderID; -}; - void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index) { LLUUID first_item_id = getWearableItemID((LLWearableType::EType)type, index); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index f088a620d6..597076503d 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -45,7 +45,7 @@ #include "llinventoryobserver.h" #include "llnotificationsutil.h" #include "lloutfitobserver.h" -#include "llpaneloutfitsinventory.h" +#include "lloutfitslist.h" #include "llselectmgr.h" #include "llsidepanelappearance.h" #include "llsidetray.h" @@ -2306,18 +2306,11 @@ public: { LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key); } - LLPanelOutfitsInventory *outfit_panel = - dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory")); - if (outfit_panel) + LLOutfitsList *outfits_list = + dynamic_cast<LLOutfitsList*>(LLSideTray::getInstance()->getPanel("outfitslist_tab")); + if (outfits_list) { - outfit_panel->getRootFolder()->clearSelection(); - outfit_panel->getRootFolder()->setSelectionByID(mFolderID, TRUE); - } - - LLAccordionCtrlTab* tab_outfits = outfit_panel ? outfit_panel->findChild<LLAccordionCtrlTab>("tab_outfits") : 0; - if (tab_outfits && !tab_outfits->getDisplayChildren()) - { - tab_outfits->changeOpenClose(tab_outfits->getDisplayChildren()); + outfits_list->setSelectedOutfitByUUID(mFolderID); } LLAppearanceMgr::getInstance()->updateIsDirty(); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index afaeddaaeb..a5f24c55fe 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -72,7 +72,6 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llwearablelist.h" -#include "llpaneloutfitsinventory.h" typedef std::pair<LLUUID, LLUUID> two_uuids_t; typedef std::list<two_uuids_t> two_uuids_list_t; @@ -511,17 +510,6 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, { const LLInventoryObject *obj = getInventoryObject(); - bool is_sidepanel = isInOutfitsSidePanel(); - if (is_sidepanel) - { - // Sidepanel includes restricted menu. - if (obj && obj->getIsLinkType() && !get_is_item_worn(mUUID)) - { - items.push_back(std::string("Remove Link")); - } - return; - } - if (obj) { if (obj->getIsLinkType()) @@ -948,16 +936,6 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid) } } -BOOL LLInvFVBridge::isInOutfitsSidePanel() const -{ - LLInventoryPanel *my_panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); - LLPanelOutfitsInventory *outfit_panel = - dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory")); - if (!outfit_panel) - return FALSE; - return outfit_panel->isTabPanel(my_panel); -} - BOOL LLInvFVBridge::canShare() const { const LLInventoryModel* model = getInventoryModel(); @@ -2430,17 +2408,8 @@ void LLFolderBridge::folderOptionsMenu() const bool is_ensemble = (type == LLFolderType::FT_NONE || LLFolderType::lookupIsEnsembleType(type)); - // calling card related functionality for folders. - - const bool is_sidepanel = isInOutfitsSidePanel(); - if (is_sidepanel) - { - mItems.push_back("Rename"); - addDeleteContextMenuOptions(mItems, disabled_items); - } - // Only enable calling-card related options for non-system folders. - if (!is_sidepanel && !is_system_folder) + if (!is_system_folder) { LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) @@ -2469,10 +2438,7 @@ void LLFolderBridge::folderOptionsMenu() checkFolderForContentsOfType(model, is_object) || checkFolderForContentsOfType(model, is_gesture) ) { - if (!is_sidepanel) - { - mItems.push_back(std::string("Folder Wearables Separator")); - } + mItems.push_back(std::string("Folder Wearables Separator")); // Only enable add/replace outfit for non-system folders. if (!is_system_folder) @@ -3763,13 +3729,6 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { disabled_items.push_back(std::string("Share")); } - bool is_sidepanel = isInOutfitsSidePanel(); - - if (!is_sidepanel) - { - addOpenRightClickMenuOption(items); - items.push_back(std::string("Properties")); - } getClipboardEntries(true, items, disabled_items, flags); @@ -4071,12 +4030,8 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { disabled_items.push_back(std::string("Share")); } - bool is_sidepanel = isInOutfitsSidePanel(); - if (!is_sidepanel) - { - items.push_back(std::string("Properties")); - } + items.push_back(std::string("Properties")); getClipboardEntries(true, items, disabled_items, flags); @@ -4431,24 +4386,17 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { disabled_items.push_back(std::string("Share")); } - bool is_sidepanel = isInOutfitsSidePanel(); - if (can_open && !is_sidepanel) + if (can_open) { addOpenRightClickMenuOption(items); } - if (!is_sidepanel) - { - items.push_back(std::string("Properties")); - } + items.push_back(std::string("Properties")); getClipboardEntries(true, items, disabled_items, flags); - if (!is_sidepanel) - { - items.push_back(std::string("Wearable Separator")); - } + items.push_back(std::string("Wearable Separator")); items.push_back(std::string("Wearable Edit")); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 64d0f8d254..97e87c2f3b 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -74,7 +74,6 @@ public: U32 flags = 0x00); virtual ~LLInvFVBridge() {} - BOOL isInOutfitsSidePanel() const; // allow context menus to be customized for side panel BOOL canShare() const; //-------------------------------------------------------------------- diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index b3d39f2a4a..a285926a8b 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -162,7 +162,7 @@ protected: static LLRegisterPanelClassWrapper<LLOutfitsList> t_outfits_list("outfits_list"); LLOutfitsList::LLOutfitsList() - : LLPanel() + : LLPanelAppearanceTab() , mAccordion(NULL) , mListCommands(NULL) , mIsInitialized(false) @@ -313,7 +313,7 @@ void LLOutfitsList::refreshList(const LLUUID& category_id) // If filter is currently applied we store the initial tab state and // open it to show matched items if any. - if (!mFilterSubString.empty()) + if (!sFilterSubString.empty()) { tab->notifyChildren(LLSD().with("action","store_state")); tab->setDisplayChildren(true); @@ -323,7 +323,7 @@ void LLOutfitsList::refreshList(const LLUUID& category_id) // filter to the newly added list. list->setForceRefresh(true); - list->setFilterSubString(mFilterSubString); + list->setFilterSubString(sFilterSubString); } } @@ -415,14 +415,74 @@ void LLOutfitsList::performAction(std::string action) } } +void LLOutfitsList::removeSelected() +{ + if (mSelectedOutfitUUID.notNull()) + { + remove_category(&gInventory, mSelectedOutfitUUID); + } +} + +void LLOutfitsList::setSelectedOutfitByUUID(const LLUUID& outfit_uuid) +{ + for (outfits_map_t::iterator iter = mOutfitsMap.begin(); + iter != mOutfitsMap.end(); + ++iter) + { + if (outfit_uuid == iter->first) + { + LLAccordionCtrlTab* tab = iter->second; + if (!tab) continue; + + LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView()); + if (!list) continue; + + tab->setFocus(TRUE); + changeOutfitSelection(list, outfit_uuid); + + tab->setDisplayChildren(true); + } + } +} + +// virtual void LLOutfitsList::setFilterSubString(const std::string& string) { applyFilter(string); - mFilterSubString = string; + sFilterSubString = string; +} + +bool LLOutfitsList::isActionEnabled(const LLSD& userdata) +{ + const std::string command_name = userdata.asString(); + if (command_name == "delete") + { + return !mItemSelected && LLAppearanceMgr::instance().getCanRemoveOutfit(mSelectedOutfitUUID); + } + if (command_name == "rename") + { + return get_is_category_renameable(&gInventory, mSelectedOutfitUUID); + } + if (command_name == "save_outfit") + { + bool outfit_locked = LLAppearanceMgr::getInstance()->isOutfitLocked(); + bool outfit_dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); + // allow save only if outfit isn't locked and is dirty + return !outfit_locked && outfit_dirty; + } + if (command_name == "wear") + { + return mSelectedOutfitUUID.notNull(); + } + if (command_name == "take_off") + { + return LLAppearanceMgr::getInstance()->getBaseOutfitUUID() == mSelectedOutfitUUID; + } + return false; } -boost::signals2::connection LLOutfitsList::addSelectionChangeCallback(selection_change_callback_t cb) +boost::signals2::connection LLOutfitsList::setSelectionChangeCallback(selection_change_callback_t cb) { return mSelectionChangeSignal.connect(cb); } @@ -558,7 +618,7 @@ void LLOutfitsList::restoreOutfitSelection(LLAccordionCtrlTab* tab, const LLUUID void LLOutfitsList::onFilteredWearableItemsListRefresh(LLUICtrl* ctrl) { - if (!ctrl || mFilterSubString.empty()) + if (!ctrl || sFilterSubString.empty()) return; for (outfits_map_t::iterator @@ -572,7 +632,7 @@ void LLOutfitsList::onFilteredWearableItemsListRefresh(LLUICtrl* ctrl) LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView()); if (list != ctrl) continue; - applyFilterToTab(iter->first, tab, mFilterSubString); + applyFilterToTab(iter->first, tab, sFilterSubString); } } @@ -588,7 +648,7 @@ void LLOutfitsList::applyFilter(const std::string& new_filter_substring) LLAccordionCtrlTab* tab = iter->second; if (!tab) continue; - bool more_restrictive = mFilterSubString.size() < new_filter_substring.size() && !new_filter_substring.substr(0, mFilterSubString.size()).compare(mFilterSubString); + bool more_restrictive = sFilterSubString.size() < new_filter_substring.size() && !new_filter_substring.substr(0, sFilterSubString.size()).compare(sFilterSubString); // Restore tab visibility in case of less restrictive filter // to compare it with updated string if it was previously hidden. @@ -603,7 +663,7 @@ void LLOutfitsList::applyFilter(const std::string& new_filter_substring) list->setFilterSubString(new_filter_substring); } - if(mFilterSubString.empty() && !new_filter_substring.empty()) + if(sFilterSubString.empty() && !new_filter_substring.empty()) { //store accordion tab state when filter is not empty tab->notifyChildren(LLSD().with("action","store_state")); diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index a6b9a66836..14a1aab415 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -37,12 +37,14 @@ // newview #include "llinventorymodel.h" -#include "llinventoryobserver.h" +#include "llpanelappearancetab.h" class LLAccordionCtrlTab; +class LLInventoryCategoriesObserver; class LLWearableItemsList; class LLListContextMenu; + /** * @class LLOutfitTabNameComparator * @@ -66,9 +68,9 @@ public: * which displays each outfit in an accordion tab with a flat list * of items inside it. * - * Starts fetching nevessary inventory content on first openning. + * Starts fetching necessary inventory content on first opening. */ -class LLOutfitsList : public LLPanel +class LLOutfitsList : public LLPanelAppearanceTab { public: typedef boost::function<void (const LLUUID&)> selection_change_callback_t; @@ -88,11 +90,17 @@ public: void performAction(std::string action); - void setFilterSubString(const std::string& string); + void removeSelected(); + + void setSelectedOutfitByUUID(const LLUUID& outfit_uuid); + + /*virtual*/ void setFilterSubString(const std::string& string); + + /*virtual*/ bool isActionEnabled(const LLSD& userdata); const LLUUID& getSelectedOutfitUUID() const { return mSelectedOutfitUUID; } - boost::signals2::connection addSelectionChangeCallback(selection_change_callback_t cb); + boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb); /** * Returns true if there is a selection inside currently selected outfit @@ -184,13 +192,11 @@ private: LLUUID mHighlightedOutfitUUID; selection_change_signal_t mSelectionChangeSignal; - std::string mFilterSubString; - typedef std::map<LLUUID, LLAccordionCtrlTab*> outfits_map_t; typedef outfits_map_t::value_type outfits_map_value_t; outfits_map_t mOutfitsMap; - LLListContextMenu* mOutfitMenu; + LLListContextMenu* mOutfitMenu; bool mIsInitialized; /** diff --git a/indra/newview/llpanelappearancetab.h b/indra/newview/llpanelappearancetab.h index c2f8dbd074..af984c521c 100644 --- a/indra/newview/llpanelappearancetab.h +++ b/indra/newview/llpanelappearancetab.h @@ -1,6 +1,6 @@ /** - * @file llpanelplacestab.h - * @brief Tabs interface for Side Bar "Places" panel + * @file llpanelappearancetab.h + * @brief Tabs interface for Side Bar "My Appearance" panel * * $LicenseInfo:firstyear=2009&license=viewergpl$ * @@ -34,28 +34,20 @@ #include "llpanel.h" -#include "llpanelappearance.h" - class LLPanelAppearanceTab : public LLPanel { public: - LLPanelAppearanceTab(LLPanelAppearance *parent) : - LLPanel(), - mParent(parent) - {} + LLPanelAppearanceTab() : LLPanel() {} virtual ~LLPanelAppearanceTab() {} - virtual void onSearchEdit(const std::string& string) = 0; - virtual void updateVerbs() = 0; // Updates buttons at the bottom of Appearance panel - virtual void onWear() = 0; - virtual void onEdit() = 0; - virtual void onNew() = 0; + virtual void setFilterSubString(const std::string& string) = 0; - bool isTabVisible(); // Check if parent TabContainer is visible. + virtual bool isActionEnabled(const LLSD& userdata) = 0; + static const std::string& getFilterSubString() { return sFilterSubString; } protected: - LLPanelAppearance* mParent; + static std::string sFilterSubString; }; #endif //LL_LLPANELAPPEARANCETAB_H diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 77c135c716..57c82b7ac4 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -33,40 +33,23 @@ #include "llpaneloutfitsinventory.h" -#include "llagent.h" -#include "llagentwearables.h" -#include "llappearancemgr.h" +#include "llmenugl.h" +#include "llnotificationsutil.h" +#include "lltabcontainer.h" -#include "llbutton.h" -#include "llfloaterreg.h" -#include "llfloaterworldmap.h" -#include "llfloaterinventory.h" -#include "llfoldervieweventlistener.h" -#include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventorymodelbackgroundfetch.h" -#include "llinventorypanel.h" -#include "lllandmark.h" -#include "lllineeditor.h" -#include "llmodaldialog.h" -#include "llnotificationsutil.h" +#include "llagentwearables.h" +#include "llappearancemgr.h" #include "lloutfitobserver.h" #include "lloutfitslist.h" +#include "llpanelwearing.h" #include "llsaveoutfitcombobtn.h" #include "llsidepanelappearance.h" #include "llsidetray.h" -#include "lltabcontainer.h" #include "llviewerfoldertype.h" -#include "llviewerjointattachment.h" -#include "llvoavatarself.h" - -// List Commands -#include "lldndbutton.h" -#include "llmenugl.h" #include "llviewermenu.h" -#include "llviewercontrol.h" - static const std::string OUTFITS_TAB_NAME = "outfitslist_tab"; static const std::string COF_TAB_NAME = "cof_tab"; @@ -246,11 +229,10 @@ private: LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mMyOutfitsPanel(NULL), mCurrentOutfitPanel(NULL), + mActivePanel(NULL), mGearMenu(NULL), mInitialized(false) { - mSavedFolderState = new LLSaveFolderState(); - mSavedFolderState->setApply(FALSE); gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoaded, this)); gAgentWearables.addLoadingStartedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoading, this)); @@ -263,7 +245,6 @@ LLPanelOutfitsInventory::LLPanelOutfitsInventory() : LLPanelOutfitsInventory::~LLPanelOutfitsInventory() { delete mGearMenu; - delete mSavedFolderState; } // virtual @@ -305,7 +286,8 @@ void LLPanelOutfitsInventory::onOpen(const LLSD& key) // and update verbs. onTabChange(); - // Auto open the first outfit newly created so new users can see sample outfit contents + // *TODO: Auto open the first outfit newly created so new users can see sample outfit contents + /* static bool should_open_outfit = true; if (should_open_outfit && gAgent.isFirstLogin()) { @@ -325,6 +307,7 @@ void LLPanelOutfitsInventory::onOpen(const LLSD& key) } } should_open_outfit = false; + */ } void LLPanelOutfitsInventory::updateVerbs() @@ -338,93 +321,30 @@ void LLPanelOutfitsInventory::updateVerbs() // virtual void LLPanelOutfitsInventory::onSearchEdit(const std::string& string) { - mFilterSubString = string; + if (!mActivePanel) return; - // TODO: add handling "My Outfits" tab. - if (!isCOFPanelActive()) - { - mMyOutfitsPanel->setFilterSubString(string); - return; - } + mFilterSubString = string; if (string == "") { - getActivePanel()->setFilterSubString(LLStringUtil::null); - - // re-open folders that were initially open - mSavedFolderState->setApply(TRUE); - getRootFolder()->applyFunctorRecursively(*mSavedFolderState); - LLOpenFoldersWithSelection opener; - getRootFolder()->applyFunctorRecursively(opener); - getRootFolder()->scrollToShowSelection(); + mActivePanel->setFilterSubString(LLStringUtil::null); } LLInventoryModelBackgroundFetch::instance().start(); - if (getActivePanel()->getFilterSubString().empty() && string.empty()) + if (mActivePanel->getFilterSubString().empty() && string.empty()) { // current filter and new filter empty, do nothing return; } - // save current folder open state if no filter currently applied - if (getRootFolder()->getFilterSubString().empty()) - { - mSavedFolderState->setApply(FALSE); - getRootFolder()->applyFunctorRecursively(*mSavedFolderState); - } - // set new filter string - getActivePanel()->setFilterSubString(string); + mActivePanel->setFilterSubString(string); } void LLPanelOutfitsInventory::onWearButtonClick() { - // TODO: Remove if/else, add common interface - // for "My Outfits" and "Wearing" tabs. - if (!isCOFPanelActive()) - { - mMyOutfitsPanel->performAction("replaceoutfit"); - } - else - { - LLFolderViewEventListener* listenerp = getCorrectListenerForAction(); - if (listenerp) - { - listenerp->performAction(NULL, "replaceoutfit"); - } - } -} - -void LLPanelOutfitsInventory::onAdd() -{ - // TODO: Remove if/else, add common interface - // for "My Outfits" and "Wearing" tabs. - if (!isCOFPanelActive()) - { - mMyOutfitsPanel->performAction("addtooutfit"); - } - else - { - LLFolderViewEventListener* listenerp = getCorrectListenerForAction(); - if (listenerp) - { - listenerp->performAction(NULL, "addtooutfit"); - } - } -} - -void LLPanelOutfitsInventory::onRemove() -{ - LLFolderViewEventListener* listenerp = getCorrectListenerForAction(); - if (listenerp) - { - listenerp->performAction(NULL, "removefromoutfit"); - } -} - -void LLPanelOutfitsInventory::onEdit() -{ + mMyOutfitsPanel->performAction("replaceoutfit"); } bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD& response) @@ -454,8 +374,6 @@ bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD& return false; } - - void LLPanelOutfitsInventory::onSave() { std::string outfit_name; @@ -483,57 +401,6 @@ void LLPanelOutfitsInventory::onSave() }*/ } -void LLPanelOutfitsInventory::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action) -{ - updateVerbs(); - - // TODO: add handling "My Outfits" tab. - if (!isCOFPanelActive()) - return; - - if (getRootFolder()->needsAutoRename() && items.size()) - { - getRootFolder()->startRenamingSelectedItem(); - getRootFolder()->setNeedsAutoRename(FALSE); - } -} - -LLFolderViewEventListener *LLPanelOutfitsInventory::getCorrectListenerForAction() -{ - // TODO: add handling "My Outfits" tab. - if (!isCOFPanelActive()) - return NULL; - - LLFolderViewItem* current_item = getRootFolder()->getCurSelectedItem(); - if (!current_item) - return NULL; - - LLFolderViewEventListener* listenerp = current_item->getListener(); - if (getIsCorrectType(listenerp)) - { - return listenerp; - } - return NULL; -} - -bool LLPanelOutfitsInventory::getIsCorrectType(const LLFolderViewEventListener *listenerp) const -{ - if (listenerp->getInventoryType() == LLInventoryType::IT_CATEGORY) - { - LLViewerInventoryCategory *cat = gInventory.getCategory(listenerp->getUUID()); - if (cat && cat->getPreferredType() == LLFolderType::FT_OUTFIT) - { - return true; - } - } - return false; -} - -LLFolderView *LLPanelOutfitsInventory::getRootFolder() -{ - return getActivePanel()->getRootFolder(); -} - //static LLPanelOutfitsInventory* LLPanelOutfitsInventory::findInstance() { @@ -551,13 +418,6 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() mListCommands->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this)); mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this)); - LLDragAndDropButton* trash_btn = mListCommands->getChild<LLDragAndDropButton>("trash_btn"); - trash_btn->setDragAndDropHandler(boost::bind(&LLPanelOutfitsInventory::handleDragAndDropToTrash, this - , _4 // BOOL drop - , _5 // EDragAndDropType cargo_type - , _7 // EAcceptance* accept - )); - mGearMenu = new LLOutfitListGearMenu(mMyOutfitsPanel, this); } @@ -568,6 +428,9 @@ void LLPanelOutfitsInventory::updateListCommands() bool wear_visible = !isCOFPanelActive(); bool make_outfit_enabled = isActionEnabled("save_outfit"); + // *TODO: Enable gear menu for Wearing tab. + childSetEnabled("options_gear_btn", wear_visible); + mListCommands->childSetEnabled("trash_btn", trash_enabled); mListCommands->childSetEnabled("wear_btn", wear_enabled); mListCommands->childSetVisible("wear_btn", wear_visible); @@ -584,263 +447,52 @@ void LLPanelOutfitsInventory::showGearMenu() void LLPanelOutfitsInventory::onTrashButtonClick() { - onClipboardAction("delete"); -} + mMyOutfitsPanel->removeSelected(); -void LLPanelOutfitsInventory::onClipboardAction(const LLSD& userdata) -{ - std::string command_name = userdata.asString(); - if (isCOFPanelActive()) - { - getActivePanel()->getRootFolder()->doToSelected(getActivePanel()->getModel(),command_name); - } - else // "My Outfits" tab active - { - if (command_name == "delete") - { - const LLUUID& selected_outfit_id = mMyOutfitsPanel->getSelectedOutfitUUID(); - if (selected_outfit_id.notNull()) - { - remove_category(&gInventory, selected_outfit_id); - } - } - else - { - llwarns << "Unrecognized action" << llendl; - } - } - updateListCommands(); - updateVerbs(); + updateListCommands(); + updateVerbs(); } -void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata) +bool LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) { - if (!isActionEnabled(userdata)) - return; - - const std::string command_name = userdata.asString(); - if (command_name == "new") - { - onSave(); - } - if (command_name == "edit") - { - onEdit(); - } - if (command_name == "wear") - { - onWearButtonClick(); - } - // Note: This option has been removed from the gear menu. - if (command_name == "add") - { - onAdd(); - } - if (command_name == "remove") - { - onRemove(); - } - if (command_name == "rename") - { - onClipboardAction("rename"); - } - if (command_name == "remove_link") - { - onClipboardAction("delete"); - } - if (command_name == "delete") - { - onClipboardAction("delete"); - } - updateListCommands(); - updateVerbs(); -} - -BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) -{ - const std::string command_name = userdata.asString(); - if (command_name == "delete" || command_name == "remove") - { - BOOL can_delete = FALSE; - - if (isCOFPanelActive()) - { - LLFolderView* root = getActivePanel()->getRootFolder(); - if (root) - { - std::set<LLUUID> selection_set = root->getSelectionList(); - can_delete = (selection_set.size() > 0); - for (std::set<LLUUID>::iterator iter = selection_set.begin(); - iter != selection_set.end(); - ++iter) - { - const LLUUID &item_id = (*iter); - LLFolderViewItem *item = root->getItemByID(item_id); - can_delete &= item->getListener()->isItemRemovable(); - } - } - } - else // "My Outfits" tab active - { - const LLUUID& selected_outfit = mMyOutfitsPanel->getSelectedOutfitUUID(); - // first condition prevents trash btn from enabling when items are selected inside outfit (EXT-7847) - can_delete = !mMyOutfitsPanel->hasItemSelected() && LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit); - } - - return can_delete; - } - if (command_name == "remove_link") - { - BOOL can_delete = FALSE; - LLFolderView* root = getActivePanel()->getRootFolder(); - if (root) - { - std::set<LLUUID> selection_set = root->getSelectionList(); - can_delete = (selection_set.size() > 0); - for (std::set<LLUUID>::iterator iter = selection_set.begin(); - iter != selection_set.end(); - ++iter) - { - const LLUUID &item_id = (*iter); - LLViewerInventoryItem *item = gInventory.getItem(item_id); - if (!item || !item->getIsLinkType()) - return FALSE; - } - return can_delete; - } - return FALSE; - } - if (command_name == "rename" || - command_name == "delete_outfit") - { - return (getCorrectListenerForAction() != NULL) && hasItemsSelected(); - } - - if (command_name == "wear") - { + return mActivePanel && mActivePanel->isActionEnabled(userdata); if (gAgentWearables.isCOFChangeInProgress()) return FALSE; - if (isCOFPanelActive()) - { - return FALSE; - } - return hasItemsSelected(); - } - if (command_name == "save_outfit") - { - bool outfit_locked = LLAppearanceMgr::getInstance()->isOutfitLocked(); - bool outfit_dirty =LLAppearanceMgr::getInstance()->isOutfitDirty(); - // allow save only if outfit isn't locked and is dirty - return !outfit_locked && outfit_dirty; - } - - if (command_name == "edit" || - command_name == "add" - ) - { - return (getCorrectListenerForAction() != NULL); - } - return TRUE; -} - -bool LLPanelOutfitsInventory::hasItemsSelected() -{ - bool has_items_selected = false; - - if (isCOFPanelActive()) - { - LLFolderView* root = getActivePanel()->getRootFolder(); - if (root) - { - std::set<LLUUID> selection_set = root->getSelectionList(); - has_items_selected = (selection_set.size() > 0); - } - } - else // My Outfits Tab is active - { - has_items_selected = mMyOutfitsPanel->getSelectedOutfitUUID().notNull(); - } - return has_items_selected; -} - -bool LLPanelOutfitsInventory::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept) -{ - *accept = ACCEPT_NO; - - const bool is_enabled = isActionEnabled("delete"); - if (is_enabled) *accept = ACCEPT_YES_MULTI; - - if (is_enabled && drop) - { - onClipboardAction("delete"); - } - return true; } - -// List Commands // -//////////////////////////////////////////////////////////////////////////////// +// List Commands // +////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// -// Tab panels // +// Tab panels // void LLPanelOutfitsInventory::initTabPanels() { - mCurrentOutfitPanel = getChild<LLInventoryPanel>(COF_TAB_NAME); - mCurrentOutfitPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mCurrentOutfitPanel->setSelectCallback(boost::bind(&LLPanelOutfitsInventory::onTabSelectionChange, this, mCurrentOutfitPanel, _1, _2)); + mCurrentOutfitPanel = getChild<LLPanelWearing>(COF_TAB_NAME); + mCurrentOutfitPanel->setSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); mMyOutfitsPanel = getChild<LLOutfitsList>(OUTFITS_TAB_NAME); - mMyOutfitsPanel->addSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); + mMyOutfitsPanel->setSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); mAppearanceTabs = getChild<LLTabContainer>("appearance_tabs"); mAppearanceTabs->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::onTabChange, this)); } -void LLPanelOutfitsInventory::onTabSelectionChange(LLInventoryPanel* tab_panel, const std::deque<LLFolderViewItem*> &items, BOOL user_action) -{ - if (user_action && items.size() > 0) - { - // TODO: add handling "My Outfits" tab. - if (isCOFPanelActive()) - { - onSelectionChange(items, user_action); - } - else - { - mCurrentOutfitPanel->getRootFolder()->clearSelection(); - } - } -} - void LLPanelOutfitsInventory::onTabChange() { - // TODO: add handling "My Outfits" tab. - if (isCOFPanelActive()) - { - mCurrentOutfitPanel->setFilterSubString(mFilterSubString); - } - else - { - mMyOutfitsPanel->setFilterSubString(mFilterSubString); - mMyOutfitsPanel->onOpen(LLSD()); - } + mActivePanel = dynamic_cast<LLPanelAppearanceTab*>(mAppearanceTabs->getCurrentPanel()); + if (!mActivePanel) return; + + mActivePanel->setFilterSubString(mFilterSubString); + mActivePanel->onOpen(LLSD()); updateVerbs(); } -BOOL LLPanelOutfitsInventory::isTabPanel(LLInventoryPanel *panel) const +bool LLPanelOutfitsInventory::isCOFPanelActive() const { - // TODO: add handling "My Outfits" tab. - if (mCurrentOutfitPanel == panel) - { - return TRUE; - } - return FALSE; -} + if (!mActivePanel) return false; -BOOL LLPanelOutfitsInventory::isCOFPanelActive() const -{ - return (childGetVisibleTab("appearance_tabs")->getName() == COF_TAB_NAME); + return mActivePanel->getName() == COF_TAB_NAME; } void LLPanelOutfitsInventory::setWearablesLoading(bool val) diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 287fcbf4bb..ff5d8b96bc 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -34,20 +34,15 @@ #define LL_LLPANELOUTFITSINVENTORY_H #include "llpanel.h" -#include "llinventoryobserver.h" -class LLFolderView; -class LLFolderViewItem; -class LLFolderViewEventListener; -class LLInventoryPanel; class LLOutfitsList; -class LLSaveFolderState; -class LLButton; +class LLOutfitListGearMenu; +class LLPanelAppearanceTab; +class LLPanelWearing; class LLMenuGL; class LLSidepanelAppearance; class LLTabContainer; class LLSaveOutfitComboBtn; -class LLOutfitListGearMenu; class LLPanelOutfitsInventory : public LLPanel { @@ -60,55 +55,36 @@ public: /*virtual*/ void onOpen(const LLSD& key); void onSearchEdit(const std::string& string); - void onAdd(); - void onRemove(); - void onEdit(); void onSave(); bool onSaveCommit(const LLSD& notification, const LLSD& response); - void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); - - // If a compatible listener type is selected, then return a pointer to that. - // Otherwise, return NULL. - LLFolderViewEventListener* getCorrectListenerForAction(); - - LLFolderView* getRootFolder(); static LLSidepanelAppearance* getAppearanceSP(); static LLPanelOutfitsInventory* findInstance(); protected: void updateVerbs(); - bool getIsCorrectType(const LLFolderViewEventListener *listenerp) const; private: - LLSaveFolderState* mSavedFolderState; LLTabContainer* mAppearanceTabs; std::string mFilterSubString; std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn; -public: - ////////////////////////////////////////////////////////////////////////////////// - // tab panels - // TODO: change getActivePanel() to return the active tab instead of returning - // a pointer to "Wearing" inventory panel. - LLInventoryPanel* getActivePanel() { return mCurrentOutfitPanel; } - - BOOL isTabPanel(LLInventoryPanel *panel) const; - BOOL isCOFPanelActive() const; + ////////////////////////////////////////////////////////////////////////////////// + // tab panels // protected: void initTabPanels(); - void onTabSelectionChange(LLInventoryPanel* tab_panel, const std::deque<LLFolderViewItem*> &items, BOOL user_action); void onTabChange(); + bool isCOFPanelActive() const; private: + LLPanelAppearanceTab* mActivePanel; LLOutfitsList* mMyOutfitsPanel; - LLInventoryPanel* mCurrentOutfitPanel; + LLPanelWearing* mCurrentOutfitPanel; - // tab panels // - //////////////////////////////////////////////////////////////////////////////// - + // tab panels // + ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// // List Commands // @@ -121,10 +97,7 @@ protected: void onWearButtonClick(); void showGearMenu(); void onTrashButtonClick(); - void onClipboardAction(const LLSD& userdata); - void onCustomAction(const LLSD& command_name); - bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept); - bool hasItemsSelected(); + bool isActionEnabled(const LLSD& userdata); void setWearablesLoading(bool val); void onWearablesLoaded(); void onWearablesLoading(); @@ -132,9 +105,8 @@ private: LLPanel* mListCommands; LLOutfitListGearMenu* mGearMenu; LLMenuGL* mMenuAdd; - // List Commands // - //////////////////////////////////////////////////////////////////////////////// - /// + // List Commands // + ////////////////////////////////////////////////////////////////////////////////// bool mInitialized; }; diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp new file mode 100644 index 0000000000..27f13a8093 --- /dev/null +++ b/indra/newview/llpanelwearing.cpp @@ -0,0 +1,130 @@ +/** + * @file llpanelwearing.cpp + * @brief List of agent's worn items. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelwearing.h" + +#include "llappearancemgr.h" +#include "llinventorymodel.h" +#include "llinventoryobserver.h" +#include "llwearableitemslist.h" + + +std::string LLPanelAppearanceTab::sFilterSubString = LLStringUtil::null; + +static LLRegisterPanelClassWrapper<LLPanelWearing> t_panel_wearing("panel_wearing"); + +LLPanelWearing::LLPanelWearing() + : LLPanelAppearanceTab() + , mCOFItemsList(NULL) + , mIsInitialized(false) +{ + mCategoriesObserver = new LLInventoryCategoriesObserver(); +} + +LLPanelWearing::~LLPanelWearing() +{ + if (gInventory.containsObserver(mCategoriesObserver)) + { + gInventory.removeObserver(mCategoriesObserver); + delete mCategoriesObserver; + } +} + +BOOL LLPanelWearing::postBuild() +{ + mCOFItemsList = getChild<LLWearableItemsList>("cof_items_list"); + return TRUE; +} + +//virtual +void LLPanelWearing::onOpen(const LLSD& /*info*/) +{ + if (!mIsInitialized) + { + // *TODO: I'm not sure is this check necessary but it never match while developing. + if (!gInventory.isInventoryUsable()) + return; + + const LLUUID cof = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); + + // *TODO: I'm not sure is this check necessary but it never match while developing. + LLViewerInventoryCategory* category = gInventory.getCategory(cof); + if (!category) + return; + + gInventory.addObserver(mCategoriesObserver); + + // Start observing changes in Current Outfit category. + mCategoriesObserver->addCategory(cof, boost::bind(&LLWearableItemsList::updateList, mCOFItemsList, cof)); + + // Fetch Current Outfit contents and refresh the list to display + // initially fetched items. If not all items are fetched now + // the observer will refresh the list as soon as the new items + // arrive. + category->fetch(); + + mCOFItemsList->updateList(cof); + + mIsInitialized = true; + } +} + +// virtual +void LLPanelWearing::setFilterSubString(const std::string& string) +{ + sFilterSubString = string; + mCOFItemsList->setFilterSubString(sFilterSubString); +} + +bool LLPanelWearing::isActionEnabled(const LLSD& userdata) +{ + const std::string command_name = userdata.asString(); + + if (command_name == "save_outfit") + { + bool outfit_locked = LLAppearanceMgr::getInstance()->isOutfitLocked(); + bool outfit_dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); + // allow save only if outfit isn't locked and is dirty + return !outfit_locked && outfit_dirty; + } + return false; +} + +boost::signals2::connection LLPanelWearing::setSelectionChangeCallback(commit_callback_t cb) +{ + if (!mCOFItemsList) return boost::signals2::connection(); + + return mCOFItemsList->setCommitCallback(cb); +} + +// EOF diff --git a/indra/newview/llpanelwearing.h b/indra/newview/llpanelwearing.h new file mode 100644 index 0000000000..15d0a3dd6d --- /dev/null +++ b/indra/newview/llpanelwearing.h @@ -0,0 +1,73 @@ +/** + * @file llpanelwearing.h + * @brief List of agent's worn items. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELWEARING_H +#define LL_LLPANELWEARING_H + +#include "llpanel.h" + +// newview +#include "llpanelappearancetab.h" + +class LLInventoryCategoriesObserver; +class LLWearableItemsList; + +/** + * @class LLPanelWearing + * + * A list of agents's currently worn items represented by + * a flat list view. + * Starts fetching necessary inventory content on first opening. + */ +class LLPanelWearing : public LLPanelAppearanceTab +{ +public: + LLPanelWearing(); + virtual ~LLPanelWearing(); + + /*virtual*/ BOOL postBuild(); + + /*virtual*/ void onOpen(const LLSD& info); + + /*virtual*/ void setFilterSubString(const std::string& string); + + /*virtual*/ bool isActionEnabled(const LLSD& userdata); + + boost::signals2::connection setSelectionChangeCallback(commit_callback_t cb); + +private: + LLInventoryCategoriesObserver* mCategoriesObserver; + LLWearableItemsList* mCOFItemsList; + + bool mIsInitialized; +}; + +#endif //LL_LLPANELWEARING_H diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 6aa6ebaa54..da15b93697 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -95,19 +95,22 @@ LLPanelWearableListItem::LLPanelWearableListItem(LLViewerInventoryItem* item) ////////////////////////////////////////////////////////////////////////// // static -LLPanelWearableOutfitItem* LLPanelWearableOutfitItem::create(LLViewerInventoryItem* item) +LLPanelWearableOutfitItem* LLPanelWearableOutfitItem::create(LLViewerInventoryItem* item, + bool worn_indication_enabled) { LLPanelWearableOutfitItem* list_item = NULL; if (item) { - list_item = new LLPanelWearableOutfitItem(item); + list_item = new LLPanelWearableOutfitItem(item, worn_indication_enabled); list_item->init(); } return list_item; } -LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item) +LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item, + bool worn_indication_enabled) : LLPanelInventoryListItemBase(item) +, mWornIndicationEnabled(worn_indication_enabled) { } @@ -117,7 +120,7 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name, { std::string search_label = name; - if (get_is_item_worn(mInventoryItemUUID)) + if (mWornIndicationEnabled && get_is_item_worn(mInventoryItemUUID)) { search_label += LLTrans::getString("worn"); item_state = IS_WORN; @@ -444,6 +447,7 @@ static const LLDefaultChildRegistry::Register<LLWearableItemsList> r("wearable_i LLWearableItemsList::Params::Params() : standalone("standalone", true) +, worn_indication_enabled("worn_indication_enabled", true) {} LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p) @@ -456,6 +460,7 @@ LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p) // Use built-in context menu. setRightMouseDownCallback(boost::bind(&LLWearableItemsList::onRightClick, this, _2, _3)); } + mWornIndicationEnabled = p.worn_indication_enabled; } // virtual @@ -471,7 +476,7 @@ void LLWearableItemsList::addNewItem(LLViewerInventoryItem* item, bool rearrange llassert(item != NULL); } - LLPanelWearableOutfitItem *list_item = LLPanelWearableOutfitItem::create(item); + LLPanelWearableOutfitItem *list_item = LLPanelWearableOutfitItem::create(item, mWornIndicationEnabled); if (!list_item) return; diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 2bfb90e3ec..eb82418454 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -82,7 +82,8 @@ class LLPanelWearableOutfitItem : public LLPanelInventoryListItemBase { LOG_CLASS(LLPanelWearableOutfitItem); public: - static LLPanelWearableOutfitItem* create(LLViewerInventoryItem* item); + static LLPanelWearableOutfitItem* create(LLViewerInventoryItem* item, + bool worn_indication_enabled); /** * Updates item name and (worn) suffix. @@ -91,7 +92,11 @@ public: EItemState item_state = IS_DEFAULT); protected: - LLPanelWearableOutfitItem(LLViewerInventoryItem* item); + LLPanelWearableOutfitItem(LLViewerInventoryItem* item, + bool worn_indication_enabled); + +private: + bool mWornIndicationEnabled; }; class LLPanelDeletableWearableListItem : public LLPanelWearableListItem @@ -352,6 +357,7 @@ public: struct Params : public LLInitParam::Block<Params, LLInventoryItemsList::Params> { Optional<bool> standalone; + Optional<bool> worn_indication_enabled; Params(); }; @@ -377,6 +383,7 @@ protected: void onRightClick(S32 x, S32 y); bool mIsStandalone; + bool mWornIndicationEnabled; }; #endif //LL_LLWEARABLEITEMSLIST_H diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml index a59070496e..9cd14c00fc 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml @@ -34,22 +34,31 @@ follows="all" label="MY OUTFITS" layout="topleft" - width="315" /> - <inventory_panel - follows="all" + width="312" /> + <panel background_visible="true" - background_opaque="true" - label="WEARING" + class="panel_wearing" + follows="all" + height="490" help_topic="now_wearing_tab" - allow_multi_select="true" - border="false" - left="0" - top="0" - mouse_opaque="true" + label="WEARING" + layout="topleft" name="cof_tab" - start_folder="Current Outfit" - use_label_suffix="true" - width="315" /> + width="312"> + <wearable_items_list + allow_select="true" + follows="all" + height="490" + keep_one_selected="true" + left="1" + multi_select="true" + name="cof_items_list" + top="0" + translate="false" + width="310" + worn_indication_enabled="false" + /> + </panel> </tab_container> <panel background_visible="true" @@ -84,7 +93,7 @@ width="241" /> - <dnd_button + <button follows="bottom|right" height="25" image_hover_unselected="Toolbar_Right_Over" |