From ccd4215fd4292ed34d68dd7be2c2cc2de92addcc Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 30 Apr 2010 19:55:00 +0300 Subject: Implemented task EXT-6559 (Appearance panel: Add edit button in place of the image display next to current look). - Changed the topmost part of the Appearance panel: * Added new "Edit current outfit" button. * Implemented COF status display (unsaved/wearing) according to the spec. * Minor XUI changes (font / dimensions / bg color). - Removed the temporary "Edit current outfit" button from the bottom of the Appearance panel. - Removed the temporary "ShowDebugAppearanceEditor" setting. TODO: use icons from the spec (currently missing). Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/339/ --HG-- branch : product-engine --- indra/newview/app_settings/settings.xml | 11 --- indra/newview/llpaneloutfitsinventory.cpp | 13 ---- indra/newview/llpaneloutfitsinventory.h | 3 - indra/newview/llsidepanelappearance.cpp | 18 ++++- indra/newview/llsidepanelappearance.h | 3 +- indra/newview/llviewercontrol.cpp | 7 -- .../default/xui/en/panel_outfits_inventory.xml | 25 +++---- .../skins/default/xui/en/sidepanel_appearance.xml | 84 ++++++++++++++-------- 8 files changed, 79 insertions(+), 85 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 280c3d642c..73eb269f66 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7963,17 +7963,6 @@ Value 0 - ShowDebugAppearanceEditor - - Comment - Show debugging appearance editor - Persist - 1 - Type - Boolean - Value - 0 - ShowEmptyFoldersWhenSearching Comment diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 80964938f5..59c1fb4f3c 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -68,7 +68,6 @@ static const std::string OUTFITS_TAB_NAME = "outfitslist_tab"; static const std::string COF_TAB_NAME = "cof_tab"; static LLRegisterPanelClassWrapper t_inventory("panel_outfits_inventory"); -bool LLPanelOutfitsInventory::sShowDebugEditor = false; LLPanelOutfitsInventory::LLPanelOutfitsInventory() : @@ -88,7 +87,6 @@ LLPanelOutfitsInventory::~LLPanelOutfitsInventory() // virtual BOOL LLPanelOutfitsInventory::postBuild() { - sShowDebugEditor = gSavedSettings.getBOOL("ShowDebugAppearanceEditor"); initTabPanels(); initListCommandsHandlers(); @@ -133,7 +131,6 @@ void LLPanelOutfitsInventory::updateVerbs() if (mListCommands) { - mListCommands->childSetVisible("edit_current_outfit_btn",sShowDebugEditor); updateListCommands(); } } @@ -307,14 +304,6 @@ void LLPanelOutfitsInventory::onSelectionChange(const std::dequeshowPanel("sidepanel_appearance", key); -} - LLFolderViewEventListener *LLPanelOutfitsInventory::getCorrectListenerForAction() { // TODO: add handling "My Outfits" tab. @@ -369,8 +358,6 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() mListCommands->childSetAction("make_outfit_btn", boost::bind(&LLPanelOutfitsInventory::onAddButtonClick, this)); mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this)); - mListCommands->childSetAction("edit_current_outfit_btn", boost::bind(&LLPanelOutfitsInventory::showEditOutfitPanel, this)); - LLDragAndDropButton* trash_btn = mListCommands->getChild("trash_btn"); trash_btn->setDragAndDropHandler(boost::bind(&LLPanelOutfitsInventory::handleDragAndDropToTrash, this , _4 // BOOL drop diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 4234cc45c5..975d99f834 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -65,7 +65,6 @@ public: bool onSaveCommit(const LLSD& notification, const LLSD& response); void onSelectionChange(const std::deque &items, BOOL user_action); - void showEditOutfitPanel(); // If a compatible listener type is selected, then return a pointer to that. // Otherwise, return NULL. @@ -131,8 +130,6 @@ private: // List Commands // //////////////////////////////////////////////////////////////////////////////// /// -public: - static bool sShowDebugEditor; }; #endif //LL_LLPANELOUTFITSINVENTORY_H diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index f38df19de0..08098e2adb 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -44,6 +44,7 @@ #include "llfoldervieweventlistener.h" #include "llpaneleditwearable.h" #include "llpaneloutfitsinventory.h" +#include "llsidetray.h" #include "lltextbox.h" #include "lluictrlfactory.h" #include "llviewerregion.h" @@ -115,6 +116,8 @@ BOOL LLSidepanelAppearance::postBuild() mEditAppearanceBtn = getChild("editappearance_btn"); mEditAppearanceBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditAppearanceButtonClicked, this)); + childSetAction("edit_outfit_btn", boost::bind(&LLSidepanelAppearance::onEditOutfitButtonClicked, this)); + mEditBtn = getChild("edit_btn"); mEditBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditButtonClicked, this)); @@ -154,7 +157,7 @@ BOOL LLSidepanelAppearance::postBuild() mCurrentLookName = getChild("currentlook_name"); - mOutfitDirtyTag = getChild("currentlook_title"); + mOutfitStatus = getChild("currentlook_status"); mCurrOutfitPanel = getChild("panel_currentlook"); @@ -238,6 +241,13 @@ void LLSidepanelAppearance::onEditAppearanceButtonClicked() } } +void LLSidepanelAppearance::onEditOutfitButtonClicked() +{ + LLSD key; + key["type"] = "edit_outfit"; + LLSideTray::getInstance()->showPanel("sidepanel_appearance", key); +} + void LLSidepanelAppearance::onEditButtonClicked() { toggleOutfitEditPanel(FALSE); @@ -339,7 +349,11 @@ void LLSidepanelAppearance::updateVerbs() void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name) { - mOutfitDirtyTag->setVisible(LLAppearanceMgr::getInstance()->isOutfitDirty()); + // Set current outfit status (wearing/unsaved). + bool dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); + std::string cof_status_str = getString(dirty ? "Unsaved Changes" : "Now Wearing"); + mOutfitStatus->setText(cof_status_str); + if (name == "") { std::string outfit_name; diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 0a609797fb..0a2d882a0b 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -71,6 +71,7 @@ private: void onOpenOutfitButtonClicked(); void onEditAppearanceButtonClicked(); + void onEditOutfitButtonClicked(); void onEditButtonClicked(); void onEditWearBackClicked(); @@ -90,7 +91,7 @@ private: LLPanel* mCurrOutfitPanel; LLTextBox* mCurrentLookName; - LLTextBox* mOutfitDirtyTag; + LLTextBox* mOutfitStatus; // Used to make sure the user's inventory is in memory. LLCurrentlyWornFetchObserver* mFetchWorn; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 874995a09e..ee3b27c8da 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -496,12 +496,6 @@ bool toggle_show_favorites_panel(const LLSD& newvalue) return true; } -bool toggle_show_appearance_editor(const LLSD& newvalue) -{ - LLPanelOutfitsInventory::sShowDebugEditor = newvalue.asBoolean(); - return true; -} - bool toggle_show_object_render_cost(const LLSD& newvalue) { LLFloaterTools::sShowObjectCost = newvalue.asBoolean(); @@ -650,7 +644,6 @@ void settings_setup_listeners() gSavedSettings.getControl("ShowSnapshotButton")->getSignal()->connect(boost::bind(&toggle_show_snapshot_button, _2)); gSavedSettings.getControl("ShowNavbarNavigationPanel")->getSignal()->connect(boost::bind(&toggle_show_navigation_panel, _2)); gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2)); - gSavedSettings.getControl("ShowDebugAppearanceEditor")->getSignal()->connect(boost::bind(&toggle_show_appearance_editor, _2)); gSavedSettings.getControl("ShowObjectRenderingCost")->getSignal()->connect(boost::bind(&toggle_show_object_render_cost, _2)); gSavedSettings.getControl("ForceShowGrid")->getSignal()->connect(boost::bind(&handleForceShowGrid, _2)); } diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml index b8ad278da7..9e59651bd1 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml @@ -5,7 +5,7 @@ background_opaque="true" background_visible="true" follows="all" - height="570" + height="575" label="Things" layout="topleft" min_height="350" @@ -14,7 +14,7 @@ border="false">