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/llpaneloutfitedit.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index ce382541c6..f3f67f2b03 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -198,6 +198,7 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() LLOutfitObserver& observer = LLOutfitObserver::instance(); observer.addBOFReplacedCallback(boost::bind(&LLPanelOutfitEdit::updateCurrentOutfitName, this)); observer.addBOFChangedCallback(boost::bind(&LLPanelOutfitEdit::updateVerbs, this)); + observer.addOutfitLockChangedCallback(boost::bind(&LLPanelOutfitEdit::updateVerbs, this)); observer.addCOFChangedCallback(boost::bind(&LLPanelOutfitEdit::update, this)); mLookItemTypes.reserve(NUM_LOOK_ITEM_TYPES); @@ -666,12 +667,13 @@ void LLPanelOutfitEdit::updateCurrentOutfitName() void LLPanelOutfitEdit::updateVerbs() { bool outfit_is_dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); + bool outfit_locked = LLAppearanceMgr::getInstance()->isOutfitLocked(); bool has_baseoutfit = LLAppearanceMgr::getInstance()->getBaseOutfitUUID().notNull(); - mSaveComboBtn->setSaveBtnEnabled(outfit_is_dirty); + mSaveComboBtn->setSaveBtnEnabled(!outfit_locked && outfit_is_dirty); childSetEnabled(REVERT_BTN, outfit_is_dirty && has_baseoutfit); - mSaveComboBtn->setMenuItemEnabled("save_outfit", outfit_is_dirty); + mSaveComboBtn->setMenuItemEnabled("save_outfit", !outfit_locked && outfit_is_dirty); mStatus->setText(outfit_is_dirty ? getString("unsaved_changes") : getString("now_editing")); -- cgit v1.2.3 From d17b616b1c94c136254de0bee039cdc87979b44e Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 8 Jun 2010 17:01:29 +0300 Subject: EXT-7627 FIXED Wearing an item now doesn't open the wearable editing panel. Fix: - Save the UUID of a newly created wearable to start editing it right after it gets worn. This approach replaces a temporary hack that invoked the editing panel whenever an item gets worn (if the Appearance SP is opened at the time). The hack only happened to work sometimes because the editing panel failed to open. Other changes: - Removed a check for inventory item completeness from LLAgentWearables::editWearable(). because the check often fails and doesn't appear to be needed at all. - Added warning messages to LLAgentWearables::editWearable() so that it's easier to debug. - Replaced duplicated code in LLPanelOutfitEdit::onEditWearableClicked() with a call to gAgentWearables.editWearable(). Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/529/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index f3f67f2b03..e07d5c064b 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -495,35 +495,10 @@ void LLPanelOutfitEdit::onRemoveFromOutfitClicked(void) void LLPanelOutfitEdit::onEditWearableClicked(void) { - LLUUID id_to_edit = mCOFWearables->getSelectedUUID(); - LLViewerInventoryItem * item_to_edit = gInventory.getItem(id_to_edit); - - if (item_to_edit) + LLUUID selected_item_id = mCOFWearables->getSelectedUUID(); + if (selected_item_id.notNull()) { - // returns null if not a wearable (attachment, etc). - LLWearable* wearable_to_edit = gAgentWearables.getWearableFromAssetID(item_to_edit->getAssetUUID()); - if(wearable_to_edit) - { - bool can_modify = false; - bool is_complete = item_to_edit->isFinished(); - // if item_to_edit is a link, its properties are not appropriate, - // lets get original item with actual properties - LLViewerInventoryItem* original_item = gInventory.getItem(wearable_to_edit->getItemID()); - if(original_item) - { - can_modify = original_item->getPermissions().allowModifyBy(gAgentID); - is_complete = original_item->isFinished(); - } - - if (can_modify && is_complete) - { - LLSidepanelAppearance::editWearable(wearable_to_edit, getParent()); - if (mEditWearableBtn->getVisible()) - { - mEditWearableBtn->setVisible(FALSE); - } - } - } + gAgentWearables.editWearable(selected_item_id); } } -- cgit v1.2.3 From 206aab29dc93579360a6df6a2a99857fb955d072 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Wed, 9 Jun 2010 15:48:48 +0300 Subject: EXT-7577 FIXED added filtering add wearables panel (list and folder views) according to the current user's selection - added filtering add wearables panel (list and folder views) according to the current user's selection (rules for showing a particular view and setting a particular filtering are specified in the table at https://jira.secondlife.com/browse/EXT-7577) - minor refactoring Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/534/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 137 ++++++++++++++++++++++++++---------- 1 file changed, 100 insertions(+), 37 deletions(-) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index e07d5c064b..d7e06a951b 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -189,7 +189,8 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() mInitialized(false), mAddWearablesPanel(NULL), mWearableListMaskCollector(NULL), - mWearableListTypeCollector(NULL) + mWearableListTypeCollector(NULL), + mFilterComboBox(NULL) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); @@ -235,12 +236,12 @@ BOOL LLPanelOutfitEdit::postBuild() mListViewBtn = getChild("list_view_btn"); childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL); - childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showFilteredFolderWearablesPanel, this), NULL); - childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showFilteredWearablesPanel, this), NULL); + childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesFolderView, this), NULL); + childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), NULL); childSetCommitCallback("wearables_gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL); mCOFWearables = getChild("cof_wearables_list"); - mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onOutfitItemSelectionChange, this)); + mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::filterWearablesBySelectedItem, this)); mCOFWearables->getCOFCallbacks().mAddWearable = boost::bind(&LLPanelOutfitEdit::onAddWearableClicked, this); mCOFWearables->getCOFCallbacks().mEditWearable = boost::bind(&LLPanelOutfitEdit::onEditWearableClicked, this); @@ -258,19 +259,20 @@ BOOL LLPanelOutfitEdit::postBuild() mCOFDragAndDropObserver = new LLCOFDragAndDropObserver(mInventoryItemsPanel->getModel()); - LLComboBox* type_filter = getChild("filter_wearables_combobox"); - type_filter->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onTypeFilterChanged, this, _1)); - type_filter->removeall(); + mFilterComboBox = getChild("filter_wearables_combobox"); + mFilterComboBox->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onTypeFilterChanged, this, _1)); + mFilterComboBox->removeall(); for (U32 i = 0; i < mLookItemTypes.size(); ++i) { - type_filter->add(mLookItemTypes[i].displayName); + mFilterComboBox->add(mLookItemTypes[i].displayName); } - type_filter->setCurrentByIndex(LIT_ALL); + mFilterComboBox->setCurrentByIndex(LIT_ALL); mSearchFilter = getChild("look_item_filter"); mSearchFilter->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onSearchEdit, this, _2)); - childSetAction("show_add_wearables_btn", boost::bind(&LLPanelOutfitEdit::toggleAddWearablesPanel, this)); + childSetAction("show_add_wearables_btn", boost::bind(&LLPanelOutfitEdit::onAddMoreButtonClicked, this)); + childSetAction("add_to_outfit_btn", boost::bind(&LLPanelOutfitEdit::onAddToOutfitClicked, this)); mEditWearableBtn = getChild("edit_wearable_btn"); @@ -353,7 +355,7 @@ void LLPanelOutfitEdit::showWearablesFilter() } } -void LLPanelOutfitEdit::showFilteredWearablesPanel() +void LLPanelOutfitEdit::showWearablesListView() { if(switchPanels(mInventoryItemsPanel, mWearableItemsPanel)) { @@ -364,7 +366,7 @@ void LLPanelOutfitEdit::showFilteredWearablesPanel() mListViewBtn->setToggleState(TRUE); } -void LLPanelOutfitEdit::showFilteredFolderWearablesPanel() +void LLPanelOutfitEdit::showWearablesFolderView() { if(switchPanels(mWearableItemsPanel, mInventoryItemsPanel)) { @@ -377,17 +379,12 @@ void LLPanelOutfitEdit::showFilteredFolderWearablesPanel() void LLPanelOutfitEdit::onTypeFilterChanged(LLUICtrl* ctrl) { - LLComboBox* type_filter = dynamic_cast(ctrl); - llassert(type_filter); - if (type_filter) - { - U32 curr_filter_type = type_filter->getCurrentIndex(); - mInventoryItemsPanel->setFilterTypes(mLookItemTypes[curr_filter_type].inventoryMask); + U32 curr_filter_type = mFilterComboBox->getCurrentIndex(); + mInventoryItemsPanel->setFilterTypes(mLookItemTypes[curr_filter_type].inventoryMask); + + mWearableListMaskCollector->setFilterMask(mLookItemTypes[curr_filter_type].inventoryMask); + mWearableListManager->setFilterCollector(mWearableListMaskCollector); - mWearableListMaskCollector->setFilterMask(mLookItemTypes[curr_filter_type].inventoryMask); - mWearableListManager->setFilterCollector(mWearableListMaskCollector); - } - mSavedFolderState->setApply(TRUE); mInventoryItemsPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState); @@ -471,7 +468,7 @@ void LLPanelOutfitEdit::onAddWearableClicked(void) if(item) { - showFilteredWearableItemsList(item->getWearableType()); + showFilteredWearablesListView(item->getWearableType()); } } @@ -481,7 +478,7 @@ void LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked(LLUUID selected_item_id if (item && item->getType() == LLAssetType::AT_BODYPART) { - showFilteredWearableItemsList(item->getWearableType()); + showFilteredWearablesListView(item->getWearableType()); } } @@ -538,24 +535,81 @@ void LLPanelOutfitEdit::onInventorySelectionChange(const std::dequeaddChild(mAddToLookBtn); */ } -void LLPanelOutfitEdit::onOutfitItemSelectionChange(void) -{ - LLUUID item_id = mCOFWearables->getSelectedUUID(); - //*TODO show Edit Wearable Button +void LLPanelOutfitEdit::applyFilter(e_look_item_type type) +{ + mFilterComboBox->setCurrentByIndex(type); + mFilterComboBox->onCommit(); +} + +void LLPanelOutfitEdit::filterWearablesBySelectedItem(void) +{ + if (!mAddWearablesPanel->getVisible()) return; + + uuid_vec_t ids; + mCOFWearables->getSelectedUUIDs(ids); - LLViewerInventoryItem* item_to_remove = gInventory.getItem(item_id); - if (!item_to_remove) return; + bool nothing_selected = ids.empty(); + bool one_selected = ids.size() == 1; + bool more_than_one_selected = ids.size() > 1; + bool is_dummy_item = (ids.size() && dynamic_cast(mCOFWearables->getSelectedItem())); - switch (item_to_remove->getType()) + //resetting selection if no item is selected or than one item is selected + if (nothing_selected || more_than_one_selected) { - case LLAssetType::AT_CLOTHING: - case LLAssetType::AT_OBJECT: - default: - break; + if (nothing_selected) + { + showWearablesFolderView(); + } + + if (more_than_one_selected) + { + showWearablesListView(); + } + + applyFilter(LIT_ALL); + return; } + + + //filter wearables by a type represented by a dummy item + if (one_selected && is_dummy_item) + { + onAddWearableClicked(); + return; + } + + LLViewerInventoryItem* item = gInventory.getItem(ids[0]); + if (!item && ids[0].notNull()) + { + //Inventory misses an item with non-zero id + showWearablesListView(); + applyFilter(LIT_ALL); + return; + } + + if (one_selected && !is_dummy_item) + { + if (item->isWearableType()) + { + //single clothing or bodypart item is selected + showFilteredWearablesListView(item->getWearableType()); + mFilterComboBox->setLabel(getString("Filter.Custom")); + return; + } + else + { + //attachment is selected + showWearablesListView(); + applyFilter(LIT_ATTACHMENT); + return; + } + } + } + + void LLPanelOutfitEdit::update() { mCOFWearables->refresh(); @@ -676,12 +730,21 @@ void LLPanelOutfitEdit::onGearButtonClick(LLUICtrl* clicked_button) LLMenuGL::showPopup(clicked_button, mGearMenu, 0, menu_y); } -void LLPanelOutfitEdit::showFilteredWearableItemsList(LLWearableType::EType type) +void LLPanelOutfitEdit::onAddMoreButtonClicked() +{ + toggleAddWearablesPanel(); + filterWearablesBySelectedItem(); +} + +void LLPanelOutfitEdit::showFilteredWearablesListView(LLWearableType::EType type) { + mFilterComboBox->setLabel(getString("Filter.Custom")); mWearableListTypeCollector->setType(type); mWearableListManager->setFilterCollector(mWearableListTypeCollector); showAddWearablesPanel(true); - showFilteredWearablesPanel(); + showWearablesListView(); } + + // EOF -- cgit v1.2.3 From 92807a6fe27144fd3769fd91856798908e076e91 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Thu, 10 Jun 2010 12:50:30 +0300 Subject: EXT-7671 FIXED assigned appropriate callback for second Gear menu (panel outfit edit) Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/542/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index d7e06a951b..3d0684afca 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -239,6 +239,7 @@ BOOL LLPanelOutfitEdit::postBuild() childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesFolderView, this), NULL); childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), NULL); childSetCommitCallback("wearables_gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL); + childSetCommitCallback("gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL); mCOFWearables = getChild("cof_wearables_list"); mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::filterWearablesBySelectedItem, this)); -- cgit v1.2.3 From e22f4bb4e793457cf8f18db530c306fa22e8c35b Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 10 Jun 2010 14:43:28 +0300 Subject: EXT-7613 FIXED Provided updating of base outfit name on outfit rename event. 1 Updated LLOutfitObserver to provide controlling of changing outfit name. 2 Added call of LLPanelOutfitEdit::updateCurrentOutfitName to LLPanelOutfitEdit::updateVerbs since both should be called on BOFChanged signal. 3 Corrected updating field LLOutfitObserver::mBaseOutfitLastVersion. reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/553/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 3d0684afca..32b209dd0d 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -707,6 +707,7 @@ void LLPanelOutfitEdit::updateVerbs() mStatus->setText(outfit_is_dirty ? getString("unsaved_changes") : getString("now_editing")); + updateCurrentOutfitName(); } bool LLPanelOutfitEdit::switchPanels(LLPanel* switch_from_panel, LLPanel* switch_to_panel) -- cgit v1.2.3