summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitedit.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-07-30 10:01:53 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-07-30 10:01:53 +0100
commit78c84f86f8c07ca448b24b7df2c29d57eafd0643 (patch)
treeffb78d0abcc13533185749be5272713afda44265 /indra/newview/llpaneloutfitedit.cpp
parentfd81ed9de7b3e97ab1cec2e58190ee5deb7a4a65 (diff)
parent7fcca83169287b5011b5b5a0193456e9a789619c (diff)
merge from PE's viewer-trunk
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp72
1 files changed, 65 insertions, 7 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index b56cf5c3ce..8f065aa711 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"
@@ -303,7 +304,7 @@ BOOL LLPanelOutfitEdit::postBuild()
mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.All"), new LLFindNonLinksByMask(ALL_ITEMS_MASK)));
mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Clothing"), new LLIsTypeActual(LLAssetType::AT_CLOTHING)));
mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Bodyparts"), new LLIsTypeActual(LLAssetType::AT_BODYPART)));
- mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Objects"), new LLFindByMask(ATTACHMENT_MASK)));;
+ mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Objects"), new LLFindNonLinksByMask(ATTACHMENT_MASK)));;
mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("shape"), new LLFindActualWearablesOfType(LLWearableType::WT_SHAPE)));
mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("skin"), new LLFindActualWearablesOfType(LLWearableType::WT_SKIN)));
mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("hair"), new LLFindActualWearablesOfType(LLWearableType::WT_HAIR)));
@@ -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