From ba59f71d5e1469f79494a50c647d929a63888685 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Fri, 28 May 2010 12:44:28 +0300 Subject: EXT-7341 FIXED updating My Outfits with wearables ordering information on the very first login added saving ordering information for wearables of already populated My Outfits category on the very first login Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/455/ --HG-- branch : product-engine --- indra/newview/llagentwearablesfetch.cpp | 48 ++++++++++++++++++++++++++++++++- indra/newview/llappearancemgr.cpp | 10 +++++-- indra/newview/llappearancemgr.h | 7 ++--- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 43a0d48d8b..ef0b97d376 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -40,6 +40,50 @@ #include "llstartup.h" #include "llvoavatarself.h" + +class LLOrderMyOutfitsOnDestroy: public LLInventoryCallback +{ +public: + LLOrderMyOutfitsOnDestroy() {}; + + virtual ~LLOrderMyOutfitsOnDestroy() + { + const LLUUID& my_outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); + if (my_outfits_id.isNull()) return; + + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + gInventory.getDirectDescendentsOf(my_outfits_id, cats, items); + if (!cats) return; + + //My Outfits should at least contain saved initial outfit and one another outfit + if (cats->size() < 2) + { + llwarning("My Outfits category was not populated properly", 0); + return; + } + + llinfos << "Starting updating My Outfits with wearables ordering information" << llendl; + + for (LLInventoryModel::cat_array_t::iterator outfit_iter = cats->begin(); + outfit_iter != cats->end(); ++outfit_iter) + { + const LLUUID& cat_id = (*outfit_iter)->getUUID(); + if (cat_id.isNull()) continue; + + // saved initial outfit already contains wearables ordering information + if (cat_id == LLAppearanceMgr::getInstance()->getBaseOutfitUUID()) continue; + + LLAppearanceMgr::getInstance()->updateClothingOrderingInfo(cat_id); + } + + llinfos << "Finished updating My Outfits with wearables ordering information" << llendl; + } + + /* virtual */ void fire(const LLUUID& inv_item) {}; +}; + + LLInitialWearablesFetch::LLInitialWearablesFetch(const LLUUID& cof_id) : LLInventoryFetchDescendentsObserver(cof_id) { @@ -483,6 +527,8 @@ void LLLibraryOutfitsFetch::contentsDone() LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t wearable_array; + LLPointer order_myoutfits_on_destroy = new LLOrderMyOutfitsOnDestroy; + for (uuid_vec_t::const_iterator folder_iter = mImportedClothingFolders.begin(); folder_iter != mImportedClothingFolders.end(); ++folder_iter) @@ -518,7 +564,7 @@ void LLLibraryOutfitsFetch::contentsDone() item->getName(), item->getDescription(), LLAssetType::AT_LINK, - NULL); + order_myoutfits_on_destroy); } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index e017fffa54..e90dd2ac75 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1792,10 +1792,16 @@ struct WearablesOrderComparator U32 mControlSize; }; -void LLAppearanceMgr::updateClothingOrderingInfo() +void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id) { + if (cat_id.isNull()) + { + cat_id = getCOF(); + } + + // COF is processed if cat_id is not specified LLInventoryModel::item_array_t wear_items; - getDescendentsOfAssetType(getCOF(), wear_items, LLAssetType::AT_CLOTHING, false); + getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING, false); wearables_by_type_t items_by_type(LLWearableType::WT_COUNT); divvyWearablesByType(wear_items, items_by_type); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 96541beb7d..dbde055c3a 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -154,15 +154,16 @@ public: //Divvy items into arrays by wearable type static void divvyWearablesByType(const LLInventoryModel::item_array_t& items, wearables_by_type_t& items_by_type); + //Check ordering information on wearables stored in links' descriptions and update if it is invalid + // COF is processed if cat_id is not specified + void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null); + protected: LLAppearanceMgr(); ~LLAppearanceMgr(); private: - //Check ordering information on wearables stored in links' descriptions and update if it is invalid - void updateClothingOrderingInfo(); - void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type); void getDescendentsOfAssetType(const LLUUID& category, -- cgit v1.2.3 From 959e4c40cc4366729635829c5deb9d23035321b6 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Fri, 28 May 2010 12:49:29 +0300 Subject: EXT-7208 PARTIAL FIXED fixed tattoo texture pickers, repositioned tattoo color picker - assigned callbacks for tattoo texture pickers - repositioned tattoo color picker Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/453/ --HG-- branch : product-engine --- .../skins/default/xui/en/panel_edit_tattoo.xml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml index 6d02dd41de..6fa9383507 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml @@ -32,7 +32,10 @@ name="Head Tattoo" tool_tip="Click to choose a picture" top="10" - width="94" /> + width="94" > + + + width="94" > + + + width="94" > + + -- cgit v1.2.3 From d42fd6cf7fa3ac4d7e2ef35cef50eb7740b4ec6d Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Fri, 28 May 2010 20:10:10 +0300 Subject: EXT-7472 FIXED Open add to outfit panel by (+) button click on unwearable items and by selecting 'Replace' menu item click body part context menu Main changes: - Added callback for a '(+) button' to the LLCOFCallbacks and bind it with LLPanelOutfitEdit::onAddWearableClicked - Created the callback(LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked) for 'Replace' menu item of context menu Related changes: - Changed LLFilteredWearableListManager so that it can use different functors (subclasses of LLInventoryCollectFunctor) as a criterion for LLInventoryItemsList filtering. Before it used only LLFindNonLinksByMask filter. Moved LLFindNonLinksByMask from to the llfilteredwearablelist.cpp to the llinventoryfunctions.h - Created getter 'LLPanelDummyClothingListItem::getWearableType()' for LLPanelDummyClothingListItem - Made 'add wearables panel' a member of LLPanelOutfitEdit so that not to use findChild each time panel is needed Reviewed by Igor Borovkov at http://jira.secondlife.com/browse/EXT-7472 --HG-- branch : product-engine --- indra/newview/llcofwearables.cpp | 16 +++++++++-- indra/newview/llcofwearables.h | 3 ++ indra/newview/llfilteredwearablelist.cpp | 46 +++++++++--------------------- indra/newview/llfilteredwearablelist.h | 9 +++--- indra/newview/llinventoryfunctions.cpp | 5 ++++ indra/newview/llinventoryfunctions.h | 35 ++++++++++++++++++++++- indra/newview/llpaneloutfitedit.cpp | 49 +++++++++++++++++++++++++++++--- indra/newview/llpaneloutfitedit.h | 9 ++++++ indra/newview/llwearableitemslist.cpp | 5 ++++ indra/newview/llwearableitemslist.h | 1 + 10 files changed, 134 insertions(+), 44 deletions(-) diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index dfc203111a..6e7a7fe937 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -43,6 +43,8 @@ #include "llmenugl.h" #include "llviewermenu.h" #include "llwearableitemslist.h" +#include "llpaneloutfitedit.h" +#include "llsidetray.h" static LLRegisterPanelClassWrapper t_cof_accodion_list_adaptor("accordion_list_adaptor"); @@ -135,8 +137,10 @@ protected: LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; LLUUID selected_id = mUUIDs.back(); - registrar.add("BodyPart.Replace", boost::bind(&LLAppearanceMgr::wearItemOnAvatar, - LLAppearanceMgr::getInstance(), selected_id, true, true)); + // *HACK* need to pass pointer to LLPanelOutfitEdit instead of LLSideTray::getInstance()->getPanel(). + // LLSideTray::getInstance()->getPanel() is rather slow variant + LLPanelOutfitEdit* panel_oe = dynamic_cast(LLSideTray::getInstance()->getPanel("panel_outfit_edit")); + registrar.add("BodyPart.Replace", boost::bind(&LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked, panel_oe, selected_id)); registrar.add("BodyPart.Edit", boost::bind(LLAgentWearables::editWearable, selected_id)); enable_registrar.add("BodyPart.OnEnable", boost::bind(&CofBodyPartContextMenu::onEnable, this, _2)); @@ -416,6 +420,7 @@ void LLCOFWearables::addClothingTypesDummies(const LLAppearanceMgr::wearables_by LLWearableType::EType w_type = static_cast(type); LLPanelInventoryListItemBase* item_panel = LLPanelDummyClothingListItem::create(w_type); if(!item_panel) continue; + item_panel->childSetAction("btn_add", mCOFCallbacks.mAddWearable); mClothing->addItem(item_panel, LLUUID::null, ADD_BOTTOM, false); } } @@ -435,6 +440,13 @@ bool LLCOFWearables::getSelectedUUIDs(uuid_vec_t& selected_ids) return selected_ids.size() != 0; } +LLPanel* LLCOFWearables::getSelectedItem() +{ + if (!mLastSelectedList) return NULL; + + return mLastSelectedList->getSelectedItem(); +} + void LLCOFWearables::clear() { mAttachments->clear(); diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index 590aa709dd..8f8bda2be8 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -107,6 +107,7 @@ public: typedef boost::function cof_callback_t; + cof_callback_t mAddWearable; cof_callback_t mMoveWearableCloser; cof_callback_t mMoveWearableFurther; cof_callback_t mEditWearable; @@ -123,6 +124,8 @@ public: LLUUID getSelectedUUID(); bool getSelectedUUIDs(uuid_vec_t& selected_ids); + LLPanel* getSelectedItem(); + void refresh(); void clear(); diff --git a/indra/newview/llfilteredwearablelist.cpp b/indra/newview/llfilteredwearablelist.cpp index fd99f673e0..28e159421c 100644 --- a/indra/newview/llfilteredwearablelist.cpp +++ b/indra/newview/llfilteredwearablelist.cpp @@ -37,32 +37,10 @@ #include "llinventoryitemslist.h" #include "llinventorymodel.h" -class LLFindNonLinksByMask : public LLInventoryCollectFunctor -{ -public: - LLFindNonLinksByMask(U64 mask) - : mFilterMask(mask) - {} - - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) - { - if(item && !item->getIsLinkType() && (mFilterMask & (1LL << item->getInventoryType())) ) - { - return true; - } - - return false; - } -private: - U64 mFilterMask; -}; - -////////////////////////////////////////////////////////////////////////// - -LLFilteredWearableListManager::LLFilteredWearableListManager(LLInventoryItemsList* list, U64 filter_mask) +LLFilteredWearableListManager::LLFilteredWearableListManager(LLInventoryItemsList* list, LLInventoryCollectFunctor* collector) : mWearableList(list) -, mFilterMask(filter_mask) +, mCollector(collector) { llassert(mWearableList); gInventory.addObserver(this); @@ -84,9 +62,9 @@ void LLFilteredWearableListManager::changed(U32 mask) populateList(); } -void LLFilteredWearableListManager::setFilterMask(U64 mask) +void LLFilteredWearableListManager::setFilterCollector(LLInventoryCollectFunctor* collector) { - mFilterMask = mask; + mCollector = collector; populateList(); } @@ -94,14 +72,16 @@ void LLFilteredWearableListManager::populateList() { LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; - LLFindNonLinksByMask collector(mFilterMask); - gInventory.collectDescendentsIf( - gInventory.getRootFolderID(), - cat_array, - item_array, - LLInventoryModel::EXCLUDE_TRASH, - collector); + if(mCollector) + { + gInventory.collectDescendentsIf( + gInventory.getRootFolderID(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + *mCollector); + } // Probably will also need to get items from Library (waiting for reply in EXT-6724). diff --git a/indra/newview/llfilteredwearablelist.h b/indra/newview/llfilteredwearablelist.h index 0780c02442..b7825c07af 100644 --- a/indra/newview/llfilteredwearablelist.h +++ b/indra/newview/llfilteredwearablelist.h @@ -32,6 +32,7 @@ #ifndef LL_LLFILTEREDWEARABLELIST_H #define LL_LLFILTEREDWEARABLELIST_H +#include "llinventoryfunctions.h" #include "llinventoryobserver.h" class LLInventoryItemsList; @@ -42,7 +43,7 @@ class LLFilteredWearableListManager : public LLInventoryObserver LOG_CLASS(LLFilteredWearableListManager); public: - LLFilteredWearableListManager(LLInventoryItemsList* list, U64 filter_mask); + LLFilteredWearableListManager(LLInventoryItemsList* list, LLInventoryCollectFunctor* collector); ~LLFilteredWearableListManager(); /** LLInventoryObserver implementation @@ -51,9 +52,9 @@ public: /*virtual*/ void changed(U32 mask); /** - * Sets new filter and applies it immediately + * Sets new collector and applies it immediately */ - void setFilterMask(U64 mask); + void setFilterCollector(LLInventoryCollectFunctor* collector); /** * Populates wearable list with filtered data. @@ -62,7 +63,7 @@ public: private: LLInventoryItemsList* mWearableList; - U64 mFilterMask; + LLInventoryCollectFunctor* mCollector; }; #endif //LL_LLFILTEREDWEARABLELIST_H diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index c38d45f0f5..6301ff0d6d 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -372,6 +372,11 @@ bool LLFindWearablesOfType::operator()(LLInventoryCategory* cat, LLInventoryItem return true; } +void LLFindWearablesOfType::setType(LLWearableType::EType type) +{ + mWearableType = type; +} + ///---------------------------------------------------------------------------- /// LLAssetIDMatches ///---------------------------------------------------------------------------- diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 8b96ba29d9..bb365573d7 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -251,6 +251,37 @@ public: }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLFindNonLinksByMask +// +// +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLFindNonLinksByMask : public LLInventoryCollectFunctor +{ +public: + LLFindNonLinksByMask(U64 mask) + : mFilterMask(mask) + {} + + virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + { + if(item && !item->getIsLinkType() && (mFilterMask & (1LL << item->getInventoryType())) ) + { + return true; + } + + return false; + } + + void setFilterMask(U64 mask) + { + mFilterMask = mask; + } + +private: + U64 mFilterMask; +}; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLFindWearables // @@ -272,8 +303,10 @@ public: LLFindWearablesOfType(LLWearableType::EType type) : mWearableType(type) {} virtual ~LLFindWearablesOfType() {} virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + void setType(LLWearableType::EType type); - const LLWearableType::EType mWearableType; +private: + LLWearableType::EType mWearableType; }; /** Inventory Collector Functions diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index ae4b288588..8d7a2b33be 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -67,6 +67,7 @@ #include "llsidepanelappearance.h" #include "lltoggleablemenu.h" #include "llwearablelist.h" +#include "llwearableitemslist.h" static LLRegisterPanelClassWrapper t_outfit_edit("panel_outfit_edit"); @@ -214,7 +215,10 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() mCOFObserver(NULL), mGearMenu(NULL), mCOFDragAndDropObserver(NULL), - mInitialized(false) + mInitialized(false), + mAddWearablesPanel(NULL), + mWearableListMaskCollector(NULL), + mWearableListTypeCollector(NULL) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); @@ -236,6 +240,9 @@ LLPanelOutfitEdit::~LLPanelOutfitEdit() delete mCOFObserver; delete mCOFDragAndDropObserver; + + delete mWearableListMaskCollector; + delete mWearableListTypeCollector; } BOOL LLPanelOutfitEdit::postBuild() @@ -261,6 +268,7 @@ BOOL LLPanelOutfitEdit::postBuild() mCOFWearables = getChild("cof_wearables_list"); mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onOutfitItemSelectionChange, this)); + mCOFWearables->getCOFCallbacks().mAddWearable = boost::bind(&LLPanelOutfitEdit::onAddWearableClicked, this); mCOFWearables->getCOFCallbacks().mEditWearable = boost::bind(&LLPanelOutfitEdit::onEditWearableClicked, this); mCOFWearables->getCOFCallbacks().mDeleteWearable = boost::bind(&LLPanelOutfitEdit::onRemoveFromOutfitClicked, this); mCOFWearables->getCOFCallbacks().mMoveWearableCloser = boost::bind(&LLPanelOutfitEdit::moveWearable, this, true); @@ -268,6 +276,7 @@ BOOL LLPanelOutfitEdit::postBuild() mCOFWearables->childSetAction("add_btn", boost::bind(&LLPanelOutfitEdit::toggleAddWearablesPanel, this)); + mAddWearablesPanel = getChild("add_wearables_panel"); mInventoryItemsPanel = getChild("inventory_items"); mInventoryItemsPanel->setFilterTypes(ALL_ITEMS_MASK); @@ -306,9 +315,12 @@ BOOL LLPanelOutfitEdit::postBuild() save_registar.add("Outfit.SaveAsNew.Action", boost::bind(&LLPanelOutfitEdit::saveOutfit, this, true)); mSaveMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_save_outfit.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mWearableListMaskCollector = new LLFindNonLinksByMask(ALL_ITEMS_MASK); + mWearableListTypeCollector = new LLFindWearablesOfType(LLWearableType::WT_NONE); + mWearableItemsPanel = getChild("filtered_wearables_panel"); mWearableItemsList = getChild("filtered_wearables_list"); - mWearableListManager = new LLFilteredWearableListManager(mWearableItemsList, ALL_ITEMS_MASK); + mWearableListManager = new LLFilteredWearableListManager(mWearableItemsList, mWearableListMaskCollector); return TRUE; } @@ -334,7 +346,8 @@ void LLPanelOutfitEdit::moveWearable(bool closer_to_body) void LLPanelOutfitEdit::toggleAddWearablesPanel() { - childSetVisible("add_wearables_panel", !childIsVisible("add_wearables_panel")); + BOOL current_visibility = mAddWearablesPanel->getVisible(); + mAddWearablesPanel->setVisible(!current_visibility); } void LLPanelOutfitEdit::showWearablesFilter() @@ -407,7 +420,9 @@ void LLPanelOutfitEdit::onTypeFilterChanged(LLUICtrl* ctrl) { U32 curr_filter_type = type_filter->getCurrentIndex(); mInventoryItemsPanel->setFilterTypes(mLookItemTypes[curr_filter_type].inventoryMask); - mWearableListManager->setFilterMask(mLookItemTypes[curr_filter_type].inventoryMask); + + mWearableListMaskCollector->setFilterMask(mLookItemTypes[curr_filter_type].inventoryMask); + mWearableListManager->setFilterCollector(mWearableListMaskCollector); } mSavedFolderState->setApply(TRUE); @@ -487,6 +502,25 @@ void LLPanelOutfitEdit::onAddToOutfitClicked(void) LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id); } +void LLPanelOutfitEdit::onAddWearableClicked(void) +{ + LLPanelDummyClothingListItem* item = dynamic_cast(mCOFWearables->getSelectedItem()); + + if(item) + { + showFilteredWearableItemsList(item->getWearableType()); + } +} + +void LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked(LLUUID selected_item_id) +{ + LLViewerInventoryItem* item = gInventory.getLinkedItem(selected_item_id); + + if (item && item->getType() == LLAssetType::AT_BODYPART) + { + showFilteredWearableItemsList(item->getWearableType()); + } +} void LLPanelOutfitEdit::onRemoveFromOutfitClicked(void) { @@ -722,4 +756,11 @@ void LLPanelOutfitEdit::onGearMenuItemClick(const LLSD& data) } } +void LLPanelOutfitEdit::showFilteredWearableItemsList(LLWearableType::EType type) +{ + mWearableListTypeCollector->setType(type); + mWearableListManager->setFilterCollector(mWearableListTypeCollector); + mAddWearablesPanel->setVisible(TRUE); +} + // EOF diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 1bf69c5606..dbfeb2c375 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -59,6 +59,8 @@ class LLToggleableMenu; class LLFilterEditor; class LLFilteredWearableListManager; class LLMenuGL; +class LLFindNonLinksByMask; +class LLFindWearablesOfType; class LLPanelOutfitEdit : public LLPanel { @@ -103,6 +105,8 @@ public: void onOutfitItemSelectionChange(void); void onRemoveFromOutfitClicked(void); void onEditWearableClicked(void); + void onAddWearableClicked(void); + void onReplaceBodyPartMenuItemClicked(LLUUID selected_item_id); void displayCurrentOutfit(); void updateCurrentOutfitName(); @@ -129,6 +133,7 @@ private: void onGearButtonClick(LLUICtrl* clicked_button); void onGearMenuItemClick(const LLSD& data); + void showFilteredWearableItemsList(LLWearableType::EType type); LLTextBox* mCurrentOutfitName; @@ -141,6 +146,10 @@ private: LLButton* mFolderViewBtn; LLButton* mListViewBtn; LLToggleableMenu* mSaveMenu; + LLPanel* mAddWearablesPanel; + + LLFindNonLinksByMask* mWearableListMaskCollector; + LLFindWearablesOfType* mWearableListTypeCollector; LLFilteredWearableListManager* mWearableListManager; LLInventoryItemsList* mWearableItemsList; diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index fb7577c008..161cd40cfc 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -251,6 +251,11 @@ BOOL LLPanelDummyClothingListItem::postBuild() return TRUE; } +LLWearableType::EType LLPanelDummyClothingListItem::getWearableType() const +{ + return mWearableType; +} + LLPanelDummyClothingListItem::LLPanelDummyClothingListItem(LLWearableType::EType w_type) : LLPanelWearableListItem(NULL) , mWearableType(w_type) diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 7ad1b5a3ad..de024ed220 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -162,6 +162,7 @@ public: /*virtual*/ void updateItem(); /*virtual*/ BOOL postBuild(); + LLWearableType::EType getWearableType() const; protected: LLPanelDummyClothingListItem(LLWearableType::EType w_type); -- cgit v1.2.3 From 05626c3371395d76b1f2e6b7fcbe64ef12f7d974 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Fri, 28 May 2010 20:13:18 +0300 Subject: EXT-7013 FIX time formatting function didn't work for some parameters for Japanise (like weekdays). reviewed by Vadim Savchuk https://codereview.productengine.com/secondlife/r/457/ --HG-- branch : product-engine --- indra/llcommon/llstring.cpp | 103 ++++++++++++++++++++++++- indra/llcommon/llstring.h | 18 +++++ indra/newview/llappviewer.cpp | 11 ++- indra/newview/skins/default/xui/en/strings.xml | 15 ++++ indra/newview/skins/default/xui/ja/strings.xml | 20 ++++- 5 files changed, 164 insertions(+), 3 deletions(-) diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index b5a73ec1d1..8197e3e642 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -676,6 +676,17 @@ long LLStringOps::sLocalTimeOffset = 0; bool LLStringOps::sPacificDaylightTime = 0; std::map LLStringOps::datetimeToCodes; +std::vector LLStringOps::sWeekDayList; +std::vector LLStringOps::sWeekDayShortList; +std::vector LLStringOps::sMonthList; +std::vector LLStringOps::sMonthShortList; + + +std::string LLStringOps::sDayFormat; +std::string LLStringOps::sAM; +std::string LLStringOps::sPM; + + S32 LLStringOps::collate(const llwchar* a, const llwchar* b) { #if LL_WINDOWS @@ -724,6 +735,50 @@ void LLStringOps::setupDatetimeInfo (bool daylight) datetimeToCodes["timezone"] = "%Z"; // PST } +void tokenizeStringToArray(const std::string& data, std::vector& output) +{ + output.clear(); + size_t length = data.size(); + + // tokenize it and put it in the array + std::string cur_word; + for(size_t i = 0; i < length; ++i) + { + if(data[i] == ':') + { + output.push_back(cur_word); + cur_word.clear(); + } + else + { + cur_word.append(1, data[i]); + } + } + output.push_back(cur_word); +} + +void LLStringOps::setupWeekDaysNames(const std::string& data) +{ + tokenizeStringToArray(data,sWeekDayList); +} +void LLStringOps::setupWeekDaysShortNames(const std::string& data) +{ + tokenizeStringToArray(data,sWeekDayShortList); +} +void LLStringOps::setupMonthNames(const std::string& data) +{ + tokenizeStringToArray(data,sMonthList); +} +void LLStringOps::setupMonthShortNames(const std::string& data) +{ + tokenizeStringToArray(data,sMonthShortList); +} +void LLStringOps::setupDayFormat(const std::string& data) +{ + sDayFormat = data; +} + + std::string LLStringOps::getDatetimeCode (std::string key) { std::map::iterator iter; @@ -998,7 +1053,53 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, } return true; } - replacement = datetime.toHTTPDateString(code); + + //EXT-7013 + //few codes are not suppotred by strtime function (example - weekdays for Japanise) + //so use predefined ones + + //if sWeekDayList is not empty than current locale doesn't support + //weekday name. + time_t loc_seconds = (time_t) secFromEpoch; + if(LLStringOps::sWeekDayList.size() == 7 && code == "%A") + { + struct tm * gmt = gmtime (&loc_seconds); + replacement = LLStringOps::sWeekDayList[gmt->tm_wday]; + } + else if(LLStringOps::sWeekDayShortList.size() == 7 && code == "%a") + { + struct tm * gmt = gmtime (&loc_seconds); + replacement = LLStringOps::sWeekDayShortList[gmt->tm_wday]; + } + else if(LLStringOps::sMonthList.size() == 12 && code == "%B") + { + struct tm * gmt = gmtime (&loc_seconds); + replacement = LLStringOps::sWeekDayList[gmt->tm_mon]; + } + else if( !LLStringOps::sDayFormat.empty() && code == "%d" ) + { + struct tm * gmt = gmtime (&loc_seconds); + LLStringUtil::format_map_t args; + args["[MDAY]"] = llformat ("%d", gmt->tm_mday); + replacement = LLStringOps::sDayFormat; + LLStringUtil::format(replacement, args); + } + else if( !LLStringOps::sAM.empty() && !LLStringOps::sPM.empty() && code == "%p" ) + { + struct tm * gmt = gmtime (&loc_seconds); + if(gmt->tm_hour<12) + { + replacement = LLStringOps::sAM; + } + else + { + replacement = LLStringOps::sPM; + } + } + else + { + replacement = datetime.toHTTPDateString(code); + } // *HACK: delete leading zero from hour string in case 'hour12' (code = %I) time format // to show time without leading zero, e.g. 08:16 -> 8:16 (EXT-2738). diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 96588b29b9..ad8f8632a2 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -154,9 +154,19 @@ private: static long sPacificTimeOffset; static long sLocalTimeOffset; static bool sPacificDaylightTime; + static std::map datetimeToCodes; public: + static std::vector sWeekDayList; + static std::vector sWeekDayShortList; + static std::vector sMonthList; + static std::vector sMonthShortList; + static std::string sDayFormat; + + static std::string sAM; + static std::string sPM; + static char toUpper(char elem) { return toupper((unsigned char)elem); } static llwchar toUpper(llwchar elem) { return towupper(elem); } @@ -185,6 +195,14 @@ public: static S32 collate(const llwchar* a, const llwchar* b); static void setupDatetimeInfo(bool pacific_daylight_time); + + static void setupWeekDaysNames(const std::string& data); + static void setupWeekDaysShortNames(const std::string& data); + static void setupMonthNames(const std::string& data); + static void setupMonthShortNames(const std::string& data); + static void setupDayFormat(const std::string& data); + + static long getPacificTimeOffset(void) { return sPacificTimeOffset;} static long getLocalTimeOffset(void) { return sLocalTimeOffset;} // Is the Pacific time zone (aka server time zone) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f7f7cb599e..7b17933b5c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -890,7 +890,16 @@ bool LLAppViewer::init() } LLViewerMedia::initClass(); - + + LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames")); + LLStringOps::setupWeekDaysShortNames(LLTrans::getString("dateTimeWeekdaysShortNames")); + LLStringOps::setupMonthNames(LLTrans::getString("dateTimeMonthNames")); + LLStringOps::setupMonthShortNames(LLTrans::getString("dateTimeMonthShortNames")); + LLStringOps::setupDayFormat(LLTrans::getString("dateTimeDayFormat")); + + LLStringOps::sAM = LLTrans::getString("dateTimeAM"); + LLStringOps::sPM = LLTrans::getString("dateTimePM"); + return true; } diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index e57b30185d..9247e3f74c 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3183,4 +3183,19 @@ Abuse Report Please check secondlife.com/status to see if there is a known problem with the service. + + + + + + + + diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index 57120ff7ec..a06dcc54e4 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -1,4 +1,4 @@ - + + + Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday + + + Son:Mon:Tue:Wed:Thu:Fri:Sat + + + January:February:March:April:May:June:July:August:September:October:November:December + + + Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec + + + [MDAY] D + + AM + PM -- cgit v1.2.3 From de52f3ae69f7641966304ea42d399b62f3fc3170 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sat, 29 May 2010 23:17:28 +0100 Subject: EXT-7556 FIXED Update Vivox SDK to 3.1.0001.8821 --- install.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install.xml b/install.xml index 1265963fb1..ccebe2fe50 100644 --- a/install.xml +++ b/install.xml @@ -1386,23 +1386,23 @@ anguage Infrstructure (CLI) international standard darwin md5sum - 4d29351a842fafe617de65a8183da160 + aa144917d0e33453d3c2cc2c05c6c47c url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-3.1.0001.8744-darwin-20100519.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-3.1.0001.8821-darwin-20100529.tar.bz2 linux md5sum - 7541138c439b1c0312610d18968f27d2 + 98f7945755f3ee8e52f685a3eff4d7be url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-3.1.0001.8744-linux-20100519.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-3.1.0001.8821-linux-20100529.tar.bz2 windows md5sum - 5d2b049ca5239da2dcebde91f7f25a43 + e8fdd46cb026c2ec72c4489eb3bf39c1 url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-3.1.0001.8744-windows-20100519.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-3.1.0001.8821-windows-20100529.tar.bz2 -- cgit v1.2.3 From 325729b739475b5c6b4227f4d1951a70cb9d7028 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 31 May 2010 17:46:50 +0300 Subject: EXT-7485 ADDITIONAL FIX Fixed crash at viewer exit used raw pointer instead of auto_ptr, since lifetime of mSaveMenu field controlled by parent gMenuHolder --HG-- branch : product-engine --- indra/newview/llsaveoutfitcombobtn.cpp | 6 +++--- indra/newview/llsaveoutfitcombobtn.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llsaveoutfitcombobtn.cpp b/indra/newview/llsaveoutfitcombobtn.cpp index 85197853de..b9b577084b 100644 --- a/indra/newview/llsaveoutfitcombobtn.cpp +++ b/indra/newview/llsaveoutfitcombobtn.cpp @@ -53,9 +53,9 @@ LLSaveOutfitComboBtn::LLSaveOutfitComboBtn(LLPanel* parent, bool saveAsDefaultAc mParent->childSetAction(SAVE_BTN, boost::bind(&LLSaveOutfitComboBtn::saveOutfit, this, mSaveAsDefaultAction)); mParent->childSetAction(SAVE_FLYOUT_BTN, boost::bind(&LLSaveOutfitComboBtn::showSaveMenu, this)); - mSaveMenu.reset(LLUICtrlFactory::getInstance()->createFromFile< + mSaveMenu = LLUICtrlFactory::getInstance()->createFromFile< LLToggleableMenu> ("menu_save_outfit.xml", gMenuHolder, - LLViewerMenuHolderGL::child_registry_t::instance())); + LLViewerMenuHolderGL::child_registry_t::instance()); } void LLSaveOutfitComboBtn::showSaveMenu() @@ -64,7 +64,7 @@ void LLSaveOutfitComboBtn::showSaveMenu() LLUI::getMousePositionLocal(mParent, &x, &y); mSaveMenu->updateParent(LLMenuGL::sMenuContainer); - LLMenuGL::showPopup(mParent, mSaveMenu.get(), x, y); + LLMenuGL::showPopup(mParent, mSaveMenu, x, y); } void LLSaveOutfitComboBtn::saveOutfit(bool as_new) diff --git a/indra/newview/llsaveoutfitcombobtn.h b/indra/newview/llsaveoutfitcombobtn.h index d505c4bebe..fec7122194 100644 --- a/indra/newview/llsaveoutfitcombobtn.h +++ b/indra/newview/llsaveoutfitcombobtn.h @@ -54,7 +54,7 @@ public: private: bool mSaveAsDefaultAction; LLPanel* mParent; - std::auto_ptr mSaveMenu; + LLToggleableMenu* mSaveMenu; }; #endif // LL_LLSAVEOUTFITCOMBOBTN_H -- cgit v1.2.3 From 40b476dbb2aee494d57dce81427b74ac19b1428d Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Sat, 29 May 2010 00:06:34 +0300 Subject: EXT-7198, EXT-7491 FIXED Added mutli-selection support for outfit items and outfit tabs selection support. - Added selecting multiple items from more than one accordion tab. - Integrated context menus from Vadim's patch for EXT-6726 Appearance SP menus (WIP tier 2). - Added selection to accordion control to use it instead of accordion tab focus in cases when focus is lost and outfit tab should stay selected. - Changed "Wear" button behavior: "Wear" puts on currently selected outfit (as the tooltip reads "Wear selected outfit"). There is always an outfit selected when the accordion is focused so for now there are no cases when only some items are selected. Separate items can be worn from context menu. - Added moving accordion tab selection with right click. Fixed (EXT-7491) Right click on an accordion title should move selection to it. Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/437/ --HG-- branch : product-engine --- indra/llui/llaccordionctrl.cpp | 24 +++++++ indra/llui/llaccordionctrl.h | 1 + indra/llui/llaccordionctrltab.cpp | 29 +++++++- indra/llui/llaccordionctrltab.h | 7 ++ indra/newview/llinventoryitemslist.h | 3 + indra/newview/lloutfitslist.cpp | 78 ++++++++++++++++++---- indra/newview/lloutfitslist.h | 7 +- .../skins/default/xui/en/outfit_accordion_tab.xml | 2 + 8 files changed, 134 insertions(+), 17 deletions(-) diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 5d1d57cbb2..8e0245c451 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -65,6 +65,7 @@ LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) , mFitParent(params.fit_parent) , mAutoScrolling( false ) , mAutoScrollRate( 0.f ) + , mSelectedTab( NULL ) { mSingleExpansion = params.single_expansion; if(mFitParent && !mSingleExpansion) @@ -76,6 +77,7 @@ LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) LLAccordionCtrl::LLAccordionCtrl() : LLPanel() , mAutoScrolling( false ) , mAutoScrollRate( 0.f ) + , mSelectedTab( NULL ) { mSingleExpansion = false; mFitParent = false; @@ -689,6 +691,28 @@ S32 LLAccordionCtrl::notifyParent(const LLSD& info) } return 0; } + else if(str_action == "select_current") + { + for(size_t i=0;ihasFocus()) + { + if (mAccordionTabs[i] != mSelectedTab) + { + if (mSelectedTab) + { + mSelectedTab->setSelected(false); + } + mSelectedTab = mAccordionTabs[i]; + mSelectedTab->setSelected(true); + } + + return 1; + } + } + return 0; + } } else if (info.has("scrollToShowRect")) { diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index ab7d6548ca..a029201c90 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -130,6 +130,7 @@ private: bool mFitParent; bool mAutoScrolling; F32 mAutoScrollRate; + LLAccordionCtrlTab* mSelectedTab; }; diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index b09c108ec3..83e67980a3 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -76,6 +76,8 @@ public: std::string getTitle(); void setTitle(const std::string& title, const std::string& hl); + void setSelected(bool is_selected) { mIsSelected = is_selected; } + virtual void onMouseEnter(S32 x, S32 y, MASK mask); virtual void onMouseLeave(S32 x, S32 y, MASK mask); virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); @@ -103,6 +105,7 @@ private: LLUIColor mHeaderBGColor; bool mNeedsHighlight; + bool mIsSelected; LLFrameTimer mAutoOpenTimer; }; @@ -115,7 +118,8 @@ LLAccordionCtrlTab::LLAccordionCtrlTabHeader::LLAccordionCtrlTabHeader( const LLAccordionCtrlTabHeader::Params& p) : LLUICtrl(p) , mHeaderBGColor(p.header_bg_color()) -,mNeedsHighlight(false), +, mNeedsHighlight(false) +, mIsSelected(false), mImageCollapsed(p.header_collapse_img), mImageCollapsedPressed(p.header_collapse_img_pressed), mImageExpanded(p.header_expand_img), @@ -187,7 +191,7 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::draw() // Only show green "focus" background image if the accordion is open, // because the user's mental model of focus is that it goes away after // the accordion is closed. - if (getParent()->hasFocus() + if (getParent()->hasFocus() || mIsSelected /*&& !(collapsible && !expanded)*/ // WHY?? ) { @@ -301,6 +305,7 @@ LLAccordionCtrlTab::Params::Params() ,header_image_focused("header_image_focused") ,header_text_color("header_text_color") ,fit_panel("fit_panel",true) + ,selection_enabled("selection_enabled", false) { mouse_opaque(false); } @@ -331,6 +336,11 @@ LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p) mHeader = LLUICtrlFactory::create(headerParams); addChild(mHeader, 1); + if (p.selection_enabled) + { + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLAccordionCtrlTab::selectOnFocusReceived, this)); + } + reshape(100, 200,FALSE); } @@ -498,6 +508,15 @@ boost::signals2::connection LLAccordionCtrlTab::setFocusLostCallback(const focus return boost::signals2::connection(); } +void LLAccordionCtrlTab::setSelected(bool is_selected) +{ + LLAccordionCtrlTabHeader* header = findChild(DD_HEADER_NAME); + if (header) + { + header->setSelected(is_selected); + } +} + LLView* LLAccordionCtrlTab::findContainerView() { for(child_list_const_iter_t it = getChildList()->begin(); @@ -513,6 +532,11 @@ LLView* LLAccordionCtrlTab::findContainerView() return NULL; } +void LLAccordionCtrlTab::selectOnFocusReceived() +{ + if (getParent()) // A parent may not be set if tabs are added dynamically. + getParent()->notifyParent(LLSD().with("action", "select_current")); +} S32 LLAccordionCtrlTab::getHeaderHeight() { @@ -713,6 +737,7 @@ void LLAccordionCtrlTab::showAndFocusHeader() { LLAccordionCtrlTabHeader* header = getChild(DD_HEADER_NAME); header->setFocus(true); + header->setSelected(true); LLRect screen_rc; LLRect selected_rc = header->getRect(); diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index f5b7fd0af6..83a9024a74 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -88,6 +88,8 @@ public: Optional fit_panel; + Optional selection_enabled; + Optional padding_left; Optional padding_right; Optional padding_top; @@ -121,6 +123,8 @@ public: boost::signals2::connection setFocusReceivedCallback(const focus_signal_t::slot_type& cb); boost::signals2::connection setFocusLostCallback(const focus_signal_t::slot_type& cb); + void setSelected(bool is_selected); + bool getCollapsible() {return mCollapsible;}; void setCollapsible(bool collapsible) {mCollapsible = collapsible;}; @@ -199,6 +203,9 @@ protected: void drawChild(const LLRect& root_rect,LLView* child); LLView* findContainerView (); + + void selectOnFocusReceived(); + private: class LLAccordionCtrlTabHeader; diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index 807952948b..03ad7c2184 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -133,6 +133,9 @@ public: /** Get the description of a corresponding inventory item */ const std::string& getDescription() const { return mItem->getDescription(); } + /** Get the associated inventory item */ + LLViewerInventoryItem* getItem() const { return mItem; } + virtual ~LLPanelInventoryListItemBase(){} protected: diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 17a2db7a43..8f189a1e9f 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -82,7 +82,6 @@ LLOutfitsList::LLOutfitsList() : LLPanel() , mAccordion(NULL) , mListCommands(NULL) - , mSelectedList(NULL) { mCategoriesObserver = new LLInventoryCategoriesObserver(); gInventory.addObserver(mCategoriesObserver); @@ -208,6 +207,8 @@ void LLOutfitsList::refreshList(const LLUUID& category_id) // Setting list refresh callback to apply filter on list change. list->setRefreshCompleteCallback(boost::bind(&LLOutfitsList::onFilteredWearableItemsListRefresh, this, _1)); + list->setRightMouseDownCallback(boost::bind(&LLOutfitsList::onWearableItemsListRightClick, this, _1, _2, _3)); + // Fetch the new outfit contents. cat->fetch(); @@ -237,23 +238,27 @@ void LLOutfitsList::refreshList(const LLUUID& category_id) outfits_map_t::iterator outfits_iter = mOutfitsMap.find((*iter)); if (outfits_iter != mOutfitsMap.end()) { - // An outfit is removed from the list. Do the following: - // 1. Remove outfit accordion tab from accordion. - mAccordion->removeCollapsibleCtrl(outfits_iter->second); - const LLUUID& outfit_id = outfits_iter->first; + LLAccordionCtrlTab* tab = outfits_iter->second; - // 2. Remove outfit category from observer to stop monitoring its changes. + // An outfit is removed from the list. Do the following: + // 1. Remove outfit category from observer to stop monitoring its changes. mCategoriesObserver->removeCategory(outfit_id); - // 3. Reset selection if selected outfit is being removed. - if (mSelectedOutfitUUID == outfit_id) + // 2. Remove selected lists map entry. + mSelectedListsMap.erase(outfit_id); + + // 3. Reset currently selected outfit id if it is being removed. + if (outfit_id == mSelectedOutfitUUID) { - changeOutfitSelection(NULL, LLUUID()); + mSelectedOutfitUUID = LLUUID(); } // 4. Remove category UUID to accordion tab mapping. mOutfitsMap.erase(outfits_iter); + + // 5. Remove outfit tab from accordion. + mAccordion->removeCollapsibleCtrl(tab); } } @@ -283,6 +288,8 @@ void LLOutfitsList::onSelectionChange(LLUICtrl* ctrl) void LLOutfitsList::performAction(std::string action) { + if (mSelectedOutfitUUID.isNull()) return; + LLViewerInventoryCategory* cat = gInventory.getCategory(mSelectedOutfitUUID); if (!cat) return; @@ -367,14 +374,28 @@ void LLOutfitsList::updateOutfitTab(const LLUUID& category_id) void LLOutfitsList::changeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id) { - // Reset selection in previously selected tab - // if a new one is selected. - if (list && mSelectedList && mSelectedList != list) + MASK mask = gKeyboard->currentMask(TRUE); + + // Reset selection in all previously selected tabs except for the current + // if new selection is started. + if (list && !(mask & MASK_CONTROL)) { - mSelectedList->resetSelection(); + for (wearables_lists_map_t::iterator iter = mSelectedListsMap.begin(); + iter != mSelectedListsMap.end(); + ++iter) + { + LLWearableItemsList* selected_list = (*iter).second; + if (selected_list != list) + { + selected_list->resetSelection(); + } + } + + // Clear current selection. + mSelectedListsMap.clear(); } - mSelectedList = list; + mSelectedListsMap.insert(wearables_lists_map_value_t(category_id, list)); mSelectedOutfitUUID = category_id; } @@ -494,6 +515,13 @@ void LLOutfitsList::onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const S32 header_bottom = tab->getLocalRect().getHeight() - tab->getHeaderHeight(); if(y >= header_bottom) { + // Focus tab header to trigger tab selection change. + LLUICtrl* header = tab->findChild("dd_header"); + if (header) + { + header->setFocus(TRUE); + } + uuid_vec_t selected_uuids; selected_uuids.push_back(cat_id); mOutfitMenu->show(ctrl, selected_uuids, x, y); @@ -501,4 +529,26 @@ void LLOutfitsList::onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const } } +void LLOutfitsList::onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y) +{ + LLWearableItemsList* list = dynamic_cast(ctrl); + if (!list) return; + + uuid_vec_t selected_uuids; + + // Collect seleted items from all selected lists. + for (wearables_lists_map_t::iterator iter = mSelectedListsMap.begin(); + iter != mSelectedListsMap.end(); + ++iter) + { + uuid_vec_t uuids; + (*iter).second->getSelectedUUIDs(uuids); + + S32 prev_size = selected_uuids.size(); + selected_uuids.resize(prev_size + uuids.size()); + std::copy(uuids.begin(), uuids.end(), selected_uuids.begin() + prev_size); + } + + LLWearableItemsList::ContextMenu::instance().show(list, selected_uuids, x, y); +} // EOF diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index b6b3d6ae46..1da7360c2e 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -108,12 +108,17 @@ private: void onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); + void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y); + LLInventoryCategoriesObserver* mCategoriesObserver; LLAccordionCtrl* mAccordion; LLPanel* mListCommands; - LLWearableItemsList* mSelectedList; + typedef std::map wearables_lists_map_t; + typedef wearables_lists_map_t::value_type wearables_lists_map_value_t; + wearables_lists_map_t mSelectedListsMap; + LLUUID mSelectedOutfitUUID; std::string mFilterSubString; diff --git a/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml b/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml index 066992b25d..44437d01eb 100644 --- a/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml +++ b/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml @@ -8,6 +8,7 @@ height="45" layout="topleft" name="Mockup Tab" + selection_enabled="true" title="Mockup Tab" translate="false" width="0"> @@ -18,5 +19,6 @@ multi_select="true" name="wearable_items_list" translate="false" + use_internal_context_menu="false" /> -- cgit v1.2.3 From 279f58051d0e387807ae8ad18c9004d2205f4479 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Sat, 29 May 2010 19:36:55 +0300 Subject: FIXED Linux build. Added forward specialization of LLStringUtil::format before use in LLStringUtil::formatDatetime. --HG-- branch : product-engine --- indra/llcommon/llstring.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 8197e3e642..f14d947734 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -874,6 +874,10 @@ namespace LLStringFn //////////////////////////////////////////////////////////// +// Forward specialization of LLStringUtil::format before use in LLStringUtil::formatDatetime. +template<> +S32 LLStringUtil::format(std::string& s, const format_map_t& substitutions); + //static template<> void LLStringUtil::getTokens(const std::string& instr, std::vector& tokens, const std::string& delims) -- cgit v1.2.3 From 9f91d436805137cd347601c7657d90fe19fc98b0 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 31 May 2010 13:56:47 +0300 Subject: EXT-7208 FIXED repositioned tattoo pickers to match the updated spec Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/460 --HG-- branch : product-engine --- .../skins/default/xui/en/panel_edit_tattoo.xml | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml index 6fa9383507..23a08344ea 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml @@ -25,14 +25,14 @@ can_apply_immediately="true" default_image_name="Default" follows="left|top" - height="100" + height="115" label="Head Tattoo" layout="topleft" - left="30" + left="20" name="Head Tattoo" tool_tip="Click to choose a picture" top="10" - width="94" > + width="115" > @@ -40,14 +40,14 @@ can_apply_immediately="true" default_image_name="Default" follows="left|top" - height="100" + height="115" label="Upper Tattoo" layout="topleft" left_pad="30" name="Upper Tattoo" tool_tip="Click to choose a picture" top="10" - width="94" > + width="115" > @@ -55,28 +55,28 @@ can_apply_immediately="true" default_image_name="Default" follows="left|top" - height="100" + height="115" label="Lower Tattoo" layout="topleft" - left="30" + left="20" name="Lower Tattoo" tool_tip="Click to choose a picture" top_pad="10" - width="94" > + width="115" > + top_delta="0" + width="115" > -- cgit v1.2.3 From bfced6d4c13b06cc6332583bd8808dee547352c7 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 31 May 2010 15:55:08 +0300 Subject: EXT-7485 FIXED Updated 'save as new' button on inventory outfit pane to fit spec. * moved logic related to combo button from LLPanelOutfitEdit to LLSaveOutfitComboBtn class; * used LLSaveOutfitComboBtn class in LLPanelOutfitsInventory; reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/459/ --HG-- branch : product-engine --- indra/newview/CMakeLists.txt | 2 + indra/newview/llpaneloutfitedit.cpp | 42 +--------- indra/newview/llpaneloutfitedit.h | 6 +- indra/newview/llpaneloutfitsinventory.cpp | 11 +-- indra/newview/llpaneloutfitsinventory.h | 4 +- indra/newview/llsaveoutfitcombobtn.cpp | 98 ++++++++++++++++++++++ indra/newview/llsaveoutfitcombobtn.h | 60 +++++++++++++ .../skins/default/xui/en/menu_save_outfit.xml | 4 +- .../default/xui/en/panel_outfits_inventory.xml | 33 +++++--- 9 files changed, 198 insertions(+), 62 deletions(-) create mode 100644 indra/newview/llsaveoutfitcombobtn.cpp create mode 100644 indra/newview/llsaveoutfitcombobtn.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dad2c615e3..5f29d87ab6 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -379,6 +379,7 @@ set(viewer_SOURCE_FILES llregionposition.cpp llremoteparcelrequest.cpp llsavedsettingsglue.cpp + llsaveoutfitcombobtn.cpp llscreenchannel.cpp llscriptfloater.cpp llscrollingpanelparam.cpp @@ -894,6 +895,7 @@ set(viewer_HEADER_FILES llresourcedata.h llrootview.h llsavedsettingsglue.h + llsaveoutfitcombobtn.h llscreenchannel.h llscriptfloater.h llscrollingpanelparam.h diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 8d7a2b33be..2ce9079a41 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -60,6 +60,7 @@ #include "llinventorymodelbackgroundfetch.h" #include "llpaneloutfitsinventory.h" #include "lluiconstants.h" +#include "llsaveoutfitcombobtn.h" #include "llscrolllistctrl.h" #include "lltextbox.h" #include "lluictrlfactory.h" @@ -75,7 +76,6 @@ const U64 WEARABLE_MASK = (1LL << LLInventoryType::IT_WEARABLE); const U64 ATTACHMENT_MASK = (1LL << LLInventoryType::IT_ATTACHMENT) | (1LL << LLInventoryType::IT_OBJECT); const U64 ALL_ITEMS_MASK = WEARABLE_MASK | ATTACHMENT_MASK; -static const std::string SAVE_BTN("save_btn"); static const std::string REVERT_BTN("revert_btn"); class LLCOFObserver : public LLInventoryObserver @@ -307,14 +307,6 @@ BOOL LLPanelOutfitEdit::postBuild() childSetAction(REVERT_BTN, boost::bind(&LLAppearanceMgr::wearBaseOutfit, LLAppearanceMgr::getInstance())); - childSetAction(SAVE_BTN, boost::bind(&LLPanelOutfitEdit::saveOutfit, this, false)); - childSetAction("save_flyout_btn", boost::bind(&LLPanelOutfitEdit::showSaveMenu, this)); - - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar save_registar; - save_registar.add("Outfit.Save.Action", boost::bind(&LLPanelOutfitEdit::saveOutfit, this, false)); - save_registar.add("Outfit.SaveAsNew.Action", boost::bind(&LLPanelOutfitEdit::saveOutfit, this, true)); - mSaveMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_save_outfit.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - mWearableListMaskCollector = new LLFindNonLinksByMask(ALL_ITEMS_MASK); mWearableListTypeCollector = new LLFindWearablesOfType(LLWearableType::WT_NONE); @@ -322,6 +314,7 @@ BOOL LLPanelOutfitEdit::postBuild() mWearableItemsList = getChild("filtered_wearables_list"); mWearableListManager = new LLFilteredWearableListManager(mWearableItemsList, mWearableListMaskCollector); + mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this)); return TRUE; } @@ -385,33 +378,6 @@ void LLPanelOutfitEdit::showFilteredFolderWearablesPanel() mFolderViewBtn->setToggleState(TRUE); } -void LLPanelOutfitEdit::saveOutfit(bool as_new) -{ - if (!as_new && LLAppearanceMgr::getInstance()->updateBaseOutfit()) - { - // we don't need to ask for an outfit name, and updateBaseOutfit() successfully saved. - // If updateBaseOutfit fails, ask for an outfit name anyways - return; - } - - LLPanelOutfitsInventory* panel_outfits_inventory = LLPanelOutfitsInventory::findInstance(); - if (panel_outfits_inventory) - { - panel_outfits_inventory->onSave(); - } - - //*TODO how to get to know when base outfit is updated or new outfit is created? -} - -void LLPanelOutfitEdit::showSaveMenu() -{ - S32 x, y; - LLUI::getMousePositionLocal(this, &x, &y); - - mSaveMenu->updateParent(LLMenuGL::sMenuContainer); - LLMenuGL::showPopup(this, mSaveMenu, x, y); -} - void LLPanelOutfitEdit::onTypeFilterChanged(LLUICtrl* ctrl) { LLComboBox* type_filter = dynamic_cast(ctrl); @@ -709,10 +675,10 @@ void LLPanelOutfitEdit::updateVerbs() bool outfit_is_dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); bool has_baseoutfit = LLAppearanceMgr::getInstance()->getBaseOutfitUUID().notNull(); - childSetEnabled(SAVE_BTN, outfit_is_dirty); + mSaveComboBtn->setSaveBtnEnabled(outfit_is_dirty); childSetEnabled(REVERT_BTN, outfit_is_dirty && has_baseoutfit); - mSaveMenu->setItemEnabled("save_outfit", outfit_is_dirty); + mSaveComboBtn->setMenuItemEnabled("save_outfit", outfit_is_dirty); mStatus->setText(outfit_is_dirty ? getString("unsaved_changes") : getString("now_editing")); diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index dbfeb2c375..c0ee6c5fcb 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -61,6 +61,7 @@ class LLFilteredWearableListManager; class LLMenuGL; class LLFindNonLinksByMask; class LLFindWearablesOfType; +class LLSaveOutfitComboBtn; class LLPanelOutfitEdit : public LLPanel { @@ -95,8 +96,6 @@ public: void showWearablesFilter(); void showFilteredWearablesPanel(); void showFilteredFolderWearablesPanel(); - void saveOutfit(bool as_new = false); - void showSaveMenu(); void onTypeFilterChanged(LLUICtrl* ctrl); void onSearchEdit(const std::string& string); @@ -145,7 +144,6 @@ private: LLButton* mEditWearableBtn; LLButton* mFolderViewBtn; LLButton* mListViewBtn; - LLToggleableMenu* mSaveMenu; LLPanel* mAddWearablesPanel; LLFindNonLinksByMask* mWearableListMaskCollector; @@ -163,6 +161,8 @@ private: LLCOFWearables* mCOFWearables; LLMenuGL* mGearMenu; bool mInitialized; + std::auto_ptr mSaveComboBtn; + }; #endif // LL_LLPANELOUTFITEDIT_H diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index a7e8f497d9..21f69d3470 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -50,6 +50,7 @@ #include "llmodaldialog.h" #include "llnotificationsutil.h" #include "lloutfitslist.h" +#include "llsaveoutfitcombobtn.h" #include "llsidepanelappearance.h" #include "llsidetray.h" #include "lltabcontainer.h" @@ -101,6 +102,8 @@ BOOL LLPanelOutfitsInventory::postBuild() LLInventoryModelBackgroundFetch::instance().start(outfits_cat); } + mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this, true)); + return TRUE; } @@ -373,7 +376,6 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() mListCommands->childSetAction("options_gear_btn", boost::bind(&LLPanelOutfitsInventory::onGearButtonClick, this)); mListCommands->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this)); - mListCommands->childSetAction("make_outfit_btn", boost::bind(&LLPanelOutfitsInventory::onAddButtonClick, this)); mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this)); LLDragAndDropButton* trash_btn = mListCommands->getChild("trash_btn"); @@ -396,7 +398,7 @@ void LLPanelOutfitsInventory::updateListCommands() mListCommands->childSetEnabled("trash_btn", trash_enabled); mListCommands->childSetEnabled("wear_btn", wear_enabled); mListCommands->childSetVisible("wear_btn", wear_enabled); - mListCommands->childSetEnabled("make_outfit_btn", make_outfit_enabled); + mSaveComboBtn->setSaveBtnEnabled(make_outfit_enabled); } void LLPanelOutfitsInventory::onGearButtonClick() @@ -404,11 +406,6 @@ void LLPanelOutfitsInventory::onGearButtonClick() showActionMenu(mMenuGearDefault,"options_gear_btn"); } -void LLPanelOutfitsInventory::onAddButtonClick() -{ - onSave(); -} - void LLPanelOutfitsInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) { if (menu) diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index a0fe91cd80..7bdd37c16c 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -46,6 +46,7 @@ class LLButton; class LLMenuGL; class LLSidepanelAppearance; class LLTabContainer; +class LLSaveOutfitComboBtn; class LLPanelOutfitsInventory : public LLPanel { @@ -86,7 +87,7 @@ private: LLSaveFolderState* mSavedFolderState; LLTabContainer* mAppearanceTabs; std::string mFilterSubString; - + std::auto_ptr mSaveComboBtn; public: ////////////////////////////////////////////////////////////////////////////////// // tab panels @@ -117,7 +118,6 @@ protected: void updateListCommands(); void onGearButtonClick(); void onWearButtonClick(); - void onAddButtonClick(); void showActionMenu(LLMenuGL* menu, std::string spawning_view_name); void onTrashButtonClick(); void onClipboardAction(const LLSD& userdata); diff --git a/indra/newview/llsaveoutfitcombobtn.cpp b/indra/newview/llsaveoutfitcombobtn.cpp new file mode 100644 index 0000000000..b1acdaea35 --- /dev/null +++ b/indra/newview/llsaveoutfitcombobtn.cpp @@ -0,0 +1,98 @@ +/** + * @file llsaveoutfitcombobtn.cpp + * @brief Represents outfit save/save as combo button. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llappearancemgr.h" +#include "llpaneloutfitsinventory.h" +#include "llsaveoutfitcombobtn.h" +#include "lltoggleablemenu.h" +#include "llviewermenu.h" + +static const std::string SAVE_BTN("save_btn"); +static const std::string SAVE_FLYOUT_BTN("save_flyout_btn"); + +LLSaveOutfitComboBtn::LLSaveOutfitComboBtn(LLPanel* parent, bool saveAsDefaultAction): + mParent(parent), mSaveAsDefaultAction(saveAsDefaultAction) +{ + // register action mapping before creating menu + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar save_registar; + save_registar.add("Outfit.Save.Action", boost::bind( + &LLSaveOutfitComboBtn::saveOutfit, this, false)); + save_registar.add("Outfit.SaveAs.Action", boost::bind( + &LLSaveOutfitComboBtn::saveOutfit, this, true)); + + mParent->childSetAction(SAVE_BTN, boost::bind(&LLSaveOutfitComboBtn::saveOutfit, this, mSaveAsDefaultAction)); + mParent->childSetAction(SAVE_FLYOUT_BTN, boost::bind(&LLSaveOutfitComboBtn::showSaveMenu, this)); + + mSaveMenu.reset(LLUICtrlFactory::getInstance()->createFromFile< + LLToggleableMenu> ("menu_save_outfit.xml", gMenuHolder, + LLViewerMenuHolderGL::child_registry_t::instance())); +} + +void LLSaveOutfitComboBtn::showSaveMenu() +{ + S32 x, y; + LLUI::getMousePositionLocal(mParent, &x, &y); + + mSaveMenu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(mParent, mSaveMenu.get(), x, y); +} + +void LLSaveOutfitComboBtn::saveOutfit(bool as_new) +{ + if (!as_new && LLAppearanceMgr::getInstance()->updateBaseOutfit()) + { + // we don't need to ask for an outfit name, and updateBaseOutfit() successfully saved. + // If updateBaseOutfit fails, ask for an outfit name anyways + return; + } + + LLPanelOutfitsInventory* panel_outfits_inventory = + LLPanelOutfitsInventory::findInstance(); + if (panel_outfits_inventory) + { + panel_outfits_inventory->onSave(); + } + + //*TODO how to get to know when base outfit is updated or new outfit is created? +} + +void LLSaveOutfitComboBtn::setMenuItemEnabled(const std::string& item, bool enabled) +{ + mSaveMenu->setItemEnabled("save_outfit", enabled); +} + +void LLSaveOutfitComboBtn::setSaveBtnEnabled(bool enabled) +{ + mParent->childSetEnabled(SAVE_BTN, enabled); +} diff --git a/indra/newview/llsaveoutfitcombobtn.h b/indra/newview/llsaveoutfitcombobtn.h new file mode 100644 index 0000000000..afd10316b5 --- /dev/null +++ b/indra/newview/llsaveoutfitcombobtn.h @@ -0,0 +1,60 @@ +/** + * @file llsaveoutfitcombobtn.h + * @brief Represents outfit save/save as combo button. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSAVEOUTFITCOMBOBTN_H +#define LL_LLSAVEOUTFITCOMBOBTN_H + +class LLButton; +class LLToggleableMenu; + + +/** + * Represents outfit Save/Save As combo button. + */ +class LLSaveOutfitComboBtn +{ + LOG_CLASS(LLSaveOutfitComboBtn); +public: + LLSaveOutfitComboBtn(LLPanel* parent, bool saveAsDefaultAction = false); + + void showSaveMenu(); + void saveOutfit(bool as_new = false); + void setMenuItemEnabled(const std::string& item, bool enabled); + void setSaveBtnEnabled(bool enabled); + +private: + bool mSaveAsDefaultAction; + LLPanel* mParent; + std::auto_ptr mSaveMenu; +}; + +#endif // LL_LLSAVEOUTFITCOMBOBTN_H diff --git a/indra/newview/skins/default/xui/en/menu_save_outfit.xml b/indra/newview/skins/default/xui/en/menu_save_outfit.xml index a8778df7f6..6285bf7417 100644 --- a/indra/newview/skins/default/xui/en/menu_save_outfit.xml +++ b/indra/newview/skins/default/xui/en/menu_save_outfit.xml @@ -14,9 +14,9 @@ + label="Save As"> 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 9e59651bd1..13e1f5ba5c 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml @@ -93,17 +93,30 @@ left_pad="1" name="trash_btn" tool_tip="Remove selected item" - width="31"/> -