diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index fc93793ed8..3a1e9f19fa 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -826,6 +826,24 @@ void LLAccordionCtrl::setFilterSubString(const std::string& filter_string) mNoVisibleTabsHelpText->setValue(text); } +const LLAccordionCtrlTab* LLAccordionCtrl::getExpandedTab() const +{ + typedef std::vector::const_iterator tabs_const_iterator; + + const LLAccordionCtrlTab* result = 0; + + for (tabs_const_iterator i = mAccordionTabs.begin(); i != mAccordionTabs.end(); ++i) + { + if ((*i)->isExpanded()) + { + result = *i; + break; + } + } + + return result; +} + S32 LLAccordionCtrl::calcExpandedTabHeight(S32 tab_index /* = 0 */, S32 available_height /* = 0 */) { if(tab_index < 0) diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index fc6f2d896c..677b598a32 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -129,6 +129,13 @@ public: */ void setFilterSubString(const std::string& filter_string); + /** + * This method returns the first expanded accordion tab. + * It is expected to be called for accordion which doesn't allow multiple + * tabs to be expanded. Use with care. + */ + const LLAccordionCtrlTab* getExpandedTab() const; + private: void initNoTabsWidget(const LLTextBox::Params& tb_params); void updateNoTabsHelpTextVisibility(); diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 19d4ec0a1c..7bf7eeef8f 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -171,7 +171,7 @@ public: virtual bool addChild(LLView* child, S32 tab_group); - bool isExpanded() { return mDisplayChildren; } + bool isExpanded() const { return mDisplayChildren; } S32 getHeaderHeight(); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index bc6e030c91..5b70e4bcb0 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4678,7 +4678,381 @@ String Value https://www.xstreetsl.com/modules.php?name=Marketplace - + + MarketplaceURL_objectFemale + + Comment + URL to the Marketplace Attachments Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/attachments + + MarketplaceURL_objectMale + + Comment + URL to the Marketplace Attachments Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/attachments + + MarketplaceURL_clothingFemale + + Comment + URL to the Marketplace Clothing Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/clothing_female_avatar + + MarketplaceURL_clothingMale + + Comment + URL to the Marketplace Clothing Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/clothing_male_avatar + + MarketplaceURL_bodypartFemale + + Comment + URL to the Marketplace Bodyparts Female + Persist + 0 + Type + String + Value + https://www.xstreetsl.com/modules.php?name=Marketplace + + MarketplaceURL_bodypartMale + + Comment + URL to the Marketplace Bodyparts Male + Persist + 0 + Type + String + Value + https://www.xstreetsl.com/modules.php?name=Marketplace + + MarketplaceURL_glovesMale + + Comment + URL to the Marketplace Gloves Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/gloves_both_women_and_men + + MarketplaceURL_glovesFemale + + Comment + URL to the Marketplace Gloves Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/gloves_both_women_and_men + + MarketplaceURL_jacketFemale + + Comment + URL to the Marketplace Jacket Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/jacket_womens + + MarketplaceURL_jacketMale + + Comment + URL to the Marketplace Jacket Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/jacket_mens + + MarketplaceURL_shirtFemale + + Comment + URL to the Marketplace Shirt Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/shirt_womens + + MarketplaceURL_shirtMale + + Comment + URL to the Marketplace Shirt Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/shirt_mens + + MarketplaceURL_undershirtFemale + + Comment + URL to the Marketplace Undershirt Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/undershirt_womens + + MarketplaceURL_undershirtMale + + Comment + URL to the Marketplace Undershirt Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/undershirt_mens + + MarketplaceURL_skirtFemale + + Comment + URL to the Marketplace Skirt Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/skirts_women + + MarketplaceURL_skirtMale + + Comment + URL to the Marketplace Skirt Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/skirts_women + + MarketplaceURL_pantsFemale + + Comment + URL to the Marketplace Pants Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/pants_women + + MarketplaceURL_pantsMale + + Comment + URL to the Marketplace Pants Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/pants_men + + MarketplaceURL_underpantsFemale + + Comment + URL to the Marketplace Underwear Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/underwear_women + + MarketplaceURL_underpantsMale + + Comment + URL to the Marketplace Underwear Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/underwear_men + + MarketplaceURL_shoesFemale + + Comment + URL to the Marketplace Shoes Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/shoes_women + + MarketplaceURL_shoesMale + + Comment + URL to the Marketplace Shoes Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/shoes_men + + MarketplaceURL_socksFemale + + Comment + URL to the Marketplace Socks Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/socks_women + + MarketplaceURL_socksMale + + Comment + URL to the Marketplace Socks Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/socks_women + + MarketplaceURL_tattooMale + + Comment + URL to the Marketplace Tattoo Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/tattoo_both_women_and_men + + MarketplaceURL_tattooFemale + + Comment + URL to the Marketplace Tattoo Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/tattoo_both_women_and_men + + MarketplaceURL_hairFemale + + Comment + URL to the Marketplace Hair Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/womens_hair + + MarketplaceURL_hairMale + + Comment + URL to the Marketplace Hair Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/mens_hair + + MarketplaceURL_eyesFemale + + Comment + URL to the Marketplace Eyes Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/womens_eyes + + MarketplaceURL_eyesMale + + Comment + URL to the Marketplace Eyes Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/mens_eyes + + MarketplaceURL_shapeFemale + + Comment + URL to the Marketplace Shape Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/womens_shape + + MarketplaceURL_shapeMale + + Comment + URL to the Marketplace Shape Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/mens_shape + + MarketplaceURL_skinFemale + + Comment + URL to the Marketplace Skin Female + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/womens_skin + + MarketplaceURL_skinMale + + Comment + URL to the Marketplace Skins Male + Persist + 0 + Type + String + Value + http://marketplace.secondlife.com/trampoline/viewer21/mens_skin + MaxDragDistance Comment diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 611396b0e5..880d79222b 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -34,6 +34,8 @@ #include "llcofwearables.h" +#include "llaccordionctrl.h" +#include "llaccordionctrltab.h" #include "llagentdata.h" #include "llagentwearables.h" #include "llappearancemgr.h" @@ -557,6 +559,14 @@ LLPanel* LLCOFWearables::getSelectedItem() return mLastSelectedList->getSelectedItem(); } +void LLCOFWearables::getSelectedItems(std::vector& selected_items) const +{ + if (mLastSelectedList) + { + mLastSelectedList->getSelectedItems(selected_items); + } +} + void LLCOFWearables::clear() { mAttachments->clear(); @@ -564,6 +574,29 @@ void LLCOFWearables::clear() mBodyParts->clear(); } +LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType() +{ + static std::map type_map; + static LLAccordionCtrl* accordion_ctrl = getChild("cof_wearables_accordion"); + + if (type_map.empty()) + { + type_map["tab_clothing"] = LLAssetType::AT_CLOTHING; + type_map["tab_attachments"] = LLAssetType::AT_OBJECT; + type_map["tab_body_parts"] = LLAssetType::AT_BODYPART; + } + + const LLAccordionCtrlTab* tab = accordion_ctrl->getExpandedTab(); + + if (!tab) + { + llwarns << "No accordion is expanded" << llendl; + return LLAssetType::AT_NONE; + } + + return type_map[tab->getName()]; +} + void LLCOFWearables::onListRightClick(LLUICtrl* ctrl, S32 x, S32 y, LLListContextMenu* menu) { if(menu) diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index f99f2662e6..62f4cfc692 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -78,10 +78,13 @@ public: bool getSelectedUUIDs(uuid_vec_t& selected_ids); LLPanel* getSelectedItem(); + void getSelectedItems(std::vector& selected_items) const; void refresh(); void clear(); + LLAssetType::EType getExpandedAccordionAssetType(); + LLCOFCallbacks& getCOFCallbacks() { return mCOFCallbacks; } protected: diff --git a/indra/newview/llfloaterinventory.h b/indra/newview/llfloaterinventory.h index 473d2b189d..dc719bdafe 100644 --- a/indra/newview/llfloaterinventory.h +++ b/indra/newview/llfloaterinventory.h @@ -66,6 +66,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); LLInventoryPanel* getPanel(); + LLPanelMainInventory* getMainInventoryPanel() { return mPanelMainInventory;} private: LLPanelMainInventory* mPanelMainInventory; }; diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index c86d463a08..68fc86467c 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -52,6 +52,7 @@ #include "llappearancemgr.h" #include "llappviewer.h" //#include "llfirstuse.h" +#include "llfloaterinventory.h" #include "llfocusmgr.h" #include "llfolderview.h" #include "llgesturemgr.h" @@ -63,6 +64,7 @@ #include "llinventorypanel.h" #include "lllineeditor.h" #include "llmenugl.h" +#include "llpanelmaininventory.h" #include "llpreviewanim.h" #include "llpreviewgesture.h" #include "llpreviewnotecard.h" @@ -74,6 +76,7 @@ #include "llscrollcontainer.h" #include "llselectmgr.h" #include "llsidetray.h" +#include "llsidepanelinventory.h" #include "lltabcontainer.h" #include "lltooldraganddrop.h" #include "lluictrlfactory.h" @@ -332,9 +335,38 @@ void show_item_profile(const LLUUID& item_uuid) void show_item_original(const LLUUID& item_uuid) { + bool reset_inventory_filter = !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory"); + LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(); if (!active_panel) return; active_panel->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_NO); + + if(reset_inventory_filter) + { + LLSidepanelInventory *sidepanel_inventory = + dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + if(sidepanel_inventory) + { + LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); + + main_inventory->onFilterEdit(""); + } + + //now for inventory floater + + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) + { + LLFloaterInventory* floater_inventory = dynamic_cast(*iter); + if (floater_inventory) + { + LLPanelMainInventory* main_inventory = floater_inventory->getMainInventoryPanel(); + + main_inventory->onFilterEdit(""); + } + } + + } } ///---------------------------------------------------------------------------- diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 5a068373f5..82b72ac224 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -84,6 +84,7 @@ public: void setSelectCallback(const LLFolderView::signal_t::slot_type& cb); + void onFilterEdit(const std::string& search_string ); protected: // // Misc functions @@ -98,7 +99,7 @@ protected: void onClearSearch(); static void onFoldersByName(void *user_data); static BOOL checkFoldersByName(void *user_data); - void onFilterEdit(const std::string& search_string ); + static BOOL incrementalFind(LLFolderViewItem* first_item, const char *find_text, BOOL backward); void onFilterSelected(); diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 1454a2f6af..8da7432e0a 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -72,6 +72,8 @@ #include "lltoggleablemenu.h" #include "llwearablelist.h" #include "llwearableitemslist.h" +#include "llwearabletype.h" +#include "llweb.h" static LLRegisterPanelClassWrapper t_outfit_edit("panel_outfit_edit"); @@ -81,6 +83,65 @@ const U64 ALL_ITEMS_MASK = WEARABLE_MASK | ATTACHMENT_MASK; static const std::string REVERT_BTN("revert_btn"); +class LLShopURLDispatcher +{ +public: + std::string resolveURL(LLWearableType::EType wearable_type, ESex sex); + std::string resolveURL(LLAssetType::EType asset_type, ESex sex); +}; + +std::string LLShopURLDispatcher::resolveURL(LLWearableType::EType wearable_type, ESex sex) +{ + const std::string prefix = "MarketplaceURL"; + const std::string sex_str = (sex == SEX_MALE) ? "Male" : "Female"; + const std::string type_str = LLWearableType::getTypeName(wearable_type); + + std::string setting_name = prefix; + + switch (wearable_type) + { + case LLWearableType::WT_ALPHA: + case LLWearableType::WT_NONE: + case LLWearableType::WT_INVALID: // just in case, this shouldn't happen + case LLWearableType::WT_COUNT: // just in case, this shouldn't happen + break; + + default: + setting_name += '_'; + setting_name += type_str; + setting_name += sex_str; + break; + } + + return gSavedSettings.getString(setting_name); +} + +std::string LLShopURLDispatcher::resolveURL(LLAssetType::EType asset_type, ESex sex) +{ + const std::string prefix = "MarketplaceURL"; + const std::string sex_str = (sex == SEX_MALE) ? "Male" : "Female"; + const std::string type_str = LLAssetType::lookup(asset_type); + + std::string setting_name = prefix; + + switch (asset_type) + { + case LLAssetType::AT_CLOTHING: + case LLAssetType::AT_OBJECT: + case LLAssetType::AT_BODYPART: + setting_name += '_'; + setting_name += type_str; + setting_name += sex_str; + break; + + // to suppress warnings + default: + break; + } + + return gSavedSettings.getString(setting_name); +} + class LLPanelOutfitEditGearMenu { public: @@ -262,6 +323,7 @@ BOOL LLPanelOutfitEdit::postBuild() childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, 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", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); mCOFWearables = getChild("cof_wearables_list"); mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::filterWearablesBySelectedItem, this)); @@ -530,6 +592,46 @@ void LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked(LLUUID selected_item_id } } +void LLPanelOutfitEdit::onShopButtonClicked() +{ + static LLShopURLDispatcher url_resolver; + + std::string url; + std::vector selected_items; + mCOFWearables->getSelectedItems(selected_items); + + ESex sex = gSavedSettings.getU32("AvatarSex") ? SEX_MALE : SEX_FEMALE; + + if (selected_items.size() == 1) + { + LLWearableType::EType type = LLWearableType::WT_NONE; + LLPanel* item = selected_items.front(); + + // LLPanelDummyClothingListItem is lower then LLPanelInventoryListItemBase in hierarchy tree + if (LLPanelDummyClothingListItem* dummy_item = dynamic_cast(item)) + { + type = dummy_item->getWearableType(); + } + else if (LLPanelInventoryListItemBase* real_item = dynamic_cast(item)) + { + type = real_item->getWearableType(); + } + + // WT_INVALID comes for attachments + if (type != LLWearableType::WT_INVALID) + { + url = url_resolver.resolveURL(type, sex); + } + } + + if (url.empty()) + { + url = url_resolver.resolveURL(mCOFWearables->getExpandedAccordionAssetType(), sex); + } + + LLWeb::loadURLExternal(url); +} + void LLPanelOutfitEdit::onRemoveFromOutfitClicked(void) { LLUUID id_to_remove = mCOFWearables->getSelectedUUID(); diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 56c6c6d680..1705e3043b 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -163,6 +163,7 @@ public: void onEditWearableClicked(void); void onAddWearableClicked(void); void onReplaceBodyPartMenuItemClicked(LLUUID selected_item_id); + void onShopButtonClicked(); void displayCurrentOutfit(); void updateCurrentOutfitName(); diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 5563214407..7e1bff0961 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -86,7 +86,6 @@ public: registrar.add("Gear.Wear", boost::bind(&LLOutfitListGearMenu::onWear, this)); registrar.add("Gear.TakeOff", boost::bind(&LLOutfitListGearMenu::onTakeOff, this)); - registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenu::onRename, this)); registrar.add("Gear.Delete", boost::bind(&LLOutfitListGearMenu::onDelete, this)); registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2)); @@ -159,15 +158,6 @@ private: } } - void onRename() - { - const LLUUID& selected_outfit_id = getSelectedOutfitID(); - if (selected_outfit_id.notNull()) - { - LLAppearanceMgr::instance().renameOutfit(selected_outfit_id); - } - } - void onDelete() { const LLUUID& selected_outfit_id = getSelectedOutfitID(); @@ -197,11 +187,7 @@ private: return false; } - if ("rename" == param) - { - return get_is_category_renameable(&gInventory, selected_outfit_id); - } - else if ("delete" == param) + if ("delete" == param) { return LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit_id); } diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 2dc17e741d..a038f99853 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -51,6 +51,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any. + LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; } BOOL isMainInventoryPanelActive() const; protected: diff --git a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml index e94af2c8d5..d1db5c17ba 100644 --- a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml +++ b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml @@ -18,6 +18,7 @@ max_length="2147483647" name="Chat History Editor" parse_highlights="true" + read_only="true" width="420" word_wrap="true" /> diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml index 8e7ef7f0b5..16b33eff89 100644 --- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml @@ -175,19 +175,6 @@ - - - - - + auto_resize="true" + width="313"> + name="groups_accordion" + width="313"> @@ -375,7 +375,19 @@ It is calculated as border_size + 2*UIResizeBarOverlap layout="topleft" left_pad="1" name="dummy_right_icon" - width="281" /> + width="246" /> +