From 5fcdff31253231c6a63fe05560be9a65fb0de575 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Mon, 21 Jun 2010 14:34:08 +0300 Subject: EXT-7797 FIXED Outfit Editor: Clicking fliter button should set focus in filter field - Set focus on filter field Reviewed by Mike Antipov and Neal Orman at https://codereview.productengine.com/secondlife/r/598/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 5fac7efb84..7a588193c8 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -452,6 +452,10 @@ void LLPanelOutfitEdit::showWearablesFilter() mSearchFilter->clear(); onSearchEdit(LLStringUtil::null); } + else + { + mSearchFilter->setFocus(TRUE); + } } void LLPanelOutfitEdit::showWearablesListView() -- cgit v1.3 From baddb7154981f038ddf0218788a932d46e2b69ce Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 21 Jun 2010 15:14:42 +0300 Subject: EXT-7822 WIP changed the default plus button action from add to replace Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/617 --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 7 ++++--- indra/newview/llpaneloutfitedit.h | 2 +- indra/newview/skins/default/xui/en/panel_outfit_edit.xml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 7a588193c8..6b5eb23a9b 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -371,7 +371,7 @@ BOOL LLPanelOutfitEdit::postBuild() childSetAction("show_add_wearables_btn", boost::bind(&LLPanelOutfitEdit::onAddMoreButtonClicked, this)); - childSetAction("add_to_outfit_btn", boost::bind(&LLPanelOutfitEdit::onAddToOutfitClicked, this)); + childSetAction("plus_btn", boost::bind(&LLPanelOutfitEdit::onPlusBtnClicked, this)); mEditWearableBtn = getChild("edit_wearable_btn"); mEditWearableBtn->setEnabled(FALSE); @@ -557,7 +557,7 @@ void LLPanelOutfitEdit::onSearchEdit(const std::string& string) } -void LLPanelOutfitEdit::onAddToOutfitClicked(void) +void LLPanelOutfitEdit::onPlusBtnClicked(void) { LLUUID selected_id; if (mInventoryItemsPanel->getVisible()) @@ -577,7 +577,8 @@ void LLPanelOutfitEdit::onAddToOutfitClicked(void) if (selected_id.isNull()) return; - LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id); + //replacing instead of adding the item + LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id, true, true); } void LLPanelOutfitEdit::onAddWearableClicked(void) diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 484f3fcb9f..f449fbca27 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -146,7 +146,7 @@ public: void onListViewFilterCommitted(LLUICtrl* ctrl); void onSearchEdit(const std::string& string); void onInventorySelectionChange(const std::deque &items, BOOL user_action); - void onAddToOutfitClicked(void); + void onPlusBtnClicked(void); void applyFolderViewFilter(EFolderViewItemType type); void applyListViewFilter(EListViewItemType type); diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index 80fbb66ff4..819ba7f878 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -459,7 +459,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap label="" layout="topleft" left_pad="1" - name="add_to_outfit_btn" + name="plus_btn" top="1" width="31" /> Date: Tue, 22 Jun 2010 18:41:40 +0300 Subject: EXT-7805 FIXED set tool_tip for "plus" button when body_part is selected in "Add more" panel (Edit Outfit) Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/626/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 70 ++++++++++++++-------- indra/newview/llpaneloutfitedit.h | 5 +- .../skins/default/xui/en/panel_outfit_edit.xml | 3 + 3 files changed, 50 insertions(+), 28 deletions(-) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 6b5eb23a9b..aac020087b 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -252,7 +252,8 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() mInitialized(false), mAddWearablesPanel(NULL), mFolderViewFilterCmbBox(NULL), - mListViewFilterCmbBox(NULL) + mListViewFilterCmbBox(NULL), + mPlusBtn(NULL) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); @@ -343,9 +344,9 @@ BOOL LLPanelOutfitEdit::postBuild() mInventoryItemsPanel = getChild("folder_view"); mInventoryItemsPanel->setFilterTypes(ALL_ITEMS_MASK); mInventoryItemsPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mInventoryItemsPanel->setSelectCallback(boost::bind(&LLPanelOutfitEdit::onInventorySelectionChange, this, _1, _2)); - mInventoryItemsPanel->getRootFolder()->setReshapeCallback(boost::bind(&LLPanelOutfitEdit::onInventorySelectionChange, this, _1, _2)); - + mInventoryItemsPanel->setSelectCallback(boost::bind(&LLPanelOutfitEdit::onInventorySelectionChange, this)); + mInventoryItemsPanel->getRootFolder()->setReshapeCallback(boost::bind(&LLPanelOutfitEdit::onInventorySelectionChange, this)); + mCOFDragAndDropObserver = new LLCOFDragAndDropObserver(mInventoryItemsPanel->getModel()); mFolderViewFilterCmbBox = getChild("folder_view_filter_combobox"); @@ -371,7 +372,8 @@ BOOL LLPanelOutfitEdit::postBuild() childSetAction("show_add_wearables_btn", boost::bind(&LLPanelOutfitEdit::onAddMoreButtonClicked, this)); - childSetAction("plus_btn", boost::bind(&LLPanelOutfitEdit::onPlusBtnClicked, this)); + mPlusBtn = getChild("plus_btn"); + mPlusBtn->setClickedCallback(boost::bind(&LLPanelOutfitEdit::onPlusBtnClicked, this)); mEditWearableBtn = getChild("edit_wearable_btn"); mEditWearableBtn->setEnabled(FALSE); @@ -382,6 +384,8 @@ BOOL LLPanelOutfitEdit::postBuild() mWearablesListViewPanel = getChild("filtered_wearables_panel"); mWearableItemsList = getChild("list_view"); + mWearableItemsList->setCommitOnSelectionChange(true); + mWearableItemsList->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onInventorySelectionChange, this)); mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this)); return TRUE; @@ -559,21 +563,7 @@ void LLPanelOutfitEdit::onSearchEdit(const std::string& string) void LLPanelOutfitEdit::onPlusBtnClicked(void) { - LLUUID selected_id; - if (mInventoryItemsPanel->getVisible()) - { - LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem(); - if (!curr_item) return; - - LLFolderViewEventListener* listenerp = curr_item->getListener(); - if (!listenerp) return; - - selected_id = listenerp->getUUID(); - } - else if (mWearablesListViewPanel->getVisible()) - { - selected_id = mWearableItemsList->getSelectedUUID(); - } + LLUUID selected_id = getSelectedItemUUID(); if (selected_id.isNull()) return; @@ -658,22 +648,28 @@ void LLPanelOutfitEdit::onEditWearableClicked(void) } } -void LLPanelOutfitEdit::onInventorySelectionChange(const std::deque &items, BOOL user_action) +void LLPanelOutfitEdit::onInventorySelectionChange() { - LLFolderViewItem* current_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem(); - if (!current_item) + LLUUID item_uuid = getSelectedItemUUID(); + if (item_uuid.isNull()) { return; } - LLViewerInventoryItem* item = current_item->getInventoryItem(); - if (!item) return; + LLViewerInventoryItem* item(gInventory.getItem(item_uuid)); + if (!item) + { + return; + } switch (item->getType()) { - case LLAssetType::AT_CLOTHING: case LLAssetType::AT_BODYPART: + mPlusBtn->setToolTip(getString("replace_body_part")); + break; + case LLAssetType::AT_CLOTHING: case LLAssetType::AT_OBJECT: + mPlusBtn->setToolTip(LLStringUtil::null); default: break; } @@ -934,4 +930,26 @@ void LLPanelOutfitEdit::onOutfitChanging(bool started) indicator->setVisible(started); } +LLUUID LLPanelOutfitEdit::getSelectedItemUUID() +{ + LLUUID selected_id; + if (mInventoryItemsPanel->getVisible()) + { + LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem(); + if (!curr_item) return selected_id; + + LLFolderViewEventListener* listenerp = curr_item->getListener(); + if (!listenerp) return selected_id; + + selected_id = listenerp->getUUID(); + } + else if (mWearablesListViewPanel->getVisible()) + { + selected_id = mWearableItemsList->getSelectedUUID(); + } + + return selected_id; +} + + // EOF diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index f449fbca27..aa5d00903a 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -145,7 +145,7 @@ public: void onFolderViewFilterCommitted(LLUICtrl* ctrl); void onListViewFilterCommitted(LLUICtrl* ctrl); void onSearchEdit(const std::string& string); - void onInventorySelectionChange(const std::deque &items, BOOL user_action); + void onInventorySelectionChange(); void onPlusBtnClicked(void); void applyFolderViewFilter(EFolderViewItemType type); @@ -192,7 +192,7 @@ private: void onAddMoreButtonClicked(); void showFilteredWearablesListView(LLWearableType::EType type); void onOutfitChanging(bool started); - + LLUUID getSelectedItemUUID(); LLTextBox* mCurrentOutfitName; LLTextBox* mStatus; @@ -203,6 +203,7 @@ private: LLButton* mEditWearableBtn; LLButton* mFolderViewBtn; LLButton* mListViewBtn; + LLButton* mPlusBtn; LLPanel* mAddWearablesPanel; LLComboBox* mFolderViewFilterCmbBox; diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index 819ba7f878..d6549adfef 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -54,6 +54,9 @@ +