From d39ef5ce6fd52a66189e3e14da3a01b14b1d99a2 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 5 May 2010 13:19:24 +0300 Subject: Implemented task EXT-7156 (Appearance panel: "Wear" button should become disabled and a loading indicator should appear next to the outfit name). When user presses the "Wear" button in the outfits list, we disable the button and display a perpetual loading indicator until all wearables of the outfit being worn get loaded. Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/347/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 59c1fb4f3c..e36e63521e 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -77,6 +77,7 @@ LLPanelOutfitsInventory::LLPanelOutfitsInventory() : { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); + gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoaded, this)); } LLPanelOutfitsInventory::~LLPanelOutfitsInventory() @@ -190,6 +191,7 @@ void LLPanelOutfitsInventory::onWearButtonClick() if (!isCOFPanelActive()) { mMyOutfitsPanel->performAction("replaceoutfit"); + setWearablesLoading(true); } else { @@ -642,3 +644,19 @@ BOOL LLPanelOutfitsInventory::isCOFPanelActive() const { return (childGetVisibleTab("appearance_tabs")->getName() == COF_TAB_NAME); } + +void LLPanelOutfitsInventory::setWearablesLoading(bool val) +{ + mListCommands->childSetEnabled("wear_btn", !val); + + llassert(mParent); + if (mParent) + { + mParent->setWearablesLoading(val); + } +} + +void LLPanelOutfitsInventory::onWearablesLoaded() +{ + setWearablesLoading(false); +} -- cgit v1.2.3 From 183122bc1dae8832c3dd728bfe76144165a0d2d7 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 7 May 2010 13:44:03 -0400 Subject: EXT-7269 : FIXED : Issue warning dialog when item is deleted that has links pointing to it Warning now comes up if you try to delete an item that has any item links pointing to it (in memory). This assumes that the viewer actually knows about those links, which is true at least in 2.0 since links only appear in Outfits folders and this code causes those to be fetched into memory on startup. --- indra/newview/llpaneloutfitsinventory.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index e36e63521e..111894b31c 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -91,6 +91,15 @@ BOOL LLPanelOutfitsInventory::postBuild() initTabPanels(); initListCommandsHandlers(); + // Fetch your outfits folder so that the links are in memory. + // ( This is only necessary if we want to show a warning if a user deletes an item that has a + // a link in an outfit, see "ConfirmItemDeleteHasLinks". ) + const LLUUID &outfits_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTFIT, false); + if (outfits_cat.notNull()) + { + LLInventoryModelBackgroundFetch::instance().start(outfits_cat); + } + return TRUE; } -- cgit v1.2.3 From 1d6ebfbb573bca573c60d666d12a401c1f21d37d Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 13 May 2010 16:53:29 -0400 Subject: EXT-4088 : FIXED : INFRASTRUCTURE : Change LLFolderView::getSelectionList to return a selection Function signature change to return a selection instead of taking one as an argument. --- indra/newview/llpaneloutfitsinventory.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 111894b31c..660615df5a 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -493,8 +493,7 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) LLFolderView* root = getActivePanel()->getRootFolder(); if (root) { - std::set selection_set; - root->getSelectionList(selection_set); + std::set selection_set = root->getSelectionList(); can_delete = (selection_set.size() > 0); for (std::set::iterator iter = selection_set.begin(); iter != selection_set.end(); @@ -515,8 +514,7 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) LLFolderView* root = getActivePanel()->getRootFolder(); if (root) { - std::set selection_set; - root->getSelectionList(selection_set); + std::set selection_set = root->getSelectionList(); can_delete = (selection_set.size() > 0); for (std::set::iterator iter = selection_set.begin(); iter != selection_set.end(); @@ -568,8 +566,7 @@ bool LLPanelOutfitsInventory::hasItemsSelected() LLFolderView* root = getActivePanel()->getRootFolder(); if (root) { - std::set selection_set; - root->getSelectionList(selection_set); + std::set selection_set = root->getSelectionList(); has_items_selected = (selection_set.size() > 0); } } -- cgit v1.2.3 From 53a5b74af12ec772a2a69cff49b2e52da51c5c8f Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Sat, 15 May 2010 14:40:15 +0300 Subject: EXT-7241 FIXED Changed all "Edit Appearance" links to "Change Outfit" and pointed them to the My Outfits tab. Renamed the following menu items to "Change Outfit" and made them open My Outfits tab: - Avatar in-world context menu -> My Appearance. - Avatar inspector menu -> My Appearance. - Me -> My Appearance. To enable the Appearance SP switch to My outfits I cleaned up the logic of switching between my outfits <-> edit outfit <-> edit wearable panels. Also done the following cleanups and minor improvements: - Removed unused LLSidepanelAppearance::mEditBtn and mLookInfoType members. - Removed empty LLSidepanelAppearance::updateVerbs() method. - Made the "params" argument of LLSideTray::showPanel() and togglePanel() optional. Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/389/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 660615df5a..ea75c16c56 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -134,11 +134,6 @@ void LLPanelOutfitsInventory::onOpen(const LLSD& key) void LLPanelOutfitsInventory::updateVerbs() { - if (mParent) - { - mParent->updateVerbs(); - } - if (mListCommands) { updateListCommands(); -- cgit v1.2.3 From 9aacdbc155b894532a85b18912288691ecb3832c Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 19 May 2010 14:03:29 +0300 Subject: EXT-7242 FIXED Added a new "Edit my Shape" link to avatar self-click context menu and made it open the shape editing panel. Again, as in EXT-7241, I tried to improve the way the appearance panels (outfits / edit outfit / edit wearables) are switched, this time aiming to eliminate redundant time-consuming operations (fetches/updated/etc). I'm not particularly satisfied with the resulting code but it seems to work. A better solution might be to wrap the panels with LLSideTrayPanelContainer. Additional minor changes: - Fixed unsafe pointer cast in LLSidepanelAppearance::editWearable(). - Removed redundant onEditOutfitButtonClicked() and onEditWearBackClicked() methods from LLSidepanelAppearance. Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/395/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index ea75c16c56..0760c57f8e 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -73,7 +73,8 @@ static LLRegisterPanelClassWrapper t_inventory("panel_o LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mMyOutfitsPanel(NULL), mCurrentOutfitPanel(NULL), - mParent(NULL) + mParent(NULL), + mInitialized(false) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); @@ -106,6 +107,18 @@ BOOL LLPanelOutfitsInventory::postBuild() // virtual void LLPanelOutfitsInventory::onOpen(const LLSD& key) { + if (!mInitialized) + { + LLSidepanelAppearance* panel_appearance = getAppearanceSP(); + if (panel_appearance) + { + // *TODO: move these methods to LLPanelOutfitsInventory? + panel_appearance->fetchInventory(); + panel_appearance->refreshCurrentOutfitName(); + } + mInitialized = true; + } + // Make sure we know which tab is selected, update the filter, // and update verbs. onTabChange(); @@ -249,8 +262,7 @@ bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD& { LLUUID outfit_folder = LLAppearanceMgr::getInstance()->makeNewOutfitLinks(outfit_name); - LLSidepanelAppearance* panel_appearance = - dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + LLSidepanelAppearance* panel_appearance = getAppearanceSP(); if (panel_appearance) { panel_appearance->showOutfitsInventoryPanel(); @@ -661,3 +673,11 @@ void LLPanelOutfitsInventory::onWearablesLoaded() { setWearablesLoading(false); } + +LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP() +{ + static LLSidepanelAppearance* panel_appearance = + dynamic_cast + (LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + return panel_appearance; +} -- cgit v1.2.3 From d634239bac4ee94d96a17b4ba68015c9f90b727a Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Thu, 20 May 2010 14:54:34 +0300 Subject: EXT-6726 WIP Added stubs for most of Appearance SP context/gear menus. Shared code with avatar lists context menus. Reviewed by Mike Antipov and Nyx at https://codereview.productengine.com/secondlife/r/415/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 0760c57f8e..a7e8f497d9 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -383,11 +383,8 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() , _7 // EAcceptance* accept )); - mCommitCallbackRegistrar.add("panel_outfits_inventory_gear_default.Custom.Action", - boost::bind(&LLPanelOutfitsInventory::onCustomAction, this, _2)); - mEnableCallbackRegistrar.add("panel_outfits_inventory_gear_default.Enable", - boost::bind(&LLPanelOutfitsInventory::isActionEnabled, this, _2)); - mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile("panel_outfits_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_outfit_gear.xml", + gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); } void LLPanelOutfitsInventory::updateListCommands() -- cgit v1.2.3 From bfced6d4c13b06cc6332583bd8808dee547352c7 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 31 May 2010 15:55:08 +0300 Subject: EXT-7485 FIXED Updated 'save as new' button on inventory outfit pane to fit spec. * moved logic related to combo button from LLPanelOutfitEdit to LLSaveOutfitComboBtn class; * used LLSaveOutfitComboBtn class in LLPanelOutfitsInventory; reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/459/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index a7e8f497d9..21f69d3470 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -50,6 +50,7 @@ #include "llmodaldialog.h" #include "llnotificationsutil.h" #include "lloutfitslist.h" +#include "llsaveoutfitcombobtn.h" #include "llsidepanelappearance.h" #include "llsidetray.h" #include "lltabcontainer.h" @@ -101,6 +102,8 @@ BOOL LLPanelOutfitsInventory::postBuild() LLInventoryModelBackgroundFetch::instance().start(outfits_cat); } + mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this, true)); + return TRUE; } @@ -373,7 +376,6 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() mListCommands->childSetAction("options_gear_btn", boost::bind(&LLPanelOutfitsInventory::onGearButtonClick, this)); mListCommands->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this)); - mListCommands->childSetAction("make_outfit_btn", boost::bind(&LLPanelOutfitsInventory::onAddButtonClick, this)); mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this)); LLDragAndDropButton* trash_btn = mListCommands->getChild("trash_btn"); @@ -396,7 +398,7 @@ void LLPanelOutfitsInventory::updateListCommands() mListCommands->childSetEnabled("trash_btn", trash_enabled); mListCommands->childSetEnabled("wear_btn", wear_enabled); mListCommands->childSetVisible("wear_btn", wear_enabled); - mListCommands->childSetEnabled("make_outfit_btn", make_outfit_enabled); + mSaveComboBtn->setSaveBtnEnabled(make_outfit_enabled); } void LLPanelOutfitsInventory::onGearButtonClick() @@ -404,11 +406,6 @@ void LLPanelOutfitsInventory::onGearButtonClick() showActionMenu(mMenuGearDefault,"options_gear_btn"); } -void LLPanelOutfitsInventory::onAddButtonClick() -{ - onSave(); -} - void LLPanelOutfitsInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) { if (menu) -- cgit v1.2.3 From 671625695fc44adc430a7ddf3be158ce26a61cc6 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 2 Jun 2010 20:46:16 +0300 Subject: EXT-6726 WIP Added more menus to the Appearance SP. Done: - Implemented creating new wearables via My Outfits gear menu. - Implemented renaming/removing/editing an outfit via My Outfits context menu. - Implemented "Attach to..." / "Attach to HUD..." context submenus. - Now disabling (instead of hiding) irrelevant wearable context menu items. - Added "Take Off / Detach" context menu item that's shown for clothes and attachments. Useful if you selected a bunch of items and want to take them all off. - Fixed taking off an outfit (not all wearables were taken off because of a wrong inventory collector). - Fixed crash when editing a skirt (reference to a missing string). - In LLWearableItemsList::ContextMenu::updateItemsVisibility renamed variables and introduced MASK_UNKNOWN per Nyx's request. Known issues: - "Attach to..." context menus may be displayed partially off-screen (there is the same bug in the inventory panel). - The way we invoke wearable editing panel after the wearable gets created is currently a hack. TODO: - Wear / take off / rename / delete an outfit via My Outfits gear menu (currently not implemented because of missing selection support in My Outfits). - Add "Create new..." to body part / clothing context menu in Edit Outfit. - Add "Create new..." submenus to the Edit Outfit gear menu. Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/466/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 89 +++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 21f69d3470..6fb016cdfd 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -42,6 +42,7 @@ #include "llfloaterworldmap.h" #include "llfloaterinventory.h" #include "llfoldervieweventlistener.h" +#include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventorymodelbackgroundfetch.h" #include "llinventorypanel.h" @@ -70,6 +71,89 @@ static const std::string COF_TAB_NAME = "cof_tab"; static LLRegisterPanelClassWrapper t_inventory("panel_outfits_inventory"); +// Context-dependent menu actions are not implemented +// because accordions don't properly support selection yet. +class LLOutfitListGearMenu +{ +public: + static LLMenuGL* createMenu() + { + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; + + registrar.add("Gear.Wear", boost::bind(onWear)); + registrar.add("Gear.TakeOff", boost::bind(onTakeOff)); + registrar.add("Gear.Rename", boost::bind(onRename)); + registrar.add("Gear.Delete", boost::bind(onDelete)); + registrar.add("Gear.Create", boost::bind(onCreate, _2)); + + enable_registrar.add("Gear.OnEnable", boost::bind(onEnable, _2)); + + return LLUICtrlFactory::getInstance()->createFromFile( + "menu_outfit_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + } + +private: + static void onWear() + { + // *TODO: not implemented + } + + static void onTakeOff() + { + // *TODO: not implemented + } + + static void onRename() + { + // *TODO: not implemented + } + + static void onDelete() + { + // *TODO: not implemented + } + + static void onCreate(const LLSD& data) + { + LLWearableType::EType type = LLWearableType::typeNameToType(data.asString()); + if (type == LLWearableType::WT_NONE) + { + llwarns << "Invalid wearable type" << llendl; + return; + } + + LLAgentWearables::createWearable(type, true); + } + + static bool onEnable(const LLSD& data) + { + std::string param = data.asString(); + + if ("wear" == param) + { + // *TODO: not implemented + return false; + } + else if ("take_off" == param) + { + // *TODO: not implemented + return false; + } + else if ("rename" == param) + { + // *TODO: not implemented + return false; + } + else if ("delete" == param) + { + // *TODO: not implemented + return false; + } + + return true; + } +}; LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mMyOutfitsPanel(NULL), @@ -385,8 +469,7 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() , _7 // EAcceptance* accept )); - mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_outfit_gear.xml", - gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mGearMenu = LLOutfitListGearMenu::createMenu(); } void LLPanelOutfitsInventory::updateListCommands() @@ -403,7 +486,7 @@ void LLPanelOutfitsInventory::updateListCommands() void LLPanelOutfitsInventory::onGearButtonClick() { - showActionMenu(mMenuGearDefault,"options_gear_btn"); + showActionMenu(mGearMenu, "options_gear_btn"); } void LLPanelOutfitsInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) -- cgit v1.2.3 From 142a6c3b8fa9e286c0336236d1eccd9a6725f06a Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 2 Jun 2010 20:46:16 +0300 Subject: EXT-6726 WIP Added missing menu items to the Appearance SP. - Hooked up Wear / Take off / Rename / Delete items in the My Outfits gear menu. - Added "Create new..." to body part / clothing context menu in Edit Outfit. - Added "Create new..." submenus to the Edit Outfit gear menu. - Disabling the "Take Off" menu item of the clothing context menu in the Edit Outfit panel when it's irrelevant. Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/494/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 113 ++++++++++++++++++++---------- 1 file changed, 75 insertions(+), 38 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 6fb016cdfd..74631c03df 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -71,50 +71,89 @@ static const std::string COF_TAB_NAME = "cof_tab"; static LLRegisterPanelClassWrapper t_inventory("panel_outfits_inventory"); -// Context-dependent menu actions are not implemented -// because accordions don't properly support selection yet. class LLOutfitListGearMenu { public: - static LLMenuGL* createMenu() + LLOutfitListGearMenu(LLOutfitsList* olist) + : mOutfitList(olist), + mMenu(NULL) { + llassert_always(mOutfitList); + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; - registrar.add("Gear.Wear", boost::bind(onWear)); - registrar.add("Gear.TakeOff", boost::bind(onTakeOff)); - registrar.add("Gear.Rename", boost::bind(onRename)); - registrar.add("Gear.Delete", boost::bind(onDelete)); - registrar.add("Gear.Create", boost::bind(onCreate, _2)); + registrar.add("Gear.Wear", boost::bind(&LLOutfitListGearMenu::onWear, this)); + registrar.add("Gear.TakeOff", boost::bind(&LLOutfitListGearMenu::onTakeOff, this)); + registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenu::onRename, this)); + registrar.add("Gear.Delete", boost::bind(&LLOutfitListGearMenu::onDelete, this)); + registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2)); - enable_registrar.add("Gear.OnEnable", boost::bind(onEnable, _2)); + enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitListGearMenu::onEnable, this, _2)); - return LLUICtrlFactory::getInstance()->createFromFile( + mMenu = LLUICtrlFactory::getInstance()->createFromFile( "menu_outfit_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + llassert(mMenu); } + LLMenuGL* getMenu() { return mMenu; } + private: - static void onWear() + const LLUUID& getSelectedOutfitID() { - // *TODO: not implemented + return mOutfitList->getSelectedOutfitUUID(); } - static void onTakeOff() + LLViewerInventoryCategory* getSelectedOutfit() { - // *TODO: not implemented + const LLUUID& selected_outfit_id = getSelectedOutfitID(); + if (selected_outfit_id.isNull()) + { + return NULL; + } + + LLViewerInventoryCategory* cat = gInventory.getCategory(selected_outfit_id); + return cat; } - static void onRename() + void onWear() { - // *TODO: not implemented + LLViewerInventoryCategory* selected_outfit = getSelectedOutfit(); + if (selected_outfit) + { + LLAppearanceMgr::instance().wearInventoryCategory( + selected_outfit, /*copy=*/ FALSE, /*append=*/ FALSE); + } } - static void onDelete() + void onTakeOff() { - // *TODO: not implemented + const LLUUID& selected_outfit_id = getSelectedOutfitID(); + if (selected_outfit_id.notNull()) + { + LLAppearanceMgr::instance().takeOffOutfit(selected_outfit_id); + } } - static void onCreate(const LLSD& data) + void onRename() + { + const LLUUID& selected_outfit_id = getSelectedOutfitID(); + if (selected_outfit_id.notNull()) + { + LLAppearanceMgr::instance().renameOutfit(selected_outfit_id); + } + } + + void onDelete() + { + const LLUUID& selected_outfit_id = getSelectedOutfitID(); + if (selected_outfit_id.notNull()) + { + remove_category(&gInventory, selected_outfit_id); + } + } + + void onCreate(const LLSD& data) { LLWearableType::EType type = LLWearableType::typeNameToType(data.asString()); if (type == LLWearableType::WT_NONE) @@ -126,39 +165,40 @@ private: LLAgentWearables::createWearable(type, true); } - static bool onEnable(const LLSD& data) + bool onEnable(LLSD::String param) { - std::string param = data.asString(); + const LLUUID& selected_outfit_id = getSelectedOutfitID(); + bool is_worn = LLAppearanceMgr::instance().getBaseOutfitUUID() == selected_outfit_id; if ("wear" == param) { - // *TODO: not implemented - return false; + return !is_worn; } else if ("take_off" == param) { - // *TODO: not implemented - return false; + return is_worn; } else if ("rename" == param) { - // *TODO: not implemented - return false; + return get_is_category_renameable(&gInventory, selected_outfit_id); } else if ("delete" == param) { - // *TODO: not implemented - return false; + return LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit_id); } return true; } + + LLOutfitsList* mOutfitList; + LLMenuGL* mMenu; }; LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mMyOutfitsPanel(NULL), mCurrentOutfitPanel(NULL), mParent(NULL), + mGearMenu(NULL), mInitialized(false) { mSavedFolderState = new LLSaveFolderState(); @@ -168,6 +208,7 @@ LLPanelOutfitsInventory::LLPanelOutfitsInventory() : LLPanelOutfitsInventory::~LLPanelOutfitsInventory() { + delete mGearMenu; delete mSavedFolderState; } @@ -458,7 +499,7 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() { mListCommands = getChild("bottom_panel"); - mListCommands->childSetAction("options_gear_btn", boost::bind(&LLPanelOutfitsInventory::onGearButtonClick, this)); + mListCommands->childSetAction("options_gear_btn", boost::bind(&LLPanelOutfitsInventory::showGearMenu, this)); mListCommands->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this)); mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this)); @@ -469,7 +510,7 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() , _7 // EAcceptance* accept )); - mGearMenu = LLOutfitListGearMenu::createMenu(); + mGearMenu = new LLOutfitListGearMenu(mMyOutfitsPanel); } void LLPanelOutfitsInventory::updateListCommands() @@ -484,18 +525,14 @@ void LLPanelOutfitsInventory::updateListCommands() mSaveComboBtn->setSaveBtnEnabled(make_outfit_enabled); } -void LLPanelOutfitsInventory::onGearButtonClick() -{ - showActionMenu(mGearMenu, "options_gear_btn"); -} - -void LLPanelOutfitsInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) +void LLPanelOutfitsInventory::showGearMenu() { + LLMenuGL* menu = mGearMenu ? mGearMenu->getMenu() : NULL; if (menu) { menu->buildDrawLabels(); menu->updateParent(LLMenuGL::sMenuContainer); - LLView* spawning_view = getChild (spawning_view_name); + LLView* spawning_view = getChild("options_gear_btn"); S32 menu_x, menu_y; //show menu in co-ordinates of panel spawning_view->localPointToOtherView(0, spawning_view->getRect().getHeight(), &menu_x, &menu_y, this); -- cgit v1.2.3 From 86c230e4902ec06bb65e81b638d60e6b80b51613 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 3 Jun 2010 11:26:38 +0300 Subject: EXT-7503 WIP Made first inventory fetch in My Outfits panel only on first panel opening. * LLOutfitsList is not Inventory Observer anymore * Content is fetched in onOpen now * Added call of the LLOutfitsList::onOpen when "My Outfits" tab is switched on in My Appearance panel Reviewed by Brad Payne at https://codereview.productengine.com/secondlife/r/456/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 21f69d3470..9babddc033 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -632,6 +632,7 @@ void LLPanelOutfitsInventory::onTabChange() else { mMyOutfitsPanel->setFilterSubString(mFilterSubString); + mMyOutfitsPanel->onOpen(LLSD()); } updateVerbs(); -- cgit v1.2.3 From f99a601dbe7d783b8bd80e0791a222ce51bd7dc6 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 4 Jun 2010 14:58:48 +0300 Subject: EXT-7485 FIXED Provided update of 'save as' button status and save outfit panel status. 1 published LLCOFObserver as LLOutfitObserver(moved from llpaneloutfitedit.cpp to lloutfitobserver.h) 2 decoupled outfit edit panel and observer by replacing pointer to panel with signals and made observer as singleton 3 moved call of LLAppearanceMgr::getInstance()->updateIsDirty() from outfit edit panel to observer(discussed with IB) 4 modified updating of combo button state on outfit panel using LLOutfitObserver 5 modified refresh of outfit name and status on outfit change event using LLOutfitObserver 6 removed unnecessary LLWatchForOutfitRenameObserver that caused excessive updates of outfit panel status name --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 5f67f3d989..8836672f91 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -50,6 +50,7 @@ #include "lllineeditor.h" #include "llmodaldialog.h" #include "llnotificationsutil.h" +#include "lloutfitobserver.h" #include "lloutfitslist.h" #include "llsaveoutfitcombobtn.h" #include "llsidepanelappearance.h" @@ -204,6 +205,10 @@ LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoaded, this)); + + LLOutfitObserver& observer = LLOutfitObserver::instance(); + observer.addBOFChangedCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); + observer.addCOFChangedCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); } LLPanelOutfitsInventory::~LLPanelOutfitsInventory() @@ -522,7 +527,7 @@ void LLPanelOutfitsInventory::updateListCommands() mListCommands->childSetEnabled("trash_btn", trash_enabled); mListCommands->childSetEnabled("wear_btn", wear_enabled); mListCommands->childSetVisible("wear_btn", wear_enabled); - mSaveComboBtn->setSaveBtnEnabled(make_outfit_enabled); + mSaveComboBtn->setMenuItemEnabled("save_outfit", make_outfit_enabled); } void LLPanelOutfitsInventory::showGearMenu() @@ -665,7 +670,7 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) } if (command_name == "make_outfit") { - return TRUE; + return LLAppearanceMgr::getInstance()->isOutfitDirty(); } if (command_name == "edit" || @@ -789,6 +794,7 @@ void LLPanelOutfitsInventory::onWearablesLoaded() setWearablesLoading(false); } +// static LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP() { static LLSidepanelAppearance* panel_appearance = -- cgit v1.2.3 From 50eb27a04d193ef145f8879e12d8a82089a66891 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 8 Jun 2010 15:36:48 +0300 Subject: EXT-7644 FIXED Implemented functionality for locking outfit modification controls and used it for 'save outfit' action. 1 Added functionality for locking outfit in LLAppearanceMgr. Outfit should be locked when outfit related operation is started(now it is used for updateBaseOutfit) and unlocked when operation completed or timeout is exceeded. 2 Added outfit saved and outfit lock changed signals to LLOutfitObserver. 3 Updated LLPanelOutfitsInventory and LLPanelOutfitEdit with functionality of controlling 'save outfit' controls state('save outfit' controls should be enabled only if outfit isn't locked and outfit is dirty). 4 Renamed action label of method LLPanelOutfitsInventory::isActionEnabled "make_outfit" to "save_outfit". --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 8836672f91..8b451c156c 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -209,6 +209,7 @@ LLPanelOutfitsInventory::LLPanelOutfitsInventory() : LLOutfitObserver& observer = LLOutfitObserver::instance(); observer.addBOFChangedCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); observer.addCOFChangedCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); + observer.addOutfitLockChangedCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); } LLPanelOutfitsInventory::~LLPanelOutfitsInventory() @@ -522,7 +523,7 @@ void LLPanelOutfitsInventory::updateListCommands() { bool trash_enabled = isActionEnabled("delete"); bool wear_enabled = isActionEnabled("wear"); - bool make_outfit_enabled = isActionEnabled("make_outfit"); + bool make_outfit_enabled = isActionEnabled("save_outfit"); mListCommands->childSetEnabled("trash_btn", trash_enabled); mListCommands->childSetEnabled("wear_btn", wear_enabled); @@ -668,9 +669,12 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) return FALSE; } } - if (command_name == "make_outfit") + if (command_name == "save_outfit") { - return LLAppearanceMgr::getInstance()->isOutfitDirty(); + 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" || -- cgit v1.2.3 From 63c21d120fe1eb940bf959b8465a47a441bcef77 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Thu, 10 Jun 2010 15:34:44 +0300 Subject: EXT-7615 FIXED Fixed the trash button in My Outfits. - Now it's enabled when the "Delete Outfit" context menu item is enabled. - It actually deletes the selected outfits. Known out-of-scope issues: - The trash button is sometimes enabled when the WEARING tab is active. - The check whether an outfit can be removed is probably wrong. There is a separate ticket (EXT-7716) for that. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/550/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 8b451c156c..0e1e94129b 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -555,11 +555,25 @@ void LLPanelOutfitsInventory::onTrashButtonClick() void LLPanelOutfitsInventory::onClipboardAction(const LLSD& userdata) { std::string command_name = userdata.asString(); - // TODO: add handling "My Outfits" tab. 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(); } @@ -614,7 +628,6 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) { BOOL can_delete = FALSE; - // TODO: add handling "My Outfits" tab. if (isCOFPanelActive()) { LLFolderView* root = getActivePanel()->getRootFolder(); @@ -630,10 +643,15 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) LLFolderViewItem *item = root->getItemByID(item_id); can_delete &= item->getListener()->isItemRemovable(); } - return can_delete; } } - return FALSE; + else // "My Outfits" tab active + { + const LLUUID& selected_outfit = mMyOutfitsPanel->getSelectedOutfitUUID(); + can_delete = LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit); + } + + return can_delete; } if (command_name == "remove_link") { @@ -730,6 +748,7 @@ void LLPanelOutfitsInventory::initTabPanels() mCurrentOutfitPanel->setSelectCallback(boost::bind(&LLPanelOutfitsInventory::onTabSelectionChange, this, mCurrentOutfitPanel, _1, _2)); mMyOutfitsPanel = getChild(OUTFITS_TAB_NAME); + mMyOutfitsPanel->addSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); mAppearanceTabs = getChild("appearance_tabs"); mAppearanceTabs->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::onTabChange, this)); -- cgit v1.2.3 From 62c82eef49006f6f94ca2f9ca10b5abc4612a61f Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Thu, 10 Jun 2010 15:39:13 +0300 Subject: EXT-7620 FIXED Disable context-dependant outfit gear menu items if no (or invalid) outfit selected. The "Create new clothes / body parts" menu items are always enabled because they have no on_enable callback set. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/548/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 0e1e94129b..1286642897 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -169,6 +169,11 @@ private: bool onEnable(LLSD::String param) { const LLUUID& selected_outfit_id = getSelectedOutfitID(); + if (selected_outfit_id.isNull()) // no selection or invalid outfit selected + { + return false; + } + bool is_worn = LLAppearanceMgr::instance().getBaseOutfitUUID() == selected_outfit_id; if ("wear" == param) -- cgit v1.2.3 From eb1929c8f97f256264cac620871e4b498d985d68 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 11 Jun 2010 17:19:40 +0300 Subject: EXT-6726 WIP Improved the way we disable irrelevant items of the My Outfits gear menu. * Made the "Wear" and "Take Off" items mutually exclusive (i.e. only one of them is now shown). * Hide all context-dependant items ("Wear", "Take off", "Rename", "Delete") when no outfit selected. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/566/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 67 ++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 20 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 1286642897..b5cffd84b3 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -91,6 +91,7 @@ public: registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2)); enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitListGearMenu::onEnable, this, _2)); + enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenu::onVisible, this, _2)); mMenu = LLUICtrlFactory::getInstance()->createFromFile( "menu_outfit_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); @@ -99,6 +100,28 @@ public: LLMenuGL* getMenu() { return mMenu; } + void show(LLView* spawning_view) + { + if (!mMenu) return; + + updateItemsVisibility(); + mMenu->buildDrawLabels(); + mMenu->updateParent(LLMenuGL::sMenuContainer); + S32 menu_x = 0; + S32 menu_y = spawning_view->getRect().getHeight() + mMenu->getRect().getHeight(); + LLMenuGL::showPopup(spawning_view, mMenu, menu_x, menu_y); + } + + void updateItemsVisibility() + { + if (!mMenu) return; + + bool have_selection = getSelectedOutfitID().notNull(); + mMenu->setItemVisible("sepatator1", have_selection); + mMenu->setItemVisible("sepatator2", have_selection); + mMenu->arrangeAndClear(); // update menu height + } + private: const LLUUID& getSelectedOutfitID() { @@ -174,6 +197,26 @@ private: return false; } + if ("rename" == param) + { + return get_is_category_renameable(&gInventory, selected_outfit_id); + } + else if ("delete" == param) + { + return LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit_id); + } + + return true; + } + + bool onVisible(LLSD::String param) + { + const LLUUID& selected_outfit_id = getSelectedOutfitID(); + if (selected_outfit_id.isNull()) // no selection or invalid outfit selected + { + return false; + } + bool is_worn = LLAppearanceMgr::instance().getBaseOutfitUUID() == selected_outfit_id; if ("wear" == param) @@ -184,14 +227,6 @@ private: { return is_worn; } - else if ("rename" == param) - { - return get_is_category_renameable(&gInventory, selected_outfit_id); - } - else if ("delete" == param) - { - return LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit_id); - } return true; } @@ -538,18 +573,10 @@ void LLPanelOutfitsInventory::updateListCommands() void LLPanelOutfitsInventory::showGearMenu() { - LLMenuGL* menu = mGearMenu ? mGearMenu->getMenu() : NULL; - if (menu) - { - menu->buildDrawLabels(); - menu->updateParent(LLMenuGL::sMenuContainer); - LLView* spawning_view = getChild("options_gear_btn"); - S32 menu_x, menu_y; - //show menu in co-ordinates of panel - spawning_view->localPointToOtherView(0, spawning_view->getRect().getHeight(), &menu_x, &menu_y, this); - menu_y += menu->getRect().getHeight(); - LLMenuGL::showPopup(this, menu, menu_x, menu_y); - } + if (!mGearMenu) return; + + LLView* spawning_view = getChild("options_gear_btn"); + mGearMenu->show(spawning_view); } void LLPanelOutfitsInventory::onTrashButtonClick() -- cgit v1.2.3 From 03f43664223e7bf57aba04f81bc3737c6ab63285 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 11 Jun 2010 17:35:31 +0300 Subject: EXT-7792 FIXED Made Wear button disabled if there are no selected outfit (or list is empty). Also fixed some issues in accordion caused by removing My Outfits content via Inventory: - updated accordion's help text to not shown nothing if there are no any tabs and filter substring is empty. - added check of necessity to show help text when accordion "arrange" Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/568/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 1286642897..1e1e1aaf9b 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -528,11 +528,12 @@ void LLPanelOutfitsInventory::updateListCommands() { bool trash_enabled = isActionEnabled("delete"); bool wear_enabled = isActionEnabled("wear"); + bool wear_visible = !isCOFPanelActive(); bool make_outfit_enabled = isActionEnabled("save_outfit"); mListCommands->childSetEnabled("trash_btn", trash_enabled); mListCommands->childSetEnabled("wear_btn", wear_enabled); - mListCommands->childSetVisible("wear_btn", wear_enabled); + mListCommands->childSetVisible("wear_btn", wear_visible); mSaveComboBtn->setMenuItemEnabled("save_outfit", make_outfit_enabled); } @@ -691,6 +692,7 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) { return FALSE; } + return hasItemsSelected(); } if (command_name == "save_outfit") { @@ -713,7 +715,6 @@ bool LLPanelOutfitsInventory::hasItemsSelected() { bool has_items_selected = false; - // TODO: add handling "My Outfits" tab. if (isCOFPanelActive()) { LLFolderView* root = getActivePanel()->getRootFolder(); @@ -723,6 +724,10 @@ bool LLPanelOutfitsInventory::hasItemsSelected() has_items_selected = (selection_set.size() > 0); } } + else // My Outfits Tab is active + { + has_items_selected = mMyOutfitsPanel->getSelectedOutfitUUID().notNull(); + } return has_items_selected; } -- cgit v1.2.3 From 300cb342919b2bfa62e9c90af5cdb99afa9c962e Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 15 Jun 2010 12:38:30 +0300 Subject: EXT-7794 FIXED Implemented a common-used notification about wearing outfit to display loading indicator. Details: * Added signal "Wearable Loading Started" in AgentWearables (in parallel with "Wearables Loaded") * Now it is raised from the LLAppearanceMgr::wearInventoryCategory. Reviewed by Vadim Savchuk and Neal Orman at https://codereview.productengine.com/secondlife/r/583/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 1157c40b39..5563214407 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -245,6 +245,7 @@ LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoaded, this)); + gAgentWearables.addLoadingStartedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoading, this)); LLOutfitObserver& observer = LLOutfitObserver::instance(); observer.addBOFChangedCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); @@ -382,7 +383,6 @@ void LLPanelOutfitsInventory::onWearButtonClick() if (!isCOFPanelActive()) { mMyOutfitsPanel->performAction("replaceoutfit"); - setWearablesLoading(true); } else { @@ -854,6 +854,11 @@ void LLPanelOutfitsInventory::onWearablesLoaded() setWearablesLoading(false); } +void LLPanelOutfitsInventory::onWearablesLoading() +{ + setWearablesLoading(true); +} + // static LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP() { -- cgit v1.2.3 From c773e01fbf795d8d40b19f8d9163898712509770 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 15 Jun 2010 15:48:52 +0300 Subject: EXT-7789 FIXED Removed "Rename Outfit" option from My Outfits gear menu Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/584/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 5563214407..7e1bff0961 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -86,7 +86,6 @@ public: registrar.add("Gear.Wear", boost::bind(&LLOutfitListGearMenu::onWear, this)); registrar.add("Gear.TakeOff", boost::bind(&LLOutfitListGearMenu::onTakeOff, this)); - registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenu::onRename, this)); registrar.add("Gear.Delete", boost::bind(&LLOutfitListGearMenu::onDelete, this)); registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2)); @@ -159,15 +158,6 @@ private: } } - void onRename() - { - const LLUUID& selected_outfit_id = getSelectedOutfitID(); - if (selected_outfit_id.notNull()) - { - LLAppearanceMgr::instance().renameOutfit(selected_outfit_id); - } - } - void onDelete() { const LLUUID& selected_outfit_id = getSelectedOutfitID(); @@ -197,11 +187,7 @@ private: return false; } - if ("rename" == param) - { - return get_is_category_renameable(&gInventory, selected_outfit_id); - } - else if ("delete" == param) + if ("delete" == param) { return LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit_id); } -- cgit v1.2.3 From eb973cf6b21457c12272ddb6213e99d332637116 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 17 Jun 2010 16:51:04 +0300 Subject: EXT-7755 FIXED Updated condition to not show "No Outfit" as a status when outfit is changing. Implementation details: * Added flag to LLAgentWearables to determining that outfit is changing. Synchronizing it with mLoadingStartedSignal and mLoadedSignal signals. * Check this flag when there is no outfit set to show empty title when outfit is being changed. * Also updated condition to disable "Wear" button when outfit is being changed. Additional improvements: * Removed reference to parent LLSidepanelAppearance from the LLPanelOutfitsInventory. * Now LLSidepanelAppearance is subscribed to mLoadingStartedSignal and mLoadedSignal to update its loading indicator. Known Issue: * When new outfit is being worn its name is shown in title for a short moment (loading indicator is shown at this time). Then it is changed with an empty title and is shown when outfit is already worn. If necessary it should be investigated and fixed in scope of another issue. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/593/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 7e1bff0961..e2563efb7d 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -224,7 +224,6 @@ private: LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mMyOutfitsPanel(NULL), mCurrentOutfitPanel(NULL), - mParent(NULL), mGearMenu(NULL), mInitialized(false) { @@ -314,11 +313,6 @@ void LLPanelOutfitsInventory::updateVerbs() } } -void LLPanelOutfitsInventory::setParent(LLSidepanelAppearance* parent) -{ - mParent = parent; -} - // virtual void LLPanelOutfitsInventory::onSearchEdit(const std::string& string) { @@ -548,7 +542,7 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() void LLPanelOutfitsInventory::updateListCommands() { bool trash_enabled = isActionEnabled("delete"); - bool wear_enabled = isActionEnabled("wear"); + bool wear_enabled = !gAgentWearables.isCOFChangeInProgress() && isActionEnabled("wear"); bool wear_visible = !isCOFPanelActive(); bool make_outfit_enabled = isActionEnabled("save_outfit"); @@ -827,12 +821,6 @@ BOOL LLPanelOutfitsInventory::isCOFPanelActive() const void LLPanelOutfitsInventory::setWearablesLoading(bool val) { mListCommands->childSetEnabled("wear_btn", !val); - - llassert(mParent); - if (mParent) - { - mParent->setWearablesLoading(val); - } } void LLPanelOutfitsInventory::onWearablesLoaded() -- cgit v1.2.3 From 9f996443604a902e03de87d2d14545b4adffa69c Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Thu, 17 Jun 2010 19:03:57 +0300 Subject: EXT-7722 Fixed "Add to COF" and "Remove from COF" outfit context menu items to be enabled when appropriate and work properly. Work on "Take Off - Remove from Current Outfit" and "Wear - Add to Current Outfit" menu options: - The menu items of the outfit context menu and the My Outfits gear menu are now disabled when inappropriate instead of being hidden. - The menu items get enabled/disabled depending on whether you can wear (take off) anything from the selected outfit. (was: depending on whether you're wearing the outfit) - Changed the way the options work: they now only operate on clothes and attachments. "Add to COF" now only adds those body parts that are missing in COF; "Remove from COF" doesn't touch body parts at all. Without this change both "Add" and "Remove" options would be available simultaneously, because any valid outfit contains body parts. I think that would be confusing. And you don't expect you body parts to be replaced when doing "Add to COF'. (that's addition, not replacement) Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/585/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index e2563efb7d..2405b95e7d 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -191,6 +191,10 @@ private: { return LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit_id); } + else if ("take_off" == param) + { + return LLAppearanceMgr::getCanRemoveFromCOF(selected_outfit_id); + } return true; } @@ -209,10 +213,6 @@ private: { return !is_worn; } - else if ("take_off" == param) - { - return is_worn; - } return true; } -- cgit v1.2.3 From 9aa710945685a2cae8cfc622f3dc3d900c1ab4c9 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Fri, 18 Jun 2010 12:56:02 +0300 Subject: EXT-7847 FIXED Disabled "trash" button if an item is selected inside selected outfit. - Added bool mItemSelected variable and getter for it to determine if the selection inside outfit exists, and used it when determining whether to enable "Trash" button in My Outfits. Reviewed by Vadim Savchuk and Neal Orman at https://codereview.productengine.com/secondlife/r/600/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 2405b95e7d..714d9cd4c5 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -661,7 +661,8 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) else // "My Outfits" tab active { const LLUUID& selected_outfit = mMyOutfitsPanel->getSelectedOutfitUUID(); - can_delete = LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit); + // 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; -- cgit v1.2.3 From 9a397826dd5bbe04b827496ff6f802a9a5552306 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 22 Jun 2010 14:35:45 +0300 Subject: EXT-7789 FIXED reverted changes with removing "Rename Outfit" from gear menu Backed out changeset: f0e9147baf74 --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 7e1bff0961..5563214407 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -86,6 +86,7 @@ public: registrar.add("Gear.Wear", boost::bind(&LLOutfitListGearMenu::onWear, this)); registrar.add("Gear.TakeOff", boost::bind(&LLOutfitListGearMenu::onTakeOff, this)); + registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenu::onRename, this)); registrar.add("Gear.Delete", boost::bind(&LLOutfitListGearMenu::onDelete, this)); registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2)); @@ -158,6 +159,15 @@ private: } } + void onRename() + { + const LLUUID& selected_outfit_id = getSelectedOutfitID(); + if (selected_outfit_id.notNull()) + { + LLAppearanceMgr::instance().renameOutfit(selected_outfit_id); + } + } + void onDelete() { const LLUUID& selected_outfit_id = getSelectedOutfitID(); @@ -187,7 +197,11 @@ private: return false; } - if ("delete" == param) + if ("rename" == param) + { + return get_is_category_renameable(&gInventory, selected_outfit_id); + } + else if ("delete" == param) { return LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit_id); } -- cgit v1.2.3 From 08381a276dbf0544692c44236b40f57ec111aefc Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 23 Jun 2010 15:30:48 +0300 Subject: EXT-7755 ADDITIONAL FIX Fixed issues with wrong title after an outfit from the Inventory is worn, "Wear..." menu items state is made consistent with "Wear" button. * Empty string is replaced with "Changing outfits" while changing COF; * Fixed title to show "No Outfit" after an outfit from the Inventory is worn; * Fixed bug with visible indicator after an empty folder is DnD from the Inventory "Clothing" * Updated context and Gear "Wear..." menu items to take into account "isCOFChangeInProgress" state in on_enable callbacks Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/625/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index d382c77430..77c135c716 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -72,11 +72,13 @@ static const std::string COF_TAB_NAME = "cof_tab"; static LLRegisterPanelClassWrapper t_inventory("panel_outfits_inventory"); +class LLPanelOutfitsInventory; class LLOutfitListGearMenu { public: - LLOutfitListGearMenu(LLOutfitsList* olist) + LLOutfitListGearMenu(LLOutfitsList* olist, LLPanelOutfitsInventory* parent_panel) : mOutfitList(olist), + mMyOutfitsPanel(parent_panel), mMenu(NULL) { llassert_always(mOutfitList); @@ -209,6 +211,11 @@ private: { return LLAppearanceMgr::getCanRemoveFromCOF(selected_outfit_id); } + else if ("wear" == param) + { + return mMyOutfitsPanel->isActionEnabled(param); + } + return true; } @@ -233,6 +240,7 @@ private: LLOutfitsList* mOutfitList; LLMenuGL* mMenu; + LLPanelOutfitsInventory* mMyOutfitsPanel; }; LLPanelOutfitsInventory::LLPanelOutfitsInventory() : @@ -550,13 +558,13 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() , _7 // EAcceptance* accept )); - mGearMenu = new LLOutfitListGearMenu(mMyOutfitsPanel); + mGearMenu = new LLOutfitListGearMenu(mMyOutfitsPanel, this); } void LLPanelOutfitsInventory::updateListCommands() { bool trash_enabled = isActionEnabled("delete"); - bool wear_enabled = !gAgentWearables.isCOFChangeInProgress() && isActionEnabled("wear"); + bool wear_enabled = isActionEnabled("wear"); bool wear_visible = !isCOFPanelActive(); bool make_outfit_enabled = isActionEnabled("save_outfit"); @@ -710,6 +718,8 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) if (command_name == "wear") { + if (gAgentWearables.isCOFChangeInProgress()) return FALSE; + if (isCOFPanelActive()) { return FALSE; -- cgit v1.2.3 From 887b2858d4d180d3679f1eb39fd37be5a551615e Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Fri, 11 Jun 2010 20:02:42 +0300 Subject: EXT-7779 FIXED Changed wearing panel from inventory panel to a flat list similar to My Outfits view. - Added common interface for My Outfits and Wearing tabs. - Changed LLPanelOutfitsInventory to use common interface for My Outfits and Wearing tabs. - Removed dependency on outfits side panel from inventory bridge context menus. - Removed unused LLShowCreatedOutfit class from llagentwearables.cpp. - Restored opening newly created outfit in My Outfits tab. - Fixed worn items indication for Wearing tab items. Revieved by Neal Orman at https://codereview.productengine.com/secondlife/r/604/. --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 424 +++--------------------------- 1 file changed, 38 insertions(+), 386 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') 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 &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("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 selection_set = root->getSelectionList(); - can_delete = (selection_set.size() > 0); - for (std::set::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 selection_set = root->getSelectionList(); - can_delete = (selection_set.size() > 0); - for (std::set::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 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(COF_TAB_NAME); - mCurrentOutfitPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mCurrentOutfitPanel->setSelectCallback(boost::bind(&LLPanelOutfitsInventory::onTabSelectionChange, this, mCurrentOutfitPanel, _1, _2)); + mCurrentOutfitPanel = getChild(COF_TAB_NAME); + mCurrentOutfitPanel->setSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); mMyOutfitsPanel = getChild(OUTFITS_TAB_NAME); - mMyOutfitsPanel->addSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); + mMyOutfitsPanel->setSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); mAppearanceTabs = getChild("appearance_tabs"); mAppearanceTabs->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::onTabChange, this)); } -void LLPanelOutfitsInventory::onTabSelectionChange(LLInventoryPanel* tab_panel, const std::deque &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(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) -- cgit v1.2.3 From 2583a4d6ea60aeefa1d21f578d6fbf1f2f68c72a Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 22 Jun 2010 16:34:27 +0300 Subject: EXT-4295 FIXED Added gear and context menus for Wearing tab. - Moved My Outfits gear menu from llpaneloutfitsinventory.cpp to lloutfitslist.cpp Revieved by Neal Orman and Mike Antipov at https://codereview.productengine.com/secondlife/r/604/. --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 186 +----------------------------- 1 file changed, 2 insertions(+), 184 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 57c82b7ac4..2f1cad8a75 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -33,7 +33,6 @@ #include "llpaneloutfitsinventory.h" -#include "llmenugl.h" #include "llnotificationsutil.h" #include "lltabcontainer.h" @@ -48,189 +47,16 @@ #include "llsidepanelappearance.h" #include "llsidetray.h" #include "llviewerfoldertype.h" -#include "llviewermenu.h" static const std::string OUTFITS_TAB_NAME = "outfitslist_tab"; static const std::string COF_TAB_NAME = "cof_tab"; static LLRegisterPanelClassWrapper t_inventory("panel_outfits_inventory"); -class LLPanelOutfitsInventory; -class LLOutfitListGearMenu -{ -public: - LLOutfitListGearMenu(LLOutfitsList* olist, LLPanelOutfitsInventory* parent_panel) - : mOutfitList(olist), - mMyOutfitsPanel(parent_panel), - mMenu(NULL) - { - llassert_always(mOutfitList); - - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; - - registrar.add("Gear.Wear", boost::bind(&LLOutfitListGearMenu::onWear, this)); - registrar.add("Gear.TakeOff", boost::bind(&LLOutfitListGearMenu::onTakeOff, this)); - registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenu::onRename, this)); - registrar.add("Gear.Delete", boost::bind(&LLOutfitListGearMenu::onDelete, this)); - registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2)); - - enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitListGearMenu::onEnable, this, _2)); - enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenu::onVisible, this, _2)); - - mMenu = LLUICtrlFactory::getInstance()->createFromFile( - "menu_outfit_gear.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - llassert(mMenu); - } - - LLMenuGL* getMenu() { return mMenu; } - - void show(LLView* spawning_view) - { - if (!mMenu) return; - - updateItemsVisibility(); - mMenu->buildDrawLabels(); - mMenu->updateParent(LLMenuGL::sMenuContainer); - S32 menu_x = 0; - S32 menu_y = spawning_view->getRect().getHeight() + mMenu->getRect().getHeight(); - LLMenuGL::showPopup(spawning_view, mMenu, menu_x, menu_y); - } - - void updateItemsVisibility() - { - if (!mMenu) return; - - bool have_selection = getSelectedOutfitID().notNull(); - mMenu->setItemVisible("sepatator1", have_selection); - mMenu->setItemVisible("sepatator2", have_selection); - mMenu->arrangeAndClear(); // update menu height - } - -private: - const LLUUID& getSelectedOutfitID() - { - return mOutfitList->getSelectedOutfitUUID(); - } - - LLViewerInventoryCategory* getSelectedOutfit() - { - const LLUUID& selected_outfit_id = getSelectedOutfitID(); - if (selected_outfit_id.isNull()) - { - return NULL; - } - - LLViewerInventoryCategory* cat = gInventory.getCategory(selected_outfit_id); - return cat; - } - - void onWear() - { - LLViewerInventoryCategory* selected_outfit = getSelectedOutfit(); - if (selected_outfit) - { - LLAppearanceMgr::instance().wearInventoryCategory( - selected_outfit, /*copy=*/ FALSE, /*append=*/ FALSE); - } - } - - void onTakeOff() - { - const LLUUID& selected_outfit_id = getSelectedOutfitID(); - if (selected_outfit_id.notNull()) - { - LLAppearanceMgr::instance().takeOffOutfit(selected_outfit_id); - } - } - - void onRename() - { - const LLUUID& selected_outfit_id = getSelectedOutfitID(); - if (selected_outfit_id.notNull()) - { - LLAppearanceMgr::instance().renameOutfit(selected_outfit_id); - } - } - - void onDelete() - { - const LLUUID& selected_outfit_id = getSelectedOutfitID(); - if (selected_outfit_id.notNull()) - { - remove_category(&gInventory, selected_outfit_id); - } - } - - void onCreate(const LLSD& data) - { - LLWearableType::EType type = LLWearableType::typeNameToType(data.asString()); - if (type == LLWearableType::WT_NONE) - { - llwarns << "Invalid wearable type" << llendl; - return; - } - - LLAgentWearables::createWearable(type, true); - } - - bool onEnable(LLSD::String param) - { - const LLUUID& selected_outfit_id = getSelectedOutfitID(); - if (selected_outfit_id.isNull()) // no selection or invalid outfit selected - { - return false; - } - - if ("rename" == param) - { - return get_is_category_renameable(&gInventory, selected_outfit_id); - } - else if ("delete" == param) - { - return LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit_id); - } - else if ("take_off" == param) - { - return LLAppearanceMgr::getCanRemoveFromCOF(selected_outfit_id); - } - else if ("wear" == param) - { - return mMyOutfitsPanel->isActionEnabled(param); - } - - - return true; - } - - bool onVisible(LLSD::String param) - { - const LLUUID& selected_outfit_id = getSelectedOutfitID(); - if (selected_outfit_id.isNull()) // no selection or invalid outfit selected - { - return false; - } - - bool is_worn = LLAppearanceMgr::instance().getBaseOutfitUUID() == selected_outfit_id; - - if ("wear" == param) - { - return !is_worn; - } - - return true; - } - - LLOutfitsList* mOutfitList; - LLMenuGL* mMenu; - LLPanelOutfitsInventory* mMyOutfitsPanel; -}; - LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mMyOutfitsPanel(NULL), mCurrentOutfitPanel(NULL), mActivePanel(NULL), - mGearMenu(NULL), mInitialized(false) { gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoaded, this)); @@ -244,7 +70,6 @@ LLPanelOutfitsInventory::LLPanelOutfitsInventory() : LLPanelOutfitsInventory::~LLPanelOutfitsInventory() { - delete mGearMenu; } // virtual @@ -417,8 +242,6 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() mListCommands->childSetAction("options_gear_btn", boost::bind(&LLPanelOutfitsInventory::showGearMenu, this)); mListCommands->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this)); mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this)); - - mGearMenu = new LLOutfitListGearMenu(mMyOutfitsPanel, this); } void LLPanelOutfitsInventory::updateListCommands() @@ -428,9 +251,6 @@ 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); @@ -439,10 +259,10 @@ void LLPanelOutfitsInventory::updateListCommands() void LLPanelOutfitsInventory::showGearMenu() { - if (!mGearMenu) return; + if (!mActivePanel) return; LLView* spawning_view = getChild("options_gear_btn"); - mGearMenu->show(spawning_view); + mActivePanel->showGearMenu(spawning_view); } void LLPanelOutfitsInventory::onTrashButtonClick() @@ -456,8 +276,6 @@ void LLPanelOutfitsInventory::onTrashButtonClick() bool LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) { return mActivePanel && mActivePanel->isActionEnabled(userdata); - if (gAgentWearables.isCOFChangeInProgress()) return FALSE; - } // List Commands // ////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From a209e339ee96095e884e4de51ea5c88e51825d62 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Thu, 24 Jun 2010 18:00:09 +0300 Subject: EXT-7793 FIXED Implemented wearing separate wearables instead of whole outfit when individual items are selected in list. - Added wearSelectedItems() method to LLOutfitsList which wears all items selected in outfit lists (if possible- adds, else replaces). It is called when clicking wear if there is selection of individual items(LLOutfitsList::hasItemSelected() returns true). Otherwise whole outfit is worn. Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/638 --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 2f1cad8a75..076e6485a8 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -169,7 +169,14 @@ void LLPanelOutfitsInventory::onSearchEdit(const std::string& string) void LLPanelOutfitsInventory::onWearButtonClick() { - mMyOutfitsPanel->performAction("replaceoutfit"); + if (mMyOutfitsPanel->hasItemSelected()) + { + mMyOutfitsPanel->wearSelectedItems(); + } + else + { + mMyOutfitsPanel->performAction("replaceoutfit"); + } } bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD& response) -- cgit v1.2.3 From 8595c479ec090ceb015b80064a8cf13b0c1496d5 Mon Sep 17 00:00:00 2001 From: Vladimir Pchelko Date: Tue, 29 Jun 2010 16:14:03 +0300 Subject: EXT-7976 FIXED The panel with Gear and Trash button was moved into panel_outfits_list.xml and (without trash button) panel_outfits_wearing.xml. Note: MY OUTFITS and WEARING controls size/positions were corrected to be similar to Places and Inventory. Reviewed by Mike Antipov and Neal Orman at https://codereview.productengine.com/secondlife/r/650/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 076e6485a8..462ba2dfa5 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -245,10 +245,10 @@ LLPanelOutfitsInventory* LLPanelOutfitsInventory::findInstance() void LLPanelOutfitsInventory::initListCommandsHandlers() { mListCommands = getChild("bottom_panel"); - - mListCommands->childSetAction("options_gear_btn", boost::bind(&LLPanelOutfitsInventory::showGearMenu, this)); - mListCommands->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this)); mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this)); + mMyOutfitsPanel->childSetAction("options_gear_btn", boost::bind(&LLPanelOutfitsInventory::showGearMenu, this)); + mMyOutfitsPanel->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this)); + mCurrentOutfitPanel->childSetAction("options_gear_btn", boost::bind(&LLPanelOutfitsInventory::showGearMenu, this)); } void LLPanelOutfitsInventory::updateListCommands() @@ -258,7 +258,7 @@ void LLPanelOutfitsInventory::updateListCommands() bool wear_visible = !isCOFPanelActive(); bool make_outfit_enabled = isActionEnabled("save_outfit"); - mListCommands->childSetEnabled("trash_btn", trash_enabled); + mMyOutfitsPanel->childSetEnabled("trash_btn", trash_enabled); mListCommands->childSetEnabled("wear_btn", wear_enabled); mListCommands->childSetVisible("wear_btn", wear_visible); mSaveComboBtn->setMenuItemEnabled("save_outfit", make_outfit_enabled); -- cgit v1.2.3 From 4bf3bda2ab07e58e8f5ffdf460e72530f3b37691 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Wed, 30 Jun 2010 15:05:02 +0300 Subject: EXT-7793 FIXED Implemented "Wear" button tooltip changing depending on selection. - Added check to LLPanelOutfitsInventory::updateListCommands() which takes place on selection change and depending on hasItemSelected() sets tooltip for "Wear" button. Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/665/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 462ba2dfa5..c5d259e517 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -262,6 +262,14 @@ void LLPanelOutfitsInventory::updateListCommands() mListCommands->childSetEnabled("wear_btn", wear_enabled); mListCommands->childSetVisible("wear_btn", wear_visible); mSaveComboBtn->setMenuItemEnabled("save_outfit", make_outfit_enabled); + if (mMyOutfitsPanel->hasItemSelected()) + { + mListCommands->childSetToolTip("wear_btn", getString("wear_items_tooltip")); + } + else + { + mListCommands->childSetToolTip("wear_btn", getString("wear_outfit_tooltip")); + } } void LLPanelOutfitsInventory::showGearMenu() -- cgit v1.2.3 From 1be44136e08d632fcf0ebcfd88484793437bd551 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Mon, 5 Jul 2010 20:18:52 +0300 Subject: EXT-8146 FIXED Added confirmation dialog before outfit(s) deleting. - Added new notification which appears when trash button in "My Outfits" is clicked. Used it in code to only delete outfits if OK is selected. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/695/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index c5d259e517..ca5679d5b0 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -282,10 +282,17 @@ void LLPanelOutfitsInventory::showGearMenu() void LLPanelOutfitsInventory::onTrashButtonClick() { - mMyOutfitsPanel->removeSelected(); + LLNotificationsUtil::add("DeleteOutfits", LLSD(), LLSD(), boost::bind(&LLPanelOutfitsInventory::onOutfitsRemovalConfirmation, this, _1, _2)); +} - updateListCommands(); - updateVerbs(); +void LLPanelOutfitsInventory::onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) return; // canceled + + mMyOutfitsPanel->removeSelected(); + updateListCommands(); + updateVerbs(); } bool LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) -- cgit v1.2.3 From de81d9d8a7d2b12626c3929817a8ccdf20ba16c7 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 23 Jul 2010 18:06:49 +0300 Subject: EXT-8481 FIXED Wear button in My Outfits being enabled when worn item is selected. - Fixed condition for enabling the Wear button in My Outfits. - The button was always enabled when when COF change completes, I fixed that as well. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/800/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitsinventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index ca5679d5b0..16ef7998b3 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -337,7 +337,7 @@ bool LLPanelOutfitsInventory::isCOFPanelActive() const void LLPanelOutfitsInventory::setWearablesLoading(bool val) { - mListCommands->childSetEnabled("wear_btn", !val); + updateVerbs(); } void LLPanelOutfitsInventory::onWearablesLoaded() -- cgit v1.2.3 From 06b0d72efa96b6a0ed665f7cd46f358c48929e7b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 13 Aug 2010 07:24:57 -0400 Subject: Change license from GPL to LGPL (version 2.1) --- indra/newview/llpaneloutfitsinventory.cpp | 41 ++++++++++++++----------------- 1 file changed, 18 insertions(+), 23 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 16ef7998b3..c6a7bd88a0 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -2,30 +2,25 @@ * @file llpaneloutfitsinventory.cpp * @brief Outfits inventory panel * - * $LicenseInfo:firstyear=2009&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ * 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. + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3