From 17c9dd061a06b7574447895dc6170fe0c3e7ff48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Gon=C3=A7alves=20=28Ulukyn=29?= Date: Fri, 3 Dec 2021 14:20:36 +0000 Subject: [PATCH 1/3] Resolve "Remove lock option from item menu in guild inventory" --- .../src/interface_v3/action_handler_item.cpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ryzom/client/src/interface_v3/action_handler_item.cpp b/ryzom/client/src/interface_v3/action_handler_item.cpp index 8870a9f21..da7e95fd8 100644 --- a/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -208,7 +208,7 @@ void CInterfaceItemEdition::CItemEditionWindow::begin() { if(_CurrItemSheet && !WindowName.empty()) { - + const CItemSheet *pIS = _CurrItemSheet->asItemSheet(); if ((pIS != NULL) && ITEMFAMILY::isTextCustomizable(pIS->Family) ) { @@ -342,7 +342,7 @@ void CInterfaceItemEdition::CItemEditionWindow::begin() // ******************************************************************************************** void CInterfaceItemEdition::CItemEditionWindow::end() { - + CDBCtrlSheet *pCSItem = _CurrItemSheet; std::string windowName = WindowName; if(pCSItem && !windowName.empty()) @@ -371,7 +371,7 @@ void CInterfaceItemEdition::CItemEditionWindow::end() editBoxShort->setActive(false); editShort->setActive(false); editBoxLarge->setActive(false); - editLarge->setActive(false); + editLarge->setActive(false); display->setActive(false); editButtons->setActive(false); closeButton->setActive(false); @@ -413,7 +413,7 @@ void CInterfaceItemEdition::CItemEditionWindow::validate() textValid = editLarge->getActive(); text = editBoxLarge->getInputString(); } - + if (textValid) { CBitMemStream out; @@ -1722,7 +1722,7 @@ void CItemMenuInBagInfoWaiter::infoReceived() void CItemMenuInBagInfoWaiter::infoValidated(CDBCtrlSheet* ctrlSheet) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - + // get the dialog stack CInterfaceGroup* pMenu = dynamic_cast( CWidgetManager::getInstance()->getElementFromId("ui:interface:item_menu_in_bag") ); if(!pMenu) return; @@ -2036,7 +2036,7 @@ class CHandlerItemMenuCheck : public IActionHandler if (pMoveSubMenu) pMoveSubMenu->setActive(false); } - if (bIsLockedByOwner) + if (bIsLockedByOwner) { if (pLockUnlock) pLockUnlock->setHardText("uimUnlockItem"); // Cannot drop/destroy if locked by owner @@ -2049,7 +2049,8 @@ class CHandlerItemMenuCheck : public IActionHandler } // Only show lock menu item if inventory contains the info - if (pLockUnlock) pLockUnlock->setActive(pCS->canOwnerLock()); + if (invId!=INVENTORIES::guild) + if (pLockUnlock) pLockUnlock->setActive(pCS->canOwnerLock()); // **** Gray Entries @@ -2206,7 +2207,7 @@ class CHandlerItemMenuBaseCheck : public IActionHandler CViewTextMenu *pDestroy = dynamic_cast(pMenu->getView("destroy")); CViewTextMenu *pLockUnlock = dynamic_cast(pMenu->getView("lockunlock")); - if (pCS->getLockedByOwner()) + if (pCS->getLockedByOwner()) { pLockUnlock->setHardText("uimUnlockItem"); // Cannot destroy if locked by owner @@ -2363,7 +2364,7 @@ class CHandlerItemTextDisplay : public IActionHandler std::string const& windowName = sParams; CInterfaceManager *pIM = CInterfaceManager::getInstance(); CDBCtrlSheet *pCSItem = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); - if (pCSItem == NULL || windowName.empty()) + if (pCSItem == NULL || windowName.empty()) return; const CItemSheet *pIS = pCSItem->asItemSheet(); @@ -2384,7 +2385,7 @@ class CHandlerItemTextEdition : public IActionHandler std::string const& windowName = sParams; CInterfaceManager *pIM = CInterfaceManager::getInstance(); CDBCtrlSheet *pCSItem = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); - if (pCSItem == NULL || windowName.empty()) + if (pCSItem == NULL || windowName.empty()) return; CInterfaceItemEdition::getInstance()->setCurrWindow(pCSItem, windowName, true); From bbc291b9d3ad84a8317330ab3b26b823bd9cd5d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Meelis=20M=C3=A4gi?= Date: Fri, 3 Dec 2021 22:55:08 +0000 Subject: [PATCH 2/3] Resolve "Encoding issues in client beta (after core4 merge)" --- ryzom/client/src/interface_v3/sphrase_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ryzom/client/src/interface_v3/sphrase_manager.cpp b/ryzom/client/src/interface_v3/sphrase_manager.cpp index 7e2585eb4..639e8b426 100644 --- a/ryzom/client/src/interface_v3/sphrase_manager.cpp +++ b/ryzom/client/src/interface_v3/sphrase_manager.cpp @@ -798,7 +798,7 @@ void CSPhraseManager::buildPhraseFromSheet(CSPhraseCom &phrase, sint32 sheetI if(phraseSheet) { // get localized Name - phrase.Name= STRING_MANAGER::CStringManagerClient::getSPhraseLocalizedName(CSheetId(sheetId)); + phrase.Name.fromUtf8(STRING_MANAGER::CStringManagerClient::getSPhraseLocalizedName(CSheetId(sheetId))); // Build bricks phrase.Bricks.clear(); for(uint i=0;iBricks.size();i++) From 8517bb72e132550a4e233d6951669c23d39ea4fe Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 10 Dec 2021 23:44:09 +0200 Subject: [PATCH 3/3] Fixed cleanup of html downloads --- nel/include/nel/gui/group_html.h | 1 + nel/src/gui/group_html.cpp | 25 +++++++++++++++---------- nel/src/gui/view_bitmap.cpp | 8 +++++++- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/nel/include/nel/gui/group_html.h b/nel/include/nel/gui/group_html.h index 8b6ad19b6..4f972b191 100644 --- a/nel/include/nel/gui/group_html.h +++ b/nel/include/nel/gui/group_html.h @@ -969,6 +969,7 @@ namespace NLGUI // stop all curl downalods (html and data) void releaseDownloads(); + void releaseDataDownloads(); void checkDownloads(); // _CurlWWW download finished diff --git a/nel/src/gui/group_html.cpp b/nel/src/gui/group_html.cpp index 107ab107a..de7e6effe 100644 --- a/nel/src/gui/group_html.cpp +++ b/nel/src/gui/group_html.cpp @@ -299,6 +299,11 @@ namespace NLGUI void CGroupHTML::ImageDownloadCB::finish() { + // Image setTexture will remove itself from Images while iterating over it. + // Do the swap to keep iterator safe. + std::vector vec; + vec.swap(Images); + // tmpdest file does not exist if download skipped (ie cache was used) if (CFile::fileExists(tmpdest) || CFile::getFileSize(tmpdest) == 0) { @@ -322,7 +327,7 @@ namespace NLGUI // to temp file temporarily. that forces driver to reload texture from disk // ITexture::touch() seem not to do this. // cache was updated, first set texture as temp file - for(std::vector::iterator it = Images.begin(); it != Images.end(); ++it) + for(std::vector::iterator it = vec.begin(); it != vec.end(); ++it) { SImageInfo &img = *it; Parent->setImage(img.Image, tmpdest, img.Type); @@ -339,7 +344,7 @@ namespace NLGUI } // even if image was cached, incase there was 'http://' image set to CViewBitmap - for(std::vector::iterator it = Images.begin(); it != Images.end(); ++it) + for(std::vector::iterator it = vec.begin(); it != vec.end(); ++it) { SImageInfo &img = *it; Parent->setImage(img.Image, dest, img.Type); @@ -1053,6 +1058,13 @@ namespace NLGUI _CurlWWW = NULL; } + releaseDataDownloads(); + } + + void CGroupHTML::releaseDataDownloads() + { + LOG_DL("Clear pointers to %d curls", Curls.size()); + // remove all queued and already started downloads for(std::list::iterator it = Curls.begin(); it != Curls.end(); ++it) { @@ -3080,14 +3092,7 @@ namespace NLGUI paragraphChange (); - // clear the pointer to the current image download since all the button are deleted - LOG_DL("Clear pointers to %d curls", Curls.size()); - - // remove image refs from downloads - /*for(std::list::iterator it = Curls.begin(); it != Curls.end(); ++it) - { - it->imgs.clear(); - }*/ + releaseDataDownloads(); } // *************************************************************************** diff --git a/nel/src/gui/view_bitmap.cpp b/nel/src/gui/view_bitmap.cpp index 89c944a18..1896ced40 100644 --- a/nel/src/gui/view_bitmap.cpp +++ b/nel/src/gui/view_bitmap.cpp @@ -481,7 +481,13 @@ namespace NLGUI } else { - _HtmlDownload = NULL; + if (_HtmlDownload) + { + CGroupHTML *groupHtml = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:webig:content:html")); + if (groupHtml) + groupHtml->removeImageDownload(_HtmlDownload, dynamic_cast(this)); + _HtmlDownload = NULL; + } _TextureId.setTexture (TxName.c_str (), _TxtOffsetX, _TxtOffsetY, _TxtWidth, _TxtHeight, false); } }