From 4387118d55d10df56ce547588c7d6c09395ddcd2 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 23 Nov 2014 18:50:59 -0500 Subject: [PATCH 01/73] Remove silly redundant code in LLFloater::draw Thanks to Diva for pointing this out. --- indra/llui/llfloater.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c8be07f43..e3da1a9d6 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1498,23 +1498,8 @@ void LLFloater::draw() } else { - // draw children - LLView* focused_child = dynamic_cast(gFocusMgr.getKeyboardFocus()); - BOOL focused_child_visible = FALSE; - if (focused_child && focused_child->getParent() == this) - { - focused_child_visible = focused_child->getVisible(); - focused_child->setVisible(FALSE); - } - // don't call LLPanel::draw() since we've implemented custom background rendering LLView::draw(); - - if (focused_child_visible) - { - focused_child->setVisible(TRUE); - } - drawChild(focused_child); } if( isBackgroundVisible() ) From 80ac46c9a5c33328635afff38284e390ea88861a Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 24 Nov 2014 20:38:46 -0500 Subject: [PATCH 02/73] Move llfoldertype from llcommon/ to llinventory/ --- indra/llcommon/CMakeLists.txt | 2 -- indra/llinventory/CMakeLists.txt | 2 ++ indra/{llcommon => llinventory}/llfoldertype.cpp | 0 indra/{llcommon => llinventory}/llfoldertype.h | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename indra/{llcommon => llinventory}/llfoldertype.cpp (100%) rename indra/{llcommon => llinventory}/llfoldertype.h (98%) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 79674c5a0..2899d0712 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -56,7 +56,6 @@ set(llcommon_SOURCE_FILES llfile.cpp llfindlocale.cpp llfixedbuffer.cpp - llfoldertype.cpp llformat.cpp llframetimer.cpp llheartbeat.cpp @@ -177,7 +176,6 @@ set(llcommon_HEADER_FILES llfile.h llfindlocale.h llfixedbuffer.h - llfoldertype.h llformat.h llframetimer.h llhandle.h diff --git a/indra/llinventory/CMakeLists.txt b/indra/llinventory/CMakeLists.txt index afd5de34f..f288fa496 100644 --- a/indra/llinventory/CMakeLists.txt +++ b/indra/llinventory/CMakeLists.txt @@ -18,6 +18,7 @@ include_directories( set(llinventory_SOURCE_FILES llcategory.cpp lleconomy.cpp + llfoldertype.cpp llinventory.cpp llinventorydefines.cpp llinventorytype.cpp @@ -35,6 +36,7 @@ set(llinventory_HEADER_FILES llcategory.h lleconomy.h + llfoldertype.h llinventory.h llinventorydefines.h llinventorytype.h diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llinventory/llfoldertype.cpp similarity index 100% rename from indra/llcommon/llfoldertype.cpp rename to indra/llinventory/llfoldertype.cpp diff --git a/indra/llcommon/llfoldertype.h b/indra/llinventory/llfoldertype.h similarity index 98% rename from indra/llcommon/llfoldertype.h rename to indra/llinventory/llfoldertype.h index 7e7cfa2b9..421c44fea 100644 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llinventory/llfoldertype.h @@ -39,7 +39,7 @@ // This class handles folder types (similar to assettype, except for folders) // and operations on those. -class LL_COMMON_API LLFolderType +class LLFolderType { public: // ! BACKWARDS COMPATIBILITY ! Folder type enums must match asset type enums. From d80ebdc77d162711ac79e838aeb49bf7f075a51a Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 25 Nov 2014 01:46:12 -0500 Subject: [PATCH 03/73] getOpenIcon -> getIconOpen --- indra/newview/llinventorybridge.cpp | 2 +- indra/newview/llinventorybridge.h | 2 +- indra/newview/llinventorypanel.cpp | 4 ++-- indra/newview/llpanelmarketplaceoutboxinventory.cpp | 4 ++-- indra/newview/llpanelobjectinventory.cpp | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 368bb3284..a5ababe30 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3008,7 +3008,7 @@ LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type) return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, FALSE)); } -LLUIImagePtr LLFolderBridge::getOpenIcon() const +LLUIImagePtr LLFolderBridge::getIconOpen() const { return LLUI::getUIImage(LLViewerFolderType::lookupIconName(getPreferredType(), TRUE)); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index d5d604cd8..3329f14f9 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -255,7 +255,7 @@ public: virtual LLFolderType::EType getPreferredType() const; virtual LLUIImagePtr getIcon() const; - virtual LLUIImagePtr getOpenIcon() const; + virtual LLUIImagePtr getIconOpen() const; static LLUIImagePtr getIcon(LLFolderType::EType preferred_type); virtual BOOL renameItem(const std::string& new_name); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 9adffa9ef..aa74c4f1a 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -705,7 +705,7 @@ LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * br return new LLFolderViewFolder( bridge->getDisplayName(), bridge->getIcon(), - bridge->getOpenIcon(), + bridge->getIconOpen(), LLUI::getUIImage("inv_link_overlay.tga"), mFolderRoot.get(), bridge); @@ -716,7 +716,7 @@ LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge return new LLFolderViewItem( bridge->getDisplayName(), bridge->getIcon(), - bridge->getOpenIcon(), + bridge->getIconOpen(), LLUI::getUIImage("inv_link_overlay.tga"), bridge->getCreationDate(), mFolderRoot.get(), diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.cpp b/indra/newview/llpanelmarketplaceoutboxinventory.cpp index 2a19fea07..090c32a81 100644 --- a/indra/newview/llpanelmarketplaceoutboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceoutboxinventory.cpp @@ -91,7 +91,7 @@ LLFolderViewFolder * LLOutboxInventoryPanel::createFolderViewFolder(LLInvFVBridg return new LLOutboxFolderViewFolder( bridge->getDisplayName(), bridge->getIcon(), - bridge->getOpenIcon(), + bridge->getIconOpen(), LLUI::getUIImage("inv_link_overlay.tga"), mFolderRoot.get(), bridge); @@ -102,7 +102,7 @@ LLFolderViewItem * LLOutboxInventoryPanel::createFolderViewItem(LLInvFVBridge * return new LLOutboxFolderViewItem( bridge->getDisplayName(), bridge->getIcon(), - bridge->getOpenIcon(), + bridge->getIconOpen(), LLUI::getUIImage("inv_link_overlay.tga"), bridge->getCreationDate(), mFolderRoot.get(), diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 95bbf36fc..1b764998c 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1821,7 +1821,7 @@ void LLPanelObjectInventory::createFolderViews(LLInventoryObject* inventory_root LLFolderViewFolder* new_folder = NULL; new_folder = new LLFolderViewFolder(inventory_root->getName(), bridge->getIcon(), - bridge->getOpenIcon(), + bridge->getIconOpen(), NULL, mFolders, bridge); @@ -1860,7 +1860,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li { view = new LLFolderViewFolder(obj->getName(), bridge->getIcon(), - bridge->getOpenIcon(), + bridge->getIconOpen(), NULL, mFolders, bridge); @@ -1871,7 +1871,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li { view = new LLFolderViewItem(obj->getName(), bridge->getIcon(), - bridge->getOpenIcon(), + bridge->getIconOpen(), NULL, bridge->getCreationDate(), mFolders, From e69385861ac0af76089733c0df99851893cb3120 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 25 Nov 2014 23:36:43 -0500 Subject: [PATCH 04/73] Add LLHTTPClient::putRaw --- indra/llmessage/llhttpclient.cpp | 5 +++++ indra/llmessage/llhttpclient.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index bc208281d..de245d985 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -722,6 +722,11 @@ void LLHTTPClient::put(std::string const& url, LLSD const& body, ResponderPtr re request(url, HTTP_PUT, new LLSDInjector(body), responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug), no_keep_alive, no_does_authentication, no_allow_compressed_reply); } +void LLHTTPClient::putRaw(const std::string& url, const U8* data, S32 size, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug)) +{ + request(url, HTTP_PUT, new RawInjector(data, size), responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug), no_keep_alive, no_does_authentication, no_allow_compressed_reply); +} + void LLHTTPClient::post(std::string const& url, LLSD const& body, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug), EKeepAlive keepalive, AIStateMachine* parent, AIStateMachine::state_type new_parent_state) { request(url, HTTP_POST, new LLSDInjector(body), responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug), keepalive, no_does_authentication, allow_compressed_reply, parent, new_parent_state); diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h index b0fdd53f3..49add740f 100644 --- a/indra/llmessage/llhttpclient.h +++ b/indra/llmessage/llhttpclient.h @@ -491,6 +491,10 @@ public: static void put(std::string const& url, LLSD const& body, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) { AIHTTPHeaders headers; put(url, body, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); } + static void putRaw(const std::string& url, const U8* data, S32 size, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)); + static void putRaw(const std::string& url, const U8* data, S32 size, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) + { AIHTTPHeaders headers; putRaw(url, data, size, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); } + static void getHeaderOnly(std::string const& url, ResponderHeadersOnly* responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)); static void getHeaderOnly(std::string const& url, ResponderHeadersOnly* responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) { AIHTTPHeaders headers; getHeaderOnly(url, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); } From 152cf42029136fb1a51a4d9f86cc19036fc5c5a1 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 25 Nov 2014 23:39:10 -0500 Subject: [PATCH 05/73] This escaped the getOpenIcon->getIconOpen commit. --- indra/newview/llfoldervieweventlistener.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h index 62c7a67ec..3c942352d 100644 --- a/indra/newview/llfoldervieweventlistener.h +++ b/indra/newview/llfoldervieweventlistener.h @@ -57,7 +57,7 @@ public: virtual PermissionMask getPermissionMask() const = 0; virtual LLFolderType::EType getPreferredType() const = 0; virtual LLPointer getIcon() const = 0; - virtual LLPointer getOpenIcon() const { return getIcon(); } + virtual LLPointer getIconOpen() const { return getIcon(); } virtual LLFontGL::StyleFlags getLabelStyle() const = 0; virtual std::string getLabelSuffix() const = 0; virtual void openItem( void ) = 0; From 808e262a4d4f267a817e3c9c7f31f3d8a44d6c9b Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Wed, 26 Nov 2014 01:23:45 -0500 Subject: [PATCH 06/73] MAINT-3562 FIXED Viewer crashes when updating local textures using Substance Designer : add code for control input buffer size https://bitbucket.org/VirLinden/vir-bugs/commits/3e69e78acb67568c665d81cb139317d40ad6c8ec --- indra/llimage/llimagepng.cpp | 4 ++-- indra/llimage/llpngwrapper.cpp | 9 ++++++++- indra/llimage/llpngwrapper.h | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp index 294f68b12..8ffd3c7f9 100644 --- a/indra/llimage/llimagepng.cpp +++ b/indra/llimage/llimagepng.cpp @@ -67,7 +67,7 @@ BOOL LLImagePNG::updateData() } LLPngWrapper::ImageInfo infop; - if (! pngWrapper.readPng(getData(), NULL, &infop)) + if (! pngWrapper.readPng(getData(), getDataSize(), &infop)) { setLastError(pngWrapper.getErrorMessage()); return FALSE; @@ -102,7 +102,7 @@ BOOL LLImagePNG::decode(LLImageRaw* raw_image, F32 decode_time) return FALSE; } - if (! pngWrapper.readPng(getData(), raw_image)) + if (! pngWrapper.readPng(getData(), getDataSize(), raw_image)) { setLastError(pngWrapper.getErrorMessage()); return FALSE; diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp index d33aa94fd..c9d34f850 100644 --- a/indra/llimage/llpngwrapper.cpp +++ b/indra/llimage/llpngwrapper.cpp @@ -93,6 +93,12 @@ void LLPngWrapper::errorHandler(png_structp png_ptr, png_const_charp msg) void LLPngWrapper::readDataCallback(png_structp png_ptr, png_bytep dest, png_size_t length) { PngDataInfo *dataInfo = (PngDataInfo *) png_get_io_ptr(png_ptr); + if (dataInfo->mOffset + length > dataInfo->mDataSize) + { + png_error(png_ptr, "Data read error. Requested data size exceeds available data size."); + return; + } + U8 *src = &dataInfo->mData[dataInfo->mOffset]; memcpy(dest, src, length); dataInfo->mOffset += static_cast(length); @@ -120,7 +126,7 @@ void LLPngWrapper::writeFlush(png_structp png_ptr) // The scanline also begins at the bottom of // the image (per SecondLife conventions) instead of at the top, so we // must assign row-pointers in "reverse" order. -BOOL LLPngWrapper::readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop) +BOOL LLPngWrapper::readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInfo *infop) { try { @@ -139,6 +145,7 @@ BOOL LLPngWrapper::readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop) PngDataInfo dataPtr; dataPtr.mData = src; dataPtr.mOffset = 0; + dataPtr.mDataSize = dataSize; png_set_read_fn(mReadPngPtr, &dataPtr, &readDataCallback); png_set_sig_bytes(mReadPngPtr, 0); diff --git a/indra/llimage/llpngwrapper.h b/indra/llimage/llpngwrapper.h index 397d316d0..7aeb1a09c 100644 --- a/indra/llimage/llpngwrapper.h +++ b/indra/llimage/llpngwrapper.h @@ -49,7 +49,7 @@ public: }; BOOL isValidPng(U8* src); - BOOL readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop = NULL); + BOOL readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInfo *infop = NULL); BOOL writePng(const LLImageRaw* rawImage, U8* dst); U32 getFinalSize(); const std::string& getErrorMessage(); @@ -66,6 +66,7 @@ private: { U8 *mData; U32 mOffset; + S32 mDataSize; }; static void writeFlush(png_structp png_ptr); From a81ecc20067b48cf8a757e9c117cbfb977448449 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Thu, 27 Nov 2014 12:45:55 -0500 Subject: [PATCH 07/73] Introduce LLInventoryAction namespace, move doToSelected into it. --- indra/newview/llinventoryactions.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/indra/newview/llinventoryactions.cpp b/indra/newview/llinventoryactions.cpp index 20fe180d7..b647e28ee 100644 --- a/indra/newview/llinventoryactions.cpp +++ b/indra/newview/llinventoryactions.cpp @@ -60,12 +60,17 @@ extern LLUUID gAgentID; using namespace LLOldEvents; +namespace LLInventoryAction +{ + bool doToSelected(LLFolderView* folder, std::string action); +} + typedef LLMemberListener object_inventory_listener_t; typedef LLMemberListener inventory_listener_t; typedef LLMemberListener inventory_panel_listener_t; -bool doToSelected(LLFolderView* folder, std::string action) { +bool LLInventoryAction::doToSelected(LLFolderView* folder, std::string action) LLInventoryModel* model = &gInventory; if ("rename" == action) { @@ -136,7 +141,7 @@ class LLDoToSelectedPanel : public object_inventory_listener_t LLFolderView* folder = panel->getRootFolder(); if(!folder) return true; - return doToSelected(folder, userdata.asString()); + return LLInventoryAction::doToSelected(folder, userdata.asString()); } }; @@ -148,7 +153,7 @@ class LLDoToSelectedFloater : public inventory_listener_t LLFolderView* folder = panel->getRootFolder(); if(!folder) return true; - return doToSelected(folder, userdata.asString()); + return LLInventoryAction::doToSelected(folder, userdata.asString()); } }; @@ -160,7 +165,7 @@ class LLDoToSelected : public inventory_panel_listener_t LLFolderView* folder = panel->getRootFolder(); if(!folder) return true; - return doToSelected(folder, userdata.asString()); + return LLInventoryAction::doToSelected(folder, userdata.asString()); } }; From 9e2667261f6832f0ebac470166d08833264af246 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Fri, 5 Dec 2014 12:16:12 -0500 Subject: [PATCH 08/73] Timeout policy removal in llmarketplacefunctions.cpp --- indra/llmessage/aihttptimeoutpolicy.cpp | 2 -- indra/newview/llmarketplacefunctions.cpp | 5 ----- 2 files changed, 7 deletions(-) diff --git a/indra/llmessage/aihttptimeoutpolicy.cpp b/indra/llmessage/aihttptimeoutpolicy.cpp index fbd143c30..96bf6e10a 100644 --- a/indra/llmessage/aihttptimeoutpolicy.cpp +++ b/indra/llmessage/aihttptimeoutpolicy.cpp @@ -936,8 +936,6 @@ P(iamHereVoice); P2(inventoryModelFetchDescendentsResponder, transfer_300s); P(inventoryModelFetchItemResponder); P(lcl_responder); -P(MPImportGetResponder); -P(MPImportPostResponder); P(mapLayerResponder); P(materialsResponder); P2(maturityPreferences, transfer_30s_connect_10s); diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 3fc5a166e..0870e3c48 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -120,9 +120,6 @@ LLSD getMarketplaceStringSubstitutions() return marketplace_sub_map; } -class AIHTTPTimeoutPolicy; -extern AIHTTPTimeoutPolicy MPImportGetResponder_timeout; -extern AIHTTPTimeoutPolicy MPImportPostResponder_timeout; namespace LLMarketplaceImport { @@ -194,7 +191,6 @@ namespace LLMarketplaceImport sImportId = mContent; } - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return MPImportPostResponder_timeout; } /*virtual*/ char const* getName(void) const { return "LLImportPostResponder"; } }; @@ -254,7 +250,6 @@ namespace LLMarketplaceImport sImportResults = mContent; } - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return MPImportGetResponder_timeout; } /*virtual*/ char const* getName(void) const { return "LLImportGetResponder"; } }; From 18f640d73dac9bf94ec0c8df2d71cd4bcc36647b Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Fri, 5 Dec 2014 12:52:01 -0500 Subject: [PATCH 09/73] Fix Linux linker errors Patch by Aleric --- indra/cmake/PNG.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 565c22cec..7312156fc 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -8,6 +8,7 @@ if (STANDALONE) include(FindPNG) else (STANDALONE) use_prebuilt_binary(libpng) + set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/) if (WINDOWS) set(PNG_LIBRARIES libpng15) elseif(DARWIN) @@ -30,8 +31,7 @@ else (STANDALONE) # set(PNG_PRELOAD_ARCHIVES -Wl,--whole-archive png16 -Wl,--no-whole-archive) set(PNG_LIBRARIES png16) - set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16) + set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/libpng16) endif () endif() - set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/) endif (STANDALONE) From 80b4fe6613cebcf606852121f891c38fa60f2fd7 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Fri, 5 Dec 2014 18:39:05 -0500 Subject: [PATCH 10/73] Solve Issue 1755: Change Appearance Save button to a flyout option, and move File->Update Outfit Update Outfit is now at the bottom of the inventory's File menu. --- indra/newview/llfloatercustomize.cpp | 27 ++++++++++--------- indra/newview/llfloatercustomize.h | 4 +-- .../default/xui/de/floater_customize.xml | 3 +-- .../default/xui/de/floater_inventory.xml | 2 +- .../default/xui/en-us/floater_customize.xml | 5 ++-- .../default/xui/en-us/floater_inventory.xml | 6 ++--- .../default/xui/es/floater_customize.xml | 3 +-- .../default/xui/es/floater_inventory.xml | 2 +- .../default/xui/fr/floater_customize.xml | 3 +-- .../default/xui/it/floater_customize.xml | 2 +- .../default/xui/pt/floater_customize.xml | 2 +- 11 files changed, 28 insertions(+), 31 deletions(-) diff --git a/indra/newview/llfloatercustomize.cpp b/indra/newview/llfloatercustomize.cpp index 30cf75dc9..6a319c568 100644 --- a/indra/newview/llfloatercustomize.cpp +++ b/indra/newview/llfloatercustomize.cpp @@ -38,6 +38,7 @@ #include "llagentcamera.h" #include "llagentwearables.h" #include "llappearancemgr.h" +#include "llflyoutbutton.h" #include "llmakeoutfitdialog.h" #include "llmorphview.h" #include "llnotificationsutil.h" @@ -154,11 +155,9 @@ LLFloaterCustomize::~LLFloaterCustomize() // virtual BOOL LLFloaterCustomize::postBuild() { - mMakeOutfitBtn = getChild("Make Outfit"); - getChild("Make Outfit")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnMakeOutfit, this)); - mSaveOutfitBtn = getChild("Save Outfit"); - mSaveOutfitBtn->setCommitCallback(boost::bind(&LLAppearanceMgr::updateBaseOutfit, LLAppearanceMgr::getInstance())); - refreshCurrentOutfitName(); // Initialize tooltip for save outfit button + mMakeOutfitBtn = getChild("Make Outfit"); + mMakeOutfitBtn->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnMakeOutfit, this, _2)); + refreshCurrentOutfitName(); // Initialize flyout list entry for save outfit getChild("Ok")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnOk, this)); getChild("Cancel")->setCommitCallback(boost::bind(&LLFloater::onClickClose, this)); @@ -201,11 +200,11 @@ BOOL LLFloaterCustomize::postBuild() void LLFloaterCustomize::refreshCurrentOutfitName(const std::string& name) { // Set current outfit status (wearing/unsaved). - bool dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); + //bool dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); //std::string cof_status_str = getString(dirty ? "Unsaved Changes" : "Now Wearing"); //mOutfitStatus->setText(cof_status_str); - mSaveOutfitBtn->setEnabled(dirty); // No use saving unless dirty + mMakeOutfitBtn->remove(0); if (name.empty()) { std::string outfit_name; @@ -214,22 +213,21 @@ void LLFloaterCustomize::refreshCurrentOutfitName(const std::string& name) //mCurrentLookName->setText(outfit_name); LLStringUtil::format_map_t args; args["[OUTFIT]"] = outfit_name; - mSaveOutfitBtn->setToolTip(getString("Save changes to", args)); + mMakeOutfitBtn->add(getString("Save changes to", args), true); return; } std::string string_name = gAgentWearables.isCOFChangeInProgress() ? "Changing outfits" : "No Outfit"; //mCurrentLookName->setText(getString(string_name)); - mSaveOutfitBtn->setToolTip(getString(string_name)); + mMakeOutfitBtn->add(getString(string_name), false); //mOpenOutfitBtn->setEnabled(FALSE); - mSaveOutfitBtn->setEnabled(false); // Can't save right now } else { //mCurrentLookName->setText(name); LLStringUtil::format_map_t args; args["[OUTFIT]"] = name; - mSaveOutfitBtn->setToolTip(getString("Save changes to", args)); + mMakeOutfitBtn->add(getString("Save changes to", args), true); // Can't just call update verbs since the folder link may not have been created yet. //mOpenOutfitBtn->setEnabled(TRUE); } @@ -539,9 +537,12 @@ void LLFloaterCustomize::onBtnOk() close(false); } -void LLFloaterCustomize::onBtnMakeOutfit() +void LLFloaterCustomize::onBtnMakeOutfit(const LLSD& val) { - new LLMakeOutfitDialog(true); // LLMakeOutfitDialog deletes itself. + if (val && LLAppearanceMgr::instance().isOutfitDirty()) // No use saving unless dirty + LLAppearanceMgr::instance().updateBaseOutfit(); + else + new LLMakeOutfitDialog(true); // LLMakeOutfitDialog deletes itself. } //////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llfloatercustomize.h b/indra/newview/llfloatercustomize.h index c7246e5fc..dfe669470 100644 --- a/indra/newview/llfloatercustomize.h +++ b/indra/newview/llfloatercustomize.h @@ -99,7 +99,7 @@ public: private: // Callbacks void onBtnOk(); - void onBtnMakeOutfit(); + void onBtnMakeOutfit(const LLSD& val); void onBtnImport(); void onBtnImport_continued(AIFilePicker* filepicker); void onBtnExport(); @@ -120,7 +120,7 @@ private: LLScrollingPanelList* mScrollingPanelList; LLScrollContainer* mScrollContainer; LLView *mMetricHeight, *mImperialHeight; - LLUICtrl *mMakeOutfitBtn, *mSaveOutfitBtn; + class LLFlyoutButton* mMakeOutfitBtn; LLTabContainer* mTabContainer; LLPointer mResetParams; diff --git a/indra/newview/skins/default/xui/de/floater_customize.xml b/indra/newview/skins/default/xui/de/floater_customize.xml index 31300981a..1c5316b1f 100644 --- a/indra/newview/skins/default/xui/de/floater_customize.xml +++ b/indra/newview/skins/default/xui/de/floater_customize.xml @@ -398,8 +398,7 @@ und dieses anziehen. + +