From bff974cdb896adfe6773433ada50a451ecf96e76 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 7 Jun 2010 12:10:36 +0300 Subject: EXT-7406 FIXED extended find wearables of type functor to filter out links (panel outfit edit) extended find wearables of type functor to filter out links Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/522 --HG-- branch : product-engine --- indra/newview/llinventoryfunctions.h | 13 +++++++++++++ indra/newview/llpaneloutfitedit.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 33b52cfd5e..c82ebd1439 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -324,6 +324,19 @@ private: LLWearableType::EType mWearableType; }; +/** Filter out wearables-links */ +class LLFindActualWearablesOfType : public LLFindWearablesOfType +{ +public: + LLFindActualWearablesOfType(LLWearableType::EType type) : LLFindWearablesOfType(type) {} + virtual ~LLFindActualWearablesOfType() {} + virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + { + if (item && item->getIsLinkType()) return false; + return LLFindWearablesOfType::operator()(cat, item); + } +}; + // Find worn items. class LLFindWorn : public LLInventoryCollectFunctor { diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index ea7410502d..ce382541c6 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -280,7 +280,7 @@ BOOL LLPanelOutfitEdit::postBuild() childSetAction(REVERT_BTN, boost::bind(&LLAppearanceMgr::wearBaseOutfit, LLAppearanceMgr::getInstance())); mWearableListMaskCollector = new LLFindNonLinksByMask(ALL_ITEMS_MASK); - mWearableListTypeCollector = new LLFindWearablesOfType(LLWearableType::WT_NONE); + mWearableListTypeCollector = new LLFindActualWearablesOfType(LLWearableType::WT_NONE); mWearableItemsPanel = getChild("filtered_wearables_panel"); mWearableItemsList = getChild("filtered_wearables_list"); -- cgit v1.2.3 From 356e1d55cc4313ea229520e42bdfc14c3fc08b51 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 7 Jun 2010 12:15:23 +0300 Subject: EXT-7441 FIXED Improved condition to give up fetched inventory items in LLInventoryFetchItemsObserver Reason: LLInventoryFetchItemsObserver is used to fetch necessary gesture items. Its logic was based on count of "inventory changed" events. In case of there was too many requests stored item UUIDSs are be removed from queue by mistake - notification can be triggered because some other item is renamed. This issue can appear wherever LLInventoryFetchItemsObserver is used. Fix: improved logic to make decision to give up fetching items. For now it bases on period while waiting items to arrive from server and a number of attempts to repeate waiting. This is a constants of the LLInventoryFetchItemsObserver (10 times by 10 seconds) Tested with test case in JIRA (total count of inventory items - 13,888). Most likely that was a reason of inventory loss (EXT-7503). Reviewed by Brad Payne at https://codereview.productengine.com/secondlife/r/507/ --HG-- branch : product-engine --- indra/newview/llinventoryobserver.cpp | 54 ++++++++++++++++++++--------------- indra/newview/llinventoryobserver.h | 16 +++++++++++ 2 files changed, 47 insertions(+), 23 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index d2b402fe14..bd35259670 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -62,13 +62,9 @@ #include "llsdutil.h" #include -// If the viewer gets a notification, your observer assumes -// that that notification is for itself and then tries to process -// the results. The notification could be for something else (e.g. -// you're fetching an item and a notification gets triggered because -// you renamed some other item). This counter is to specify how many -// notification to wait for before giving up. -static const U32 MAX_NUM_NOTIFICATIONS_TO_PROCESS = 127; +const U32 LLInventoryFetchItemsObserver::MAX_NUM_ATTEMPTS_TO_PROCESS = 10; +const F32 LLInventoryFetchItemsObserver::FETCH_TIMER_EXPIRY = 10.0f; + LLInventoryObserver::LLInventoryObserver() { @@ -149,7 +145,7 @@ void LLInventoryCompletionObserver::watchItem(const LLUUID& id) LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const LLUUID& item_id) : LLInventoryFetchObserver(item_id), - mNumTries(MAX_NUM_NOTIFICATIONS_TO_PROCESS) + mNumTries(MAX_NUM_ATTEMPTS_TO_PROCESS) { mIDs.clear(); mIDs.push_back(item_id); @@ -158,35 +154,47 @@ LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const LLUUID& item_ LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids) : LLInventoryFetchObserver(item_ids), - mNumTries(MAX_NUM_NOTIFICATIONS_TO_PROCESS) + mNumTries(MAX_NUM_ATTEMPTS_TO_PROCESS) { } void LLInventoryFetchItemsObserver::changed(U32 mask) { - BOOL any_items_missing = FALSE; - // scan through the incomplete items and move or erase them as // appropriate. if (!mIncomplete.empty()) { + // if period of an attempt expired... + if (mFetchingPeriod.hasExpired()) + { + // ...reset timer and reduce count of attempts + mFetchingPeriod.reset(); + mFetchingPeriod.setTimerExpirySec(FETCH_TIMER_EXPIRY); + + --mNumTries; + + LL_INFOS("InventoryFetch") << "LLInventoryFetchItemsObserver: " << this << ", attempt(s) left: " << (S32)mNumTries << LL_ENDL; + } + + // do we still have any attempts? + bool timeout_expired = mNumTries <= 0; + for (uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); ) { const LLUUID& item_id = (*it); LLViewerInventoryItem* item = gInventory.getItem(item_id); if (!item) { - any_items_missing = TRUE; - if (mNumTries > 0) + if (timeout_expired) { - // Keep trying. - ++it; + // Just concede that this item hasn't arrived in reasonable time and continue on. + LL_WARNS("InventoryFetch") << "Fetcher timed out when fetching inventory item UUID: " << item_id << LL_ENDL; + it = mIncomplete.erase(it); } else { - // Just concede that this item hasn't arrived in reasonable time and continue on. - llwarns << "Fetcher timed out when fetching inventory item assetID:" << item_id << llendl; - it = mIncomplete.erase(it); + // Keep trying. + ++it; } continue; } @@ -198,14 +206,10 @@ void LLInventoryFetchItemsObserver::changed(U32 mask) } ++it; } - if (any_items_missing) - { - mNumTries--; - } if (mIncomplete.empty()) { - mNumTries = MAX_NUM_NOTIFICATIONS_TO_PROCESS; + mNumTries = MAX_NUM_ATTEMPTS_TO_PROCESS; done(); } } @@ -315,6 +319,10 @@ void LLInventoryFetchItemsObserver::startFetch() item_entry["item_id"] = (*it); items_llsd.append(item_entry); } + + mFetchingPeriod.resetWithExpiry(FETCH_TIMER_EXPIRY); + mNumTries = MAX_NUM_ATTEMPTS_TO_PROCESS; + fetch_items_from_llsd(items_llsd); } diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 6d5a86a6fc..72c13f55c6 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -110,6 +110,22 @@ public: /*virtual*/ void changed(U32 mask); private: S8 mNumTries; // Number of times changed() was called without success + LLFrameTimer mFetchingPeriod; + + /** + * If the viewer gets a notification, your observer assumes + * that that notification is for itself and then tries to process + * the results. The notification could be for something else (e.g. + * you're fetching an item and a notification gets triggered because + * you renamed some other item). This counter is to specify how many + * periods of time to wait for before giving up. + */ + static const U32 MAX_NUM_ATTEMPTS_TO_PROCESS; + + /** + * Period of waiting a notification when requested items get added into inventory. + */ + static const F32 FETCH_TIMER_EXPIRY; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3 From 6bbe55558f09026593d7c370fc27cf381dabb802 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Mon, 7 Jun 2010 12:56:29 +0300 Subject: EXT-7623 FIX One more place where text was processed into segments without LLLineBreakSegment. reviewed by Richard Nelson at https://codereview.productengine.com/secondlife/r/516/ --HG-- branch : product-engine --- indra/llui/llkeywords.cpp | 54 +++++++++++++++++++++++++++++++++++------------ indra/llui/llkeywords.h | 3 ++- indra/llui/lltextbase.cpp | 6 ++++++ indra/llui/lltextbase.h | 1 + 4 files changed, 49 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 75342afbe2..e9614ea660 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -339,6 +339,9 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW { if( *cur == '\n' ) { + LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(cur-base); + text_segment->setToken( 0 ); + insertSegment( *seg_list, text_segment, text_len, defaultColor, editor); cur++; if( !*cur || *cur == '\n' ) { @@ -378,9 +381,8 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW } S32 seg_end = cur - base; - LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_token->getColor(), seg_start, seg_end, editor ); - text_segment->setToken( cur_token ); - insertSegment( seg_list, text_segment, text_len, defaultColor, editor); + //create segments from seg_start to seg_end + insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, defaultColor, editor); line_done = TRUE; // to break out of second loop. break; } @@ -486,11 +488,12 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW seg_end = seg_start + between_delimiters + cur_delimiter->getLength(); } - + insertSegments(wtext, *seg_list,cur_delimiter, text_len, seg_start, seg_end, defaultColor, editor); + /* LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_delimiter->getColor(), seg_start, seg_end, editor ); text_segment->setToken( cur_delimiter ); insertSegment( seg_list, text_segment, text_len, defaultColor, editor); - + */ // Note: we don't increment cur, since the end of one delimited seg may be immediately // followed by the start of another one. continue; @@ -519,10 +522,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW // llinfos << "Seg: [" << word.c_str() << "]" << llendl; - - LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_token->getColor(), seg_start, seg_end, editor ); - text_segment->setToken( cur_token ); - insertSegment( seg_list, text_segment, text_len, defaultColor, editor); + insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, defaultColor, editor); } cur += seg_len; continue; @@ -537,24 +537,50 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW } } -void LLKeywords::insertSegment(std::vector* seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, LLTextEditor& editor ) +void LLKeywords::insertSegments(const LLWString& wtext, std::vector& seg_list, LLKeywordToken* cur_token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor ) +{ + std::string::size_type pos = wtext.find('\n',seg_start); + + while (pos!=-1 && pos < (std::string::size_type)seg_end) + { + if (pos!=seg_start) + { + LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_token->getColor(), seg_start, pos, editor ); + text_segment->setToken( cur_token ); + insertSegment( seg_list, text_segment, text_len, defaultColor, editor); + } + + LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(pos); + text_segment->setToken( cur_token ); + insertSegment( seg_list, text_segment, text_len, defaultColor, editor); + + seg_start = pos+1; + pos = wtext.find('\n',seg_start); + } + + LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_token->getColor(), seg_start, seg_end, editor ); + text_segment->setToken( cur_token ); + insertSegment( seg_list, text_segment, text_len, defaultColor, editor); +} + +void LLKeywords::insertSegment(std::vector& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, LLTextEditor& editor ) { - LLTextSegmentPtr last = seg_list->back(); + LLTextSegmentPtr last = seg_list.back(); S32 new_seg_end = new_segment->getEnd(); if( new_segment->getStart() == last->getStart() ) { - seg_list->pop_back(); + seg_list.pop_back(); } else { last->setEnd( new_segment->getStart() ); } - seg_list->push_back( new_segment ); + seg_list.push_back( new_segment ); if( new_seg_end < text_len ) { - seg_list->push_back( new LLNormalTextSegment( defaultColor, new_seg_end, text_len, editor ) ); + seg_list.push_back( new LLNormalTextSegment( defaultColor, new_seg_end, text_len, editor ) ); } } diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index e5b66dfa56..09378e408b 100644 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -129,7 +129,8 @@ public: private: LLColor3 readColor(const std::string& s); - void insertSegment(std::vector *seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor); + void insertSegment(std::vector& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor); + void insertSegments(const LLWString& wtext, std::vector& seg_list, LLKeywordToken* token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor); BOOL mLoaded; word_token_map_t mWordTokenMap; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 55dbf50fd7..54b252c035 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2748,6 +2748,12 @@ void LLInlineViewSegment::linkToDocument(LLTextBase* editor) editor->addDocumentChild(mView); } +LLLineBreakTextSegment::LLLineBreakTextSegment(S32 pos):LLTextSegment(pos,pos+1) +{ + LLStyleSP s( new LLStyle(LLStyle::Params().visible(true))); + + mFontHeight = llceil(s->getFont()->getLineHeight()); +} LLLineBreakTextSegment::LLLineBreakTextSegment(LLStyleConstSP style,S32 pos):LLTextSegment(pos,pos+1) { mFontHeight = llceil(style->getFont()->getLineHeight()); diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 176308c61a..89ce5cdc8e 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -519,6 +519,7 @@ class LLLineBreakTextSegment : public LLTextSegment public: LLLineBreakTextSegment(LLStyleConstSP style,S32 pos); + LLLineBreakTextSegment(S32 pos); ~LLLineBreakTextSegment(); bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const; -- cgit v1.2.3 From 8decaaa925532ea31c592aa3dbdd5f14e86797df Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 7 Jun 2010 13:50:50 +0300 Subject: EXT-7368 FIXED disabled using of accordion's "empty_accordion_text" in Friends List. This patch follows (23f0f13abc8b) and prevent to show two messages about empty Friends list. Reviewed by Vadim Savchuk. --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_people.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index b79ef1e287..da28773c74 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -173,6 +173,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M background_visible="true" bg_alpha_color="DkGray2" bg_opaque_color="DkGray2" + empty_accordion_text.value="" follows="all" height="356" layout="topleft" -- cgit v1.2.3 From b3aaafffa4bdfc0241401841fa85a03b2f66a651 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 7 Jun 2010 14:27:29 +0300 Subject: EXT-7629 FIXED removed redundant label xml attributes Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/520 --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/floater_im_session.xml | 1 - indra/newview/skins/default/xui/en/panel_outfit_edit.xml | 7 ------- 2 files changed, 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index f537c81860..c9b013099b 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -33,7 +33,6 @@ name="panel_im_control_panel" layout="topleft" follows="left" - label="IM Control Panel" min_width="115" auto_resize="false" user_resize="true" /> diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index 40f60d50fb..feee532320 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -5,7 +5,6 @@ border="false" height="600" follows="all" - label="Outfit Edit" layout="topleft" left="0" min_height="350" @@ -85,7 +84,6 @@ bevel_style="none" follows="top|left|right" height="40" - label="bottom_panel" layout="topleft" left="6" name="header_panel" @@ -106,7 +104,6 @@ bevel_style="none" follows="top|right" height="38" - label="bottom_panel" layout="topleft" left_pad="5" name="outfit_name_and_status" @@ -160,7 +157,6 @@ It is calculated as border_size + 2*UIResizeBarOverlap Date: Mon, 7 Jun 2010 17:04:28 +0300 Subject: EXT-7443 FIXED Speak button's layout updated - Reduced right padding by 2 px in main locale, remove horizontal align in 'de' locale. For now all locales have the same center aligning with right padding to ignore space under indicator. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/519/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/de/panel_bottomtray.xml | 2 +- indra/newview/skins/default/xui/en/panel_bottomtray.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/de/panel_bottomtray.xml b/indra/newview/skins/default/xui/de/panel_bottomtray.xml index d52b8dcf4d..83f67344ca 100644 --- a/indra/newview/skins/default/xui/de/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/de/panel_bottomtray.xml @@ -9,7 +9,7 @@ - + diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 82b2405ec9..4eff5bc48a 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -90,7 +90,7 @@ label="Speak" label_selected="Speak" name="speak_btn" - pad_right="22" + pad_right="20" tab_stop="true" use_ellipses="true" /> -- cgit v1.2.3