summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/lloutfitgallery.cpp5
-rw-r--r--indra/newview/lloutfitgallery.h2
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp50
-rw-r--r--indra/newview/llpaneloutfitsinventory.h3
4 files changed, 47 insertions, 13 deletions
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index e6c41b612f..f29fc53dea 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -508,6 +508,11 @@ void LLOutfitGallery::onChangeOutfitSelection(LLWearableItemsList* list, const L
}
}
+void LLOutfitGallery::wearSelectedOutfit()
+{
+ LLAppearanceMgr::instance().replaceCurrentOutfit(getSelectedOutfitUUID());
+}
+
bool LLOutfitGallery::hasItemSelected()
{
return false;
diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h
index b8c7d66406..a22e86df83 100644
--- a/indra/newview/lloutfitgallery.h
+++ b/indra/newview/lloutfitgallery.h
@@ -89,6 +89,8 @@ public:
void onSelectPhoto(LLUUID selected_outfit_id);
void onTakeSnapshot(LLUUID selected_outfit_id);
+ void wearSelectedOutfit();
+
/*virtual*/ void setFilterSubString(const std::string& string);
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index c0c1adddf3..3f700496a9 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -167,14 +167,22 @@ void LLPanelOutfitsInventory::onSearchEdit(const std::string& string)
void LLPanelOutfitsInventory::onWearButtonClick()
{
- if (mMyOutfitsPanel->hasItemSelected())
+ if(isOutfitsListPanelActive())
{
- mMyOutfitsPanel->wearSelectedItems();
+ if (mMyOutfitsPanel->hasItemSelected())
+ {
+ mMyOutfitsPanel->wearSelectedItems();
+ }
+ else
+ {
+ mMyOutfitsPanel->performAction("replaceoutfit");
+ }
}
- else
+ else if(isOutfitsGalleryPanelActive())
{
- mMyOutfitsPanel->performAction("replaceoutfit");
+ mOutfitGalleryPanel->wearSelectedOutfit();
}
+
}
bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD& response)
@@ -236,7 +244,7 @@ void LLPanelOutfitsInventory::initListCommandsHandlers()
mListCommands = getChild<LLPanel>("bottom_panel");
mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this));
mMyOutfitsPanel->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this));
- mOutfitGalleryPanel->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onGalleryTrashButtonClick, this));
+ mOutfitGalleryPanel->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this));
}
void LLPanelOutfitsInventory::updateListCommands()
@@ -252,17 +260,19 @@ void LLPanelOutfitsInventory::updateListCommands()
wear_btn->setEnabled(wear_enabled);
wear_btn->setVisible(wear_visible);
mSaveComboBtn->setMenuItemEnabled("save_outfit", make_outfit_enabled);
- wear_btn->setToolTip(getString(mMyOutfitsPanel->hasItemSelected() ? "wear_items_tooltip" : "wear_outfit_tooltip"));
+ wear_btn->setToolTip(getString((!isOutfitsGalleryPanelActive() && mMyOutfitsPanel->hasItemSelected()) ? "wear_items_tooltip" : "wear_outfit_tooltip"));
}
void LLPanelOutfitsInventory::onTrashButtonClick()
{
- mMyOutfitsPanel->removeSelected();
-}
-
-void LLPanelOutfitsInventory::onGalleryTrashButtonClick()
-{
- mOutfitGalleryPanel->removeSelected();
+ if(isOutfitsListPanelActive())
+ {
+ mMyOutfitsPanel->removeSelected();
+ }
+ else if(isOutfitsGalleryPanelActive())
+ {
+ mOutfitGalleryPanel->removeSelected();
+ }
}
bool LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
@@ -309,6 +319,22 @@ bool LLPanelOutfitsInventory::isCOFPanelActive() const
return mActivePanel->getName() == COF_TAB_NAME;
}
+bool LLPanelOutfitsInventory::isOutfitsListPanelActive() const
+{
+ if (!mActivePanel) return false;
+
+ return mActivePanel->getName() == OUTFITS_TAB_NAME;
+}
+
+bool LLPanelOutfitsInventory::isOutfitsGalleryPanelActive() const
+{
+ if (!mActivePanel) return false;
+
+ return mActivePanel->getName() == OUTFIT_GALLERY_TAB_NAME;
+}
+
+
+
void LLPanelOutfitsInventory::setWearablesLoading(bool val)
{
updateVerbs();
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index efb9524a21..6a0ea04fa6 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -73,6 +73,8 @@ protected:
void initTabPanels();
void onTabChange();
bool isCOFPanelActive() const;
+ bool isOutfitsListPanelActive() const;
+ bool isOutfitsGalleryPanelActive() const;
private:
LLPanelAppearanceTab* mActivePanel;
@@ -91,7 +93,6 @@ protected:
void onWearButtonClick();
void showGearMenu();
void onTrashButtonClick();
- void onGalleryTrashButtonClick();
bool isActionEnabled(const LLSD& userdata);
void setWearablesLoading(bool val);
void onWearablesLoaded();