diff options
-rw-r--r-- | indra/newview/llpanelgroup.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitedit.cpp | 70 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitedit.h | 7 |
3 files changed, 74 insertions, 6 deletions
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 2fc74e138b..c383d04940 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -545,6 +545,7 @@ void LLPanelGroup::draw() { mRefreshTimer.stop(); childEnable("btn_refresh"); + childEnable("groups_accordion"); } LLButton* button_apply = findChild<LLButton>("btn_apply"); @@ -573,6 +574,8 @@ void LLPanelGroup::refreshData() // 5 second timeout childDisable("btn_refresh"); + childDisable("groups_accordion"); + mRefreshTimer.start(); mRefreshTimer.setTimerExpirySec(5); } diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index b56cf5c3ce..126830e05d 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -42,6 +42,7 @@ #include "lloutfitobserver.h" #include "llcofwearables.h" #include "llfilteredwearablelist.h" +#include "llfolderviewitem.h" #include "llinventory.h" #include "llinventoryitemslist.h" #include "llviewercontrol.h" @@ -328,7 +329,9 @@ BOOL LLPanelOutfitEdit::postBuild() childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL); childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesFolderView, this), NULL); + childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), NULL); + childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, 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); childSetCommitCallback("shop_btn_1", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); @@ -489,9 +492,7 @@ void LLPanelOutfitEdit::showWearablesListView() { if(switchPanels(mInventoryItemsPanel, mWearablesListViewPanel)) { - mFolderViewBtn->setToggleState(FALSE); - mFolderViewBtn->setImageOverlay(getString("folder_view_off"), mFolderViewBtn->getImageOverlayHAlign()); - mListViewBtn->setImageOverlay(getString("list_view_on"), mListViewBtn->getImageOverlayHAlign()); + updateWearablesPanelVerbButtons(); updateFiltersVisibility(); } mListViewBtn->setToggleState(TRUE); @@ -501,9 +502,7 @@ void LLPanelOutfitEdit::showWearablesFolderView() { if(switchPanels(mWearablesListViewPanel, mInventoryItemsPanel)) { - mListViewBtn->setToggleState(FALSE); - mListViewBtn->setImageOverlay(getString("list_view_off"), mListViewBtn->getImageOverlayHAlign()); - mFolderViewBtn->setImageOverlay(getString("folder_view_on"), mFolderViewBtn->getImageOverlayHAlign()); + updateWearablesPanelVerbButtons(); updateFiltersVisibility(); } mFolderViewBtn->setToggleState(TRUE); @@ -1155,5 +1154,64 @@ void LLPanelOutfitEdit::onCOFChanged() update(); } +void LLPanelOutfitEdit::updateWearablesPanelVerbButtons() +{ + if(mWearablesListViewPanel->getVisible()) + { + mFolderViewBtn->setToggleState(FALSE); + mFolderViewBtn->setImageOverlay(getString("folder_view_off"), mFolderViewBtn->getImageOverlayHAlign()); + mListViewBtn->setImageOverlay(getString("list_view_on"), mListViewBtn->getImageOverlayHAlign()); + } + else if(mInventoryItemsPanel->getVisible()) + { + mListViewBtn->setToggleState(FALSE); + mListViewBtn->setImageOverlay(getString("list_view_off"), mListViewBtn->getImageOverlayHAlign()); + mFolderViewBtn->setImageOverlay(getString("folder_view_on"), mFolderViewBtn->getImageOverlayHAlign()); + } +} + +void LLPanelOutfitEdit::saveListSelection() +{ + if(mWearablesListViewPanel->getVisible()) + { + std::set<LLUUID> selected_ids = mInventoryItemsPanel->getRootFolder()->getSelectionList(); + + if(!selected_ids.size()) return; + + mWearableItemsList->resetSelection(); + + for (std::set<LLUUID>::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id) + { + mWearableItemsList->selectItemByUUID(*item_id, true); + } + mWearableItemsList->scrollToShowFirstSelectedItem(); + } + else if(mInventoryItemsPanel->getVisible()) + { + std::vector<LLUUID> selected_ids; + mWearableItemsList->getSelectedUUIDs(selected_ids); + + if(!selected_ids.size()) return; + + mInventoryItemsPanel->clearSelection(); + LLFolderView* root = mInventoryItemsPanel->getRootFolder(); + + if(!root) return; + + for(std::vector<LLUUID>::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id) + { + LLFolderViewItem* item = root->getItemByID(*item_id); + if (!item) continue; + + LLFolderViewFolder* parent = item->getParentFolder(); + if(parent) + { + parent->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP); + } + mInventoryItemsPanel->getRootFolder()->changeSelection(item, TRUE); + } + mInventoryItemsPanel->getRootFolder()->scrollToShowSelection(); + } +} // EOF diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 13ceda98a6..b3394e45a3 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -201,6 +201,13 @@ private: void getCurrentItemUUID(LLUUID& selected_id); void onCOFChanged(); + /** + * Method preserves selection while switching between folder/list view modes + */ + void saveListSelection(); + + void updateWearablesPanelVerbButtons(); + typedef std::pair<LLWearableType::EType, size_t> selection_info_t; LLWearableType::EType getCOFWearablesSelectionType() const; |