From fd846da06cbd1a62023de8e9c3ec61d40e8cd226 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Thu, 8 Oct 2009 01:48:50 +0000 Subject: only add LLScrollContainers to text widgets when requested, saving on LLTextBox construction time combined clip and scroll attributes of text editors and text boxes...if you want to clip text, you need to introduce a scrollbar moved clear to LLTextEditor so that text boxes won't empty out when calling LLPanel::clearCtrls() EXT-1354 - added optional wrapping to LLTooltips...inspector tooltips don't wrap, everything else does added LLFastTimer::reset call on application init to prime timers for pre-login timing fixed tooltips positioning incorrectly due to mis-sized tooltipview eliminated hide_scrollbar param for text editors reviewed by Leyla --- indra/llui/llsearcheditor.cpp | 6 +- indra/llui/lltextbase.cpp | 192 ++++++++++++++++++++++++------------------ indra/llui/lltextbase.h | 18 ++-- indra/llui/lltexteditor.cpp | 7 ++ indra/llui/lltexteditor.h | 1 + indra/llui/lltooltip.cpp | 2 + indra/llui/lltooltip.h | 1 + 7 files changed, 130 insertions(+), 97 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp index b87f645f3f..fad2b7bc99 100644 --- a/indra/llui/llsearcheditor.cpp +++ b/indra/llui/llsearcheditor.cpp @@ -37,9 +37,9 @@ #include "llsearcheditor.h" LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p) -: LLUICtrl(p) - , mSearchButton(NULL) - , mClearButton(NULL) +: LLUICtrl(p), + mSearchButton(NULL), + mClearButton(NULL) { S32 srch_btn_top = p.search_button.top_pad + p.search_button.rect.height; S32 srch_btn_right = p.search_button.rect.width + p.search_button.left_pad; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 3dacf979c7..123e59ae6a 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -122,17 +122,6 @@ struct LLTextBase::line_end_compare }; -////////////////////////////////////////////////////////////////////////// -// -// LLTextBase::DocumentPanel -// - - -LLTextBase::DocumentPanel::DocumentPanel(const Params& p) -: LLPanel(p) -{} - - ////////////////////////////////////////////////////////////////////////// // // LLTextBase @@ -157,8 +146,7 @@ LLTextBase::Params::Params() bg_readonly_color("bg_readonly_color"), bg_writeable_color("bg_writeable_color"), bg_focus_color("bg_focus_color"), - hide_scrollbar("hide_scrollbar"), - clip_to_rect("clip_to_rect", true), + allow_scroll("allow_scroll", true), track_end("track_end", false), read_only("read_only", false), v_pad("v_pad", 0), @@ -205,35 +193,44 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mSelectionStart( 0 ), mSelectionEnd( 0 ), mIsSelecting( FALSE ), - mClip(p.clip_to_rect), mWordWrap(p.wrap), mUseEllipses( p.use_ellipses ), mParseHTML(p.allow_html), mParseHighlights(p.parse_highlights), - mHideScrollbar(p.hide_scrollbar) -{ - LLScrollContainer::Params scroll_params; - scroll_params.name = "text scroller"; - scroll_params.rect = getLocalRect(); - scroll_params.follows.flags = FOLLOWS_ALL; - scroll_params.is_opaque = false; - scroll_params.mouse_opaque = false; - scroll_params.min_auto_scroll_rate = 200; - scroll_params.max_auto_scroll_rate = 800; - scroll_params.hide_scrollbar = p.hide_scrollbar; - scroll_params.border_visible = p.border_visible; - mScroller = LLUICtrlFactory::create(scroll_params); - addChild(mScroller); - - LLPanel::Params panel_params; - panel_params.name = "text_contents"; - panel_params.rect = LLRect(0, 500, 500, 0); - panel_params.background_visible = p.bg_visible; - panel_params.background_opaque = true; - panel_params.mouse_opaque = false; - - mDocumentPanel = LLUICtrlFactory::create(panel_params); - mScroller->addChild(mDocumentPanel); + mBGVisible(p.bg_visible), + mScroller(NULL) +{ + if(p.allow_scroll) + { + LLScrollContainer::Params scroll_params; + scroll_params.name = "text scroller"; + scroll_params.rect = getLocalRect(); + scroll_params.follows.flags = FOLLOWS_ALL; + scroll_params.is_opaque = false; + scroll_params.mouse_opaque = false; + scroll_params.min_auto_scroll_rate = 200; + scroll_params.max_auto_scroll_rate = 800; + // all text widgets only show scrollbar on demand + scroll_params.hide_scrollbar = true; + scroll_params.border_visible = p.border_visible; + mScroller = LLUICtrlFactory::create(scroll_params); + addChild(mScroller); + } + + LLView::Params view_params; + view_params.name = "text_contents"; + view_params.rect = LLRect(0, 500, 500, 0); + view_params.mouse_opaque = false; + + mDocumentView = LLUICtrlFactory::create(view_params); + if (mScroller) + { + mScroller->addChild(mDocumentView); + } + else + { + addChild(mDocumentView); + } createDefaultSegment(); @@ -314,7 +311,7 @@ void LLTextBase::drawSelectionBackground() LLRect selection_rect = mTextRect; // Skip through the lines we aren't drawing. - LLRect content_display_rect = mScroller->getVisibleContentRect(); + LLRect content_display_rect = getVisibleDocumentRect(); // binary search for line that starts before top of visible buffer line_list_t::const_iterator line_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), content_display_rect.mTop, compare_bottom()); @@ -496,8 +493,7 @@ void LLTextBase::drawText() selection_right = llmax( mSelectionStart, mSelectionEnd ); } - LLRect scrolled_view_rect = mScroller->getVisibleContentRect(); - LLRect content_rect = mScroller->getContentWindowRect(); + LLRect scrolled_view_rect = getVisibleDocumentRect(); std::pair line_range = getVisibleLines(); S32 first_line = line_range.first; S32 last_line = line_range.second; @@ -540,7 +536,7 @@ void LLTextBase::drawText() LLRect text_rect(line.mRect.mLeft + mTextRect.mLeft - scrolled_view_rect.mLeft, line.mRect.mTop - scrolled_view_rect.mBottom + mTextRect.mBottom, - mDocumentPanel->getRect().getWidth() - scrolled_view_rect.mLeft, + mDocumentView->getRect().getWidth() - scrolled_view_rect.mLeft, line.mRect.mBottom - scrolled_view_rect.mBottom + mTextRect.mBottom); // draw a single line of text @@ -645,6 +641,7 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s } onValueChange(pos, pos + insert_len); + needsReflow(); return insert_len; } @@ -704,6 +701,7 @@ S32 LLTextBase::removeStringNoUndo(S32 pos, S32 length) createDefaultSegment(); onValueChange(pos, pos); + needsReflow(); return -length; // This will be wrong if someone calls removeStringNoUndo with an excessive length } @@ -719,6 +717,7 @@ S32 LLTextBase::overwriteCharNoUndo(S32 pos, llwchar wc) getViewModel()->setDisplay(text); onValueChange(pos, pos + 1); + needsReflow(); return 1; } @@ -949,29 +948,31 @@ void LLTextBase::draw() // then update scroll position, as cursor may have moved updateScrollFromCursor(); - LLColor4 bg_color = mReadOnly - ? mReadOnlyBgColor.get() - : hasFocus() - ? mFocusBgColor.get() - : mWriteableBgColor.get(); + if (mBGVisible) + { + // clip background rect against extents, if we support scrolling + LLLocalClipRect clip(getLocalRect(), mScroller != NULL); - mDocumentPanel->setBackgroundColor(bg_color); + LLColor4 bg_color = mReadOnly + ? mReadOnlyBgColor.get() + : hasFocus() + ? mFocusBgColor.get() + : mWriteableBgColor.get(); + gl_rect_2d(mDocumentView->getRect(), bg_color, TRUE); + } + // draw document view LLUICtrl::draw(); + { - LLLocalClipRect clip(mTextRect, mClip); + // only clip if we support scrolling (mScroller != NULL) + LLLocalClipRect clip(mTextRect, mScroller != NULL); drawSelectionBackground(); drawText(); drawCursor(); } } -//virtual -void LLTextBase::clear() -{ - getViewModel()->setDisplay(LLWStringUtil::null); - clearSegments(); -} //virtual void LLTextBase::setColor( const LLColor4& c ) @@ -1000,14 +1001,14 @@ void LLTextBase::updateScrollFromCursor() // Update scroll position even in read-only mode (when there's no cursor displayed) // because startOfDoc()/endOfDoc() modify cursor position. See EXT-736. - if (!mScrollNeeded) + if (!mScrollNeeded || !mScroller) { return; } mScrollNeeded = FALSE; // scroll so that the cursor is at the top of the page - LLRect scroller_doc_window = mScroller->getVisibleContentRect(); + LLRect scroller_doc_window = getVisibleDocumentRect(); LLRect cursor_rect_doc = getLocalRectFromDocIndex(mCursorPos); cursor_rect_doc.translate(scroller_doc_window.mLeft, scroller_doc_window.mBottom); mScroller->scrollToShowRect(cursor_rect_doc, LLRect(0, scroller_doc_window.getHeight() - 5, scroller_doc_window.getWidth(), 5)); @@ -1042,7 +1043,7 @@ void LLTextBase::reflow(S32 start_index) { mReflowNeeded = FALSE; - bool scrolled_to_bottom = mScroller->isAtBottom(); + bool scrolled_to_bottom = mScroller ? mScroller->isAtBottom() : false; LLRect old_cursor_rect = getLocalRectFromDocIndex(mCursorPos); bool follow_selection = mTextRect.overlaps(old_cursor_rect); // cursor is visible @@ -1183,17 +1184,29 @@ void LLTextBase::reflow(S32 start_index) mContentsRect.stretch(1); } - // change mDocumentPanel document size to accomodate reflowed text + // change mDocumentView size to accomodate reflowed text LLRect document_rect; - document_rect.setOriginAndSize(1, 1, - mScroller->getContentWindowRect().getWidth(), - llmax(mScroller->getContentWindowRect().getHeight(), mContentsRect.getHeight())); - mDocumentPanel->setShape(document_rect); + if (mScroller) + { + // document is size of scroller or size of text contents, whichever is larger + document_rect.setOriginAndSize(0, 0, + mScroller->getContentWindowRect().getWidth(), + llmax(mScroller->getContentWindowRect().getHeight(), mContentsRect.getHeight())); + } + else + { + // document size is just extents of reflowed text, reset to origin 0,0 + document_rect.set(0, + getLocalRect().getHeight(), + getLocalRect().getWidth(), + llmin(0, getLocalRect().getHeight() - mContentsRect.getHeight())); + } + mDocumentView->setShape(document_rect); // after making document big enough to hold all the text, move the text to fit in the document if (!mLineInfoList.empty()) { - S32 delta_pos = mDocumentPanel->getRect().getHeight() - mLineInfoList.begin()->mRect.mTop - mVPad; + S32 delta_pos = mDocumentView->getRect().getHeight() - mLineInfoList.begin()->mRect.mTop - mVPad; // move line segments to fit new document rect for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it) { @@ -1215,9 +1228,9 @@ void LLTextBase::reflow(S32 start_index) } // apply scroll constraints after reflowing text - if (!hasMouseCapture()) + if (!hasMouseCapture() && mScroller) { - LLRect visible_content_rect = mScroller->getVisibleContentRect(); + LLRect visible_content_rect = getVisibleDocumentRect(); if (scrolled_to_bottom && mTrackEnd) { // keep bottom of text buffer visible @@ -1329,7 +1342,7 @@ S32 LLTextBase::getLineOffsetFromDocIndex( S32 startpos, bool include_wordwrap) S32 LLTextBase::getFirstVisibleLine() const { - LLRect visible_region = mScroller->getVisibleContentRect(); + LLRect visible_region = getVisibleDocumentRect(); // binary search for line that starts before top of visible buffer line_list_t::const_iterator iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mTop, compare_bottom()); @@ -1339,7 +1352,7 @@ S32 LLTextBase::getFirstVisibleLine() const std::pair LLTextBase::getVisibleLines(bool fully_visible) { - LLRect visible_region = mScroller->getVisibleContentRect(); + LLRect visible_region = getVisibleDocumentRect(); line_list_t::const_iterator first_iter; line_list_t::const_iterator last_iter; @@ -1370,12 +1383,12 @@ LLTextViewModel* LLTextBase::getViewModel() const void LLTextBase::addDocumentChild(LLView* view) { - mDocumentPanel->addChild(view); + mDocumentView->addChild(view); } void LLTextBase::removeDocumentChild(LLView* view) { - mDocumentPanel->removeChild(view); + mDocumentView->removeChild(view); } @@ -1481,11 +1494,10 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) void LLTextBase::setText(const LLStringExplicit &utf8str) { // clear out the existing text and segments - clear(); - - truncate(); + getViewModel()->setDisplay(LLWStringUtil::null); - createDefaultSegment(); + clearSegments(); +// createDefaultSegment(); startOfDoc(); deselect(); @@ -1496,10 +1508,9 @@ void LLTextBase::setText(const LLStringExplicit &utf8str) appendText(text, false); - needsReflow(); - //resetDirty(); onValueChange(0, getLength()); + needsReflow(); } //virtual @@ -1767,7 +1778,7 @@ LLWString LLTextBase::getWText() const S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const { // Figure out which line we're nearest to. - LLRect visible_region = mScroller->getVisibleContentRect(); + LLRect visible_region = getVisibleDocumentRect(); // binary search for line that starts before local_y line_list_t::const_iterator line_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), local_y - mTextRect.mBottom + visible_region.mBottom, compare_bottom()); @@ -1838,7 +1849,7 @@ LLRect LLTextBase::getLocalRectFromDocIndex(S32 pos) const // find line that contains cursor line_list_t::const_iterator line_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), pos, line_end_compare()); - LLRect scrolled_view_rect = mScroller->getVisibleContentRect(); + LLRect scrolled_view_rect = getVisibleDocumentRect(); local_rect.mLeft = mTextRect.mLeft - scrolled_view_rect.mLeft + line_iter->mRect.mLeft; local_rect.mBottom = mTextRect.mBottom + (line_iter->mRect.mBottom - scrolled_view_rect.mBottom); local_rect.mTop = mTextRect.mBottom + (line_iter->mRect.mTop - scrolled_view_rect.mBottom); @@ -1917,7 +1928,7 @@ void LLTextBase::endOfDoc() void LLTextBase::changePage( S32 delta ) { const S32 PIXEL_OVERLAP_ON_PAGE_CHANGE = 10; - if (delta == 0) return; + if (delta == 0 || !mScroller) return; LLRect cursor_rect = getLocalRectFromDocIndex(mCursorPos); @@ -1970,7 +1981,7 @@ void LLTextBase::changeLine( S32 delta ) new_line = line + 1; } - LLRect visible_region = mScroller->getVisibleContentRect(); + LLRect visible_region = getVisibleDocumentRect(); S32 new_cursor_pos = getDocIndexFromLocalCoord(mDesiredXPixel, mLineInfoList[new_line].mRect.mBottom + mTextRect.mBottom - visible_region.mBottom, TRUE); setCursorPos(new_cursor_pos, true); @@ -2047,7 +2058,7 @@ S32 LLTextBase::getEditableIndex(S32 index, bool increasing_direction) void LLTextBase::updateTextRect() { LLRect old_text_rect = mTextRect; - mTextRect = mScroller->getContentWindowRect(); + mTextRect = mScroller ? mScroller->getContentWindowRect() : getLocalRect(); //FIXME: replace border with image? if (mBorderVisible) { @@ -2081,6 +2092,22 @@ void LLTextBase::endSelection() } } +// get portion of document that is visible in text editor +LLRect LLTextBase::getVisibleDocumentRect() const +{ + if (mScroller) + { + return mScroller->getVisibleContentRect(); + } + else + { + // entire document rect when not scrolling + LLRect doc_rect = mDocumentView->getLocalRect(); + doc_rect.translate(-mDocumentView->getRect().mLeft, -mDocumentView->getRect().mBottom); + return doc_rect; + } +} + // // LLTextSegment // @@ -2150,6 +2177,7 @@ F32 LLNormalTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selec { if ( mStyle->isImage() && (start >= 0) && (end <= mEnd - mStart)) { + LLColor4 color = LLColor4::white % mEditor.getDrawContext().mAlpha; LLUIImagePtr image = mStyle->getImage(); S32 style_image_height = image->getHeight(); S32 style_image_width = image->getWidth(); @@ -2398,7 +2426,7 @@ S32 LLInlineViewSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin void LLInlineViewSegment::updateLayout(const LLTextBase& editor) { LLRect start_rect = editor.getLocalRectFromDocIndex(mStart); - LLRect doc_rect = editor.getDocumentPanel()->getRect(); + LLRect doc_rect = editor.getDocumentView()->getRect(); mView->setOrigin(doc_rect.mLeft + start_rect.mLeft, doc_rect.mBottom + start_rect.mBottom); } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index f20134fd6d..903396c78a 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -80,8 +80,7 @@ public: border_visible, track_end, read_only, - hide_scrollbar, - clip_to_rect, + allow_scroll, wrap, use_ellipses, allow_html, @@ -118,7 +117,6 @@ public: // LLUICtrl interface /*virtual*/ BOOL acceptsTextInput() const { return !mReadOnly; } - /*virtual*/ void clear(); /*virtual*/ void setColor( const LLColor4& c ); /*virtual*/ void setValue(const LLSD& value ); /*virtual*/ LLTextViewModel* getViewModel() const; @@ -149,16 +147,13 @@ public: S32 getLength() const { return getWText().length(); } S32 getLineCount() const { return mLineInfoList.size(); } - class DocumentPanel : public LLPanel - { - public: - DocumentPanel(const Params&); - }; void addDocumentChild(LLView* view); void removeDocumentChild(LLView* view); - const DocumentPanel* getDocumentPanel() const { return mDocumentPanel; } + const LLView* getDocumentView() const { return mDocumentView; } LLRect getTextRect() { return mTextRect; } LLRect getContentsRect(); + LLRect getVisibleDocumentRect() const; + S32 getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const; LLRect getLocalRectFromDocIndex(S32 pos) const; @@ -344,13 +339,12 @@ protected: bool mUseEllipses; bool mTrackEnd; // if true, keeps scroll position at end of document during resize bool mReadOnly; - bool mClip; - bool mHideScrollbar; + bool mBGVisible; // render background? S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes // support widgets LLContextMenu* mPopupMenu; - DocumentPanel* mDocumentPanel; + LLView* mDocumentView; class LLScrollContainer* mScroller; // transient state diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 997c5b8fa8..74373e7803 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2916,3 +2916,10 @@ void LLTextEditor::onKeyStroke() { mKeystrokeSignal(this); } + +//virtual +void LLTextEditor::clear() +{ + getViewModel()->setDisplay(LLWStringUtil::null); + clearSegments(); +} diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 0e5707a3a6..e232efbfb3 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -116,6 +116,7 @@ public: virtual void setEnabled(BOOL enabled); // uictrl overrides + virtual void clear(); virtual void setFocus( BOOL b ); virtual BOOL isDirty() const; diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index c55273cacf..f30e56b907 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -147,6 +147,7 @@ static LLDefaultChildRegistry::Register r("tool_tip"); LLToolTip::Params::Params() : max_width("max_width", 200), padding("padding", 4), + wrap("wrap", true), pos("pos"), message("message"), delay_time("delay_time", LLUI::sSettingGroups["config"]->getF32( "ToolTipDelay" )), @@ -181,6 +182,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) params.bg_visible = false; params.font = p.font; params.use_ellipses = true; + params.wrap = p.wrap; mTextBox = LLUICtrlFactory::create (params); addChild(mTextBox); diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 6715da1611..63e7249a12 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -83,6 +83,7 @@ public: Optional image; Optional max_width; Optional padding; + Optional wrap; Params(); }; -- cgit v1.3 From 4c89e7389383e2943334ad8ec185b8935cbe7db8 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Thu, 8 Oct 2009 22:39:17 +0000 Subject: Fixed a problem where floaters that failed to load their XML would still be opened. This was particularly a problem with Modal Dialogs since the UI would loose focus with no floater to respond to. Reviewed by Leyla --- indra/llui/llfloater.cpp | 6 ++++-- indra/llui/llfloater.h | 2 +- indra/llui/llfloaterreg.cpp | 9 +++++++-- indra/llui/lluictrlfactory.cpp | 16 ++++++++++------ indra/llui/lluictrlfactory.h | 2 +- 5 files changed, 23 insertions(+), 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index b7a15a2b33..51e2b5dea4 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2564,10 +2564,10 @@ void LLFloater::initFromParams(const LLFloater::Params& p) LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build"); -void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) +bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { Params params(LLUICtrlFactory::getDefaultParams()); - LLXUIParser::instance().readXUI(node, params); + LLXUIParser::instance().readXUI(node, params); // *TODO: Error checking if (output_node) { @@ -2613,5 +2613,7 @@ void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o gFloaterView->adjustToFitScreen(this, FALSE); // Floaters loaded from XML should all fit on screen moveResizeHandlesToFront(); + + return true; // *TODO: Error checking } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 17ffc94014..7a6c3f6863 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -144,7 +144,7 @@ public: static void setupParamsForExport(Params& p, LLView* parent); void initFromParams(const LLFloater::Params& p); - void initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL); + bool initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL); /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); /*virtual*/ BOOL canSnapTo(const LLView* other_view); diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index a63b1b085c..815260dff3 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -121,8 +121,13 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) res = build_func(key); - LLUICtrlFactory::getInstance()->buildFloater(res, xui_file, NULL); - + bool success = LLUICtrlFactory::getInstance()->buildFloater(res, xui_file, NULL); + if (!success) + { + llwarns << "Failed to buid floater type: '" << name << "'." << llendl; + return NULL; + } + // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe res->mKey = key; res->setInstanceName(name); diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 4ce6677294..209ee76940 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -170,7 +170,7 @@ static LLFastTimer::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters"); //----------------------------------------------------------------------------- // buildFloater() //----------------------------------------------------------------------------- -void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filename, LLXMLNodePtr output_node) +bool LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filename, LLXMLNodePtr output_node) { LLFastTimer timer(FTM_BUILD_FLOATERS); LLXMLNodePtr root; @@ -182,22 +182,24 @@ void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filen if (!LLUICtrlFactory::getLocalizedXMLNode(filename, root)) { llwarns << "Couldn't parse floater from: " << LLUI::getLocalizedSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl; - return; + return false; } } else if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) { llwarns << "Couldn't parse floater from: " << LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl; - return; + return false; } // root must be called floater if( !(root->hasName("floater") || root->hasName("multi_floater")) ) { llwarns << "Root node should be named floater in: " << filename << llendl; - return; + return false; } - + + bool res = true; + lldebugs << "Building floater " << filename << llendl; mFileNames.push_back(gDirUtilp->findSkinnedFilename(LLUI::getSkinPath(), filename)); { @@ -210,7 +212,7 @@ void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filen floaterp->getCommitCallbackRegistrar().pushScope(); floaterp->getEnableCallbackRegistrar().pushScope(); - floaterp->initFloaterXML(root, floaterp->getParent(), output_node); + res = floaterp->initFloaterXML(root, floaterp->getParent(), output_node); floaterp->setXMLFilename(filename); @@ -223,6 +225,8 @@ void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filen } } mFileNames.pop_back(); + + return res; } //----------------------------------------------------------------------------- diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 3c77c655b8..5e6dad312c 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -157,7 +157,7 @@ public: return ParamDefaults::instance().get(); } - void buildFloater(LLFloater* floaterp, const std::string &filename, LLXMLNodePtr output_node); + bool buildFloater(LLFloater* floaterp, const std::string &filename, LLXMLNodePtr output_node); BOOL buildPanel(LLPanel* panelp, const std::string &filename, LLXMLNodePtr output_node = NULL); // Does what you want for LLFloaters and LLPanels -- cgit v1.3 From 3bd6c1919cc3a142a112278a6dc83bd8292bcb5a Mon Sep 17 00:00:00 2001 From: Bradley Payne Date: Mon, 12 Oct 2009 18:40:11 +0000 Subject: Merging avatar-pipeline/currently-worn-folder-10 down to viewer-2. svn merge -r 134766:135946 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/currently-worn-folder-10 . --- indra/llui/llscrolllistctrl.cpp | 3 +- indra/llui/llscrolllistitem.h | 4 ++ indra/newview/llagentwearables.cpp | 75 ++++++++++++++++++++++--------------- indra/newview/llagentwearables.h | 21 ++++++----- indra/newview/llappearancemgr.cpp | 53 +++++++++++++++++++++++--- indra/newview/llappearancemgr.h | 3 ++ indra/newview/llfolderviewitem.cpp | 11 ++++++ indra/newview/llinventorybridge.cpp | 2 +- indra/newview/llvoavatar.cpp | 2 + indra/newview/llvoavatarself.cpp | 2 + indra/newview/llwearable.h | 4 +- 11 files changed, 131 insertions(+), 49 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 7b74b1f93b..a6cd6412e5 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1411,6 +1411,7 @@ void LLScrollListCtrl::drawItems() cur_y, mItemListRect.getWidth(), mLineHeight ); + item->setRect(item_rect); //llinfos << item_rect.getWidth() << llendl; @@ -1708,7 +1709,7 @@ BOOL LLScrollListCtrl::handleMouseDown(S32 x, S32 y, MASK mask) } BOOL LLScrollListCtrl::handleMouseUp(S32 x, S32 y, MASK mask) -{ +{ if (hasMouseCapture()) { // release mouse capture immediately so diff --git a/indra/llui/llscrolllistitem.h b/indra/llui/llscrolllistitem.h index 0ec7fbcc2c..15b86cc945 100644 --- a/indra/llui/llscrolllistitem.h +++ b/indra/llui/llscrolllistitem.h @@ -97,6 +97,9 @@ public: LLUUID getUUID() const { return mItemValue.asUUID(); } LLSD getValue() const { return mItemValue; } + + void setRect(LLRect rect) { mRectangle = rect; } + LLRect getRect() const { return mRectangle; } void addColumn( const LLScrollListCell::Params& p ); @@ -122,6 +125,7 @@ private: void* mUserdata; LLSD mItemValue; std::vector mColumns; + LLRect mRectangle; }; #endif diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 50d378335e..2cfa8d2a54 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -563,16 +563,32 @@ LLInventoryItem* LLAgentWearables::getWearableInventoryItem(EWearableType type, return item; } -const LLWearable* LLAgentWearables::getWearableFromWearableItem(const LLUUID& item_id) const +const LLWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& item_id) const { for (S32 i=0; i < WT_COUNT; i++) { for (U32 j=0; j < getWearableCount((EWearableType)i); j++) { - LLUUID curr_item_id = getWearableItemID((EWearableType)i, j); - if (curr_item_id == item_id) + const LLWearable * curr_wearable = getWearable((EWearableType)i, j); + if (curr_wearable && (curr_wearable->getItemID() == item_id)) { - return getWearable((EWearableType)i, j); + return curr_wearable; + } + } + } + return NULL; +} + +const LLWearable* LLAgentWearables::getWearableFromAssetID(const LLUUID& asset_id) const +{ + for (S32 i=0; i < WT_COUNT; i++) + { + for (U32 j=0; j < getWearableCount((EWearableType)i); j++) + { + const LLWearable * curr_wearable = getWearable((EWearableType)i, j); + if (curr_wearable && (curr_wearable->getAssetID() == asset_id)) + { + return curr_wearable; } } } @@ -683,10 +699,19 @@ const LLUUID LLAgentWearables::getWearableItemID(EWearableType type, U32 index) return LLUUID(); } +const LLUUID LLAgentWearables::getWearableAssetID(EWearableType type, U32 index) const +{ + const LLWearable *wearable = getWearable(type,index); + if (wearable) + return wearable->getAssetID(); + else + return LLUUID(); +} + // Warning: include_linked_items = TRUE makes this operation expensive. BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id, BOOL include_linked_items) const { - if (getWearableFromWearableItem(item_id) != NULL) return TRUE; + if (getWearableFromItemID(item_id) != NULL) return TRUE; if (include_linked_items) { LLInventoryModel::item_array_t item_array; @@ -696,8 +721,8 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id, BOOL include_linked_ iter++) { LLViewerInventoryItem *linked_item = (*iter); - const LLUUID &item_id = linked_item->getUUID(); - if (getWearableFromWearableItem(item_id) != NULL) return TRUE; + const LLUUID &linked_item_id = linked_item->getUUID(); + if (getWearableFromItemID(linked_item_id) != NULL) return TRUE; } } return FALSE; @@ -1152,26 +1177,6 @@ LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name) return LLUUID::null; } - LLDynamicArray wearables_to_include; - getAllWearablesArray(wearables_to_include); - - LLDynamicArray attachments_to_include; - mAvatarObject->getAllAttachmentsArray(attachments_to_include); - - return makeNewOutfitLinks(new_folder_name, wearables_to_include, attachments_to_include); -} - -// Note: wearables_to_include should be a list of EWearableType types -// attachments_to_include should be a list of attachment points -LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name, - const LLDynamicArray& wearables_to_include, - const LLDynamicArray& attachments_to_include) -{ - if (mAvatarObject.isNull()) - { - return LLUUID::null; - } - // First, make a folder in the My Outfits directory. LLUUID parent_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_MY_OUTFITS); LLUUID folder_id = gInventory.createNewCategory( @@ -1180,8 +1185,8 @@ LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name, new_folder_name); LLAppearanceManager::shallowCopyCategory(LLAppearanceManager::getCOF(),folder_id, NULL); - -#if 0 + +#if 0 // BAP - fix to go into rename state automatically after outfit is created. LLViewerInventoryCategory *parent_category = gInventory.getCategory(parent_id); if (parent_category) { @@ -1839,7 +1844,7 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra msg->nextBlockFast(_PREHASH_HeaderData); msg->addUUIDFast(_PREHASH_CompoundMsgID, compound_msg_id ); msg->addU8Fast(_PREHASH_TotalObjects, obj_count ); - msg->addBOOLFast(_PREHASH_FirstDetachAll, true ); // BAP changing this doesn't seem to matter? + msg->addBOOLFast(_PREHASH_FirstDetachAll, false ); } const LLInventoryItem* item = obj_item_array.get(i).get(); @@ -1882,6 +1887,16 @@ void LLAgentWearables::updateWearablesLoaded() mWearablesLoaded = (itemUpdatePendingCount()==0); } +bool LLAgentWearables::canWearableBeRemoved(const LLWearable* wearable) const +{ + if (!wearable) return false; + + EWearableType type = wearable->getType(); + // Make sure the user always has at least one shape, skin, eyes, and hair type currently worn. + return !(((type == WT_SHAPE) || (type == WT_SKIN) || (type == WT_HAIR) || (type == WT_EYES)) + && (getWearableCount(type) <= 1) ); +} + void LLAgentWearables::updateServer() { sendAgentWearablesUpdate(); diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 701ce7f05a..8b9d29342a 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -75,20 +75,25 @@ public: BOOL areWearablesLoaded() const; void updateWearablesLoaded(); void checkWearablesLoaded() const; + + // Note: False for shape, skin, eyes, and hair, unless you have MORE than 1. + bool canWearableBeRemoved(const LLWearable* wearable) const; //-------------------------------------------------------------------- // Accessors //-------------------------------------------------------------------- public: - const LLUUID getWearableItemID(EWearableType type, U32 index /*= 0*/) const; - const LLWearable* getWearableFromWearableItem(const LLUUID& item_id) const; - LLInventoryItem* getWearableInventoryItem(EWearableType type, U32 index /*= 0*/); + const LLUUID getWearableItemID(EWearableType type, U32 index /*= 0*/) const; + const LLUUID getWearableAssetID(EWearableType type, U32 index /*= 0*/) const; + const LLWearable* getWearableFromItemID(const LLUUID& item_id) const; + const LLWearable* getWearableFromAssetID(const LLUUID& asset_id) const; + LLInventoryItem* getWearableInventoryItem(EWearableType type, U32 index /*= 0*/); // MULTI-WEARABLE: assuming one per type. - static BOOL selfHasWearable(EWearableType type); - LLWearable* getWearable(const EWearableType type, U32 index /*= 0*/); + static BOOL selfHasWearable(EWearableType type); + LLWearable* getWearable(const EWearableType type, U32 index /*= 0*/); const LLWearable* getWearable(const EWearableType type, U32 index /*= 0*/) const; - U32 getWearableCount(const EWearableType type) const; + U32 getWearableCount(const EWearableType type) const; //-------------------------------------------------------------------- @@ -159,9 +164,7 @@ public: // Note: wearables_to_include should be a list of EWearableType types // attachments_to_include should be a list of attachment points LLUUID makeNewOutfitLinks(const std::string& new_folder_name); - LLUUID makeNewOutfitLinks(const std::string& new_folder_name, - const LLDynamicArray& wearables_to_include, - const LLDynamicArray& attachments_to_include); + private: void makeNewOutfitDone(S32 type, U32 index); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 3831846e2e..cf8d852dfe 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -165,6 +165,8 @@ void LLOutfitObserver::done() cb); } } + // BAP fixes a lag in display of created dir. + gInventory.notifyObservers(); } else { @@ -495,11 +497,16 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory } else if (item->getActualType() == LLAssetType::AT_LINK_FOLDER) { - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - dst_id, - item->getName(), - LLAssetType::AT_LINK_FOLDER, cb); + LLViewerInventoryCategory *catp = item->getLinkedCategory(); + // Skip copying outfit links. + if (catp && catp->getPreferredType() != LLAssetType::AT_OUTFIT) + { + link_inventory_item(gAgent.getID(), + item->getLinkedUUID(), + dst_id, + item->getName(), + LLAssetType::AT_LINK_FOLDER, cb); + } } else { @@ -519,6 +526,9 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory { lldebugs << "rebuildCOFFromOutfit()" << llendl; + dumpCat(category,"start, source outfit"); + dumpCat(getCOF(),"start, COF"); + // Find all the wearables that are in the category's subtree. LLInventoryModel::item_array_t items; getCOFValidDescendents(category, items); @@ -538,6 +548,8 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory gInventory.collectDescendents(current_outfit_id, cof_cats, cof_items, LLInventoryModel::EXCLUDE_TRASH); + //dumpCat(current_outfit_id,"COF before remove:"); + if (items.count() > 0) { for (S32 i = 0; i < cof_items.count(); ++i) @@ -547,15 +559,19 @@ void removeDuplicateItems(LLInventoryModel::item_array_t& dst, const LLInventory gInventory.notifyObservers(); } + //dumpCat(current_outfit_id,"COF after remove:"); + LLPointer link_waiter = new LLUpdateAppearanceOnDestroy; LLAppearanceManager::shallowCopyCategory(category, current_outfit_id, link_waiter); + //dumpCat(current_outfit_id,"COF after shallow copy:"); + // Create a link to the outfit that we wore. LLViewerInventoryCategory* catp = gInventory.getCategory(category); if (catp && catp->getPreferredType() == LLAssetType::AT_OUTFIT) { link_inventory_item(gAgent.getID(), category, current_outfit_id, catp->getName(), - LLAssetType::AT_LINK_FOLDER, LLPointer(NULL)); + LLAssetType::AT_LINK_FOLDER, link_waiter); } } @@ -628,6 +644,8 @@ void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder, /* static */ void LLAppearanceManager::updateAppearanceFromCOF() { + dumpCat(getCOF(),"COF, start"); + bool follow_folder_links = true; LLUUID current_outfit_id = getCOF(); @@ -921,3 +939,26 @@ void LLAppearanceManager::removeItemLinks(LLUUID& item_id, bool do_update) LLAppearanceManager::updateAppearanceFromCOF(); } } + +/* static */ +void LLAppearanceManager::dumpCat(const LLUUID& cat_id, std::string str) +{ + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH); + +#if 0 + llinfos << llendl; + llinfos << str << llendl; + S32 hitcount = 0; + for(S32 i=0; igetName() <getItemID()); if (item) { + LLAppearanceManager::dumpCat(LLAppearanceManager::getCOF(),"Adding attachment link:"); LLAppearanceManager::wearItem(item,false); // Add COF link for item. + } gInventory.addChangedMask(LLInventoryObserver::LABEL, attachment->getItemID()); gInventory.notifyObservers(); diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h index 5f0b235c7f..d7b4d3f91e 100644 --- a/indra/newview/llwearable.h +++ b/indra/newview/llwearable.h @@ -62,6 +62,7 @@ public: // Accessors //-------------------------------------------------------------------- public: + const LLUUID& getItemID() const; const LLAssetID& getAssetID() const { return mAssetID; } const LLTransactionID& getTransactionID() const { return mTransactionID; } EWearableType getType() const { return mType; } @@ -77,6 +78,7 @@ public: const std::string& getTypeLabel() const; const std::string& getTypeName() const; LLAssetType::EType getAssetType() const; + LLLocalTextureObject* getLocalTextureObject(S32 index) const; public: BOOL isDirty() const; @@ -102,8 +104,6 @@ public: friend std::ostream& operator<<(std::ostream &s, const LLWearable &w); void setItemID(const LLUUID& item_id); - const LLUUID& getItemID() const; - LLLocalTextureObject* getLocalTextureObject(S32 index) const; void setLocalTextureObject(S32 index, LLLocalTextureObject *lto); private: -- cgit v1.3 From 20e56a6925b4d4106059a73a22170beb5a38be1e Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 13 Oct 2009 16:25:48 +0000 Subject: merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1992 https://svn.aws.productengine.com/secondlife/pe/stable-2@2004 -> viewer-2.0.0-3 * Bugs: EXT-1091 EXT-1418 EXT-996 EXT-1150 EXT-1188 EXT-1417 EXT-1181 EXT-1058 EXT-1397 EXT-836 EXT-1437 EXT-1379 * Dev: EXT-1291 EXT-1255 EXT-992 EXT-96 EXT-1157 --- indra/llui/llbutton.cpp | 15 +++++ indra/llui/llbutton.h | 1 + indra/llui/lldockablefloater.cpp | 58 +++++++++++++++++-- indra/llui/lldockablefloater.h | 10 ++++ indra/llui/llfloater.cpp | 5 +- indra/llui/lltextbase.cpp | 3 + indra/llui/llui.cpp | 3 + indra/newview/CMakeLists.txt | 6 -- indra/newview/llfavoritesbar.cpp | 33 ++++++++++- indra/newview/llfloatercamera.cpp | 26 +-------- indra/newview/llfloatercamera.h | 6 +- indra/newview/llimfloater.cpp | 60 ++++++++++++++++---- indra/newview/llimfloater.h | 7 ++- indra/newview/llmoveview.cpp | 48 +++++++++------- indra/newview/llmoveview.h | 1 + indra/newview/llnearbychatbar.cpp | 66 ++++++++++++---------- indra/newview/llnearbychatbar.h | 6 ++ indra/newview/lloutputmonitorctrl.cpp | 2 +- indra/newview/llpanelgroup.cpp | 24 +++++++- indra/newview/llpanelgroup.h | 1 + indra/newview/llsyswellwindow.cpp | 11 ++-- indra/newview/llteleporthistorystorage.cpp | 1 + indra/newview/lltoastimpanel.cpp | 1 + indra/newview/llviewerfloaterreg.cpp | 2 - indra/newview/llviewermenu.cpp | 22 -------- .../skins/default/xui/en/floater_camera.xml | 4 +- .../skins/default/xui/en/floater_moveview.xml | 4 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 9 --- .../skins/default/xui/en/panel_bottomtray.xml | 6 +- .../skins/default/xui/en/panel_chat_item.xml | 2 +- .../skins/default/xui/en/panel_nearby_chat_bar.xml | 29 +++++++--- .../skins/default/xui/en/widgets/accordion_tab.xml | 8 ++- 32 files changed, 316 insertions(+), 164 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 219c2ee254..f28fca35c5 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -52,6 +52,7 @@ #include "llrender.h" #include "lluictrlfactory.h" #include "llhelp.h" +#include "lldockablefloater.h" static LLDefaultChildRegistry::Register r("button"); @@ -1056,6 +1057,20 @@ void LLButton::setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname) button->setClickedCallback(boost::bind(&LLFloaterReg::toggleFloaterInstance, sdname)); } +// static +void LLButton::setDockableFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname) +{ + LLButton* button = dynamic_cast(ctrl); + if (!button) + return; + // Get the visibility control name for the floater + std::string vis_control_name = LLFloaterReg::declareVisibilityControl(sdname.asString()); + // Set the button control value (toggle state) to the floater visibility control (Sets the value as well) + button->setControlVariable(LLUI::sSettingGroups["floater"]->getControl(vis_control_name)); + // Set the clicked callback to toggle the floater + button->setClickedCallback(boost::bind(&LLDockableFloater::toggleInstance, sdname)); +} + // static void LLButton::showHelp(LLUICtrl* ctrl, const LLSD& sdname) { diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 73ba457d34..7ca520b935 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -232,6 +232,7 @@ public: static void onHeldDown(void *userdata); // to be called by gIdleCallbacks static void toggleFloaterAndSetToggleState(LLUICtrl* ctrl, const LLSD& sdname); static void setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname); + static void setDockableFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname); static void showHelp(LLUICtrl* ctrl, const LLSD& sdname); void setForcePressedState(BOOL b) { mForcePressedState = b; } diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index c512ef25be..228d0e701f 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -33,24 +33,36 @@ #include "linden_common.h" #include "lldockablefloater.h" +#include "llfloaterreg.h" //static LLHandle LLDockableFloater::sInstanceHandle; +//static +void LLDockableFloater::init(LLDockableFloater* thiz) +{ + thiz->setDocked(thiz->mDockControl.get() != NULL + && thiz->mDockControl.get()->isDockVisible()); + thiz->resetInstance(); + + // all dockable floaters should have close, dock and minimize buttons + thiz->setCanClose(TRUE); + thiz->setCanDock(true); + thiz->setCanMinimize(TRUE); +} + LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, const LLSD& key, const Params& params) : LLFloater(key, params), mDockControl(dockControl), mUniqueDocking(true) { - setDocked(mDockControl.get() != NULL && mDockControl.get()->isDockVisible()); - resetInstance(); + init(this); } LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, bool uniqueDocking, const LLSD& key, const Params& params) : LLFloater(key, params), mDockControl(dockControl), mUniqueDocking(uniqueDocking) { - setDocked(mDockControl.get() != NULL && mDockControl.get()->isDockVisible()); - resetInstance(); + init(this); } LLDockableFloater::~LLDockableFloater() @@ -64,6 +76,33 @@ BOOL LLDockableFloater::postBuild() return LLView::postBuild(); } +//static +void LLDockableFloater::toggleInstance(const LLSD& sdname) +{ + LLSD key; + std::string name = sdname.asString(); + + LLDockableFloater* instance = + dynamic_cast (LLFloaterReg::findInstance(name)); + // if floater closed or docked + if (instance == NULL || instance != NULL && instance->isDocked()) + { + LLFloaterReg::toggleInstance(name, key); + // restore button toggle state + if (instance != NULL) + { + instance->storeVisibilityControl(); + } + } + // if floater undocked + else if (instance != NULL) + { + instance->setMinimized(FALSE); + instance->setVisible(TRUE); + instance->setFocus(TRUE); + } +} + void LLDockableFloater::resetInstance() { if (mUniqueDocking && sInstanceHandle.get() != this) @@ -91,6 +130,17 @@ void LLDockableFloater::setVisible(BOOL visible) LLFloater::setVisible(visible); } +void LLDockableFloater::setMinimized(BOOL minimize) +{ + if(minimize && isDocked()) + { + setVisible(FALSE); + } + setCanDock(!minimize); + + LLFloater::setMinimized(minimize); +} + void LLDockableFloater::onDockHidden() { setCanDock(FALSE); diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index 7d91d007ee..499ce9ae8d 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -44,6 +44,8 @@ class LLDockableFloater : public LLFloater { static const U32 UNDOCK_LEAP_HEIGHT = 12; + + static void init(LLDockableFloater* thiz); public: LOG_CLASS(LLDockableFloater); LLDockableFloater(LLDockControl* dockControl, const LLSD& key, @@ -54,6 +56,8 @@ public: static LLHandle getInstanceHandle() { return sInstanceHandle; } + static void toggleInstance(const LLSD& sdname); + /** * If descendant class overrides postBuild() in order to perform specific * construction then it must still invoke its superclass' implementation. @@ -68,6 +72,12 @@ public: */ /*virtual*/ void setVisible(BOOL visible); + /** + * If descendant class overrides setMinimized() then it must still invoke its + * superclass' implementation. + */ + /*virtual*/ void setMinimized(BOOL minimize); + virtual void onDockHidden(); virtual void onDockShown(); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 51e2b5dea4..8d2783db20 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -926,6 +926,9 @@ void LLFloater::setMinimized(BOOL minimize) if (minimize) { + // minimized flag should be turned on before release focus + mMinimized = TRUE; + mExpandedRect = getRect(); // If the floater has been dragged while minimized in the @@ -987,8 +990,6 @@ void LLFloater::setMinimized(BOOL minimize) } } - mMinimized = TRUE; - // Reshape *after* setting mMinimized reshape( minimized_width, floater_header_size, TRUE); } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 123e59ae6a..e85bee7775 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -415,6 +415,9 @@ void LLTextBase::drawCursor() return; } + if (!mTextRect.contains(cursor_rect)) + return; + // Draw the cursor // (Flash the cursor every half second starting a fixed time after the last keystroke) F32 elapsed = mCursorBlinkTimer.getElapsedTimeF32(); diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index c89e5944fa..9a90ee267e 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1556,6 +1556,9 @@ void LLUI::initClass(const settings_map_t& settings, // Button initialization callback for toggle buttons LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Button.SetFloaterToggle", boost::bind(&LLButton::setFloaterToggle, _1, _2)); + // Button initialization callback for toggle buttons on dockale floaters + LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Button.SetDockableFloaterToggle", boost::bind(&LLButton::setDockableFloaterToggle, _1, _2)); + // Display the help topic for the current context LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Button.ShowHelp", boost::bind(&LLButton::showHelp, _1, _2)); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 87c31c600e..b9e5664ff7 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -136,7 +136,6 @@ set(viewer_SOURCE_FILES llfeaturemanager.cpp llfilepicker.cpp llfirstuse.cpp - llfirsttimetipmanager.cpp llflexibleobject.cpp llfloaterabout.cpp llfloateractivespeakers.cpp @@ -161,7 +160,6 @@ set(viewer_SOURCE_FILES llfloaterdaycycle.cpp llfloaterdirectory.cpp llfloaterenvsettings.cpp - llfloaterfirsttimetip.cpp llfloaterfriends.cpp llfloaterfonttest.cpp llfloatergesture.cpp @@ -325,7 +323,6 @@ set(viewer_SOURCE_FILES llpanelmedia.cpp llpanelmediahud.cpp llpanelmeprofile.cpp - llpanelmovetip.cpp llpanelmediasettingsgeneral.cpp llpanelmediasettingssecurity.cpp llpanelmediasettingspermissions.cpp @@ -607,7 +604,6 @@ set(viewer_HEADER_FILES llfeaturemanager.h llfilepicker.h llfirstuse.h - llfirsttimetipmanager.h llflexibleobject.h llfloaterabout.h llfloateractivespeakers.h @@ -632,7 +628,6 @@ set(viewer_HEADER_FILES llfloaterdaycycle.h llfloaterdirectory.h llfloaterenvsettings.h - llfloaterfirsttimetip.h llfloaterfonttest.h llfloaterfriends.h llfloatergesture.h @@ -792,7 +787,6 @@ set(viewer_HEADER_FILES llpanelmedia.h llpanelmediahud.h llpanelmeprofile.h - llpanelmovetip.h llpanelmediasettingsgeneral.h llpanelmediasettingssecurity.h llpanelmediasettingspermissions.h diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index b06b4855ad..007c6b2c4c 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -201,7 +201,7 @@ public: fb->handleHover(x, y, mask); } - return LLMenuItemCallGL::handleHover(x, y, mask); + return TRUE; } void initFavoritesBarPointer(LLFavoritesBarCtrl* fb) { this->fb = fb; } @@ -216,6 +216,35 @@ private: LLFavoritesBarCtrl* fb; }; +/** + * This class was introduced just for fixing the following issue: + * EXT-836 Nav bar: Favorites overflow menu passes left-mouse click through. + * We must explicitly handle drag and drop event by returning TRUE + * because otherwise LLToolDragAndDrop will initiate drag and drop operation + * with the world. + */ +class LLFavoriteLandmarkToggleableMenu : public LLToggleableMenu +{ +public: + virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) + { + *accept = ACCEPT_NO; + return TRUE; + } + +protected: + LLFavoriteLandmarkToggleableMenu(const LLToggleableMenu::Params& p): + LLToggleableMenu(p) + { + } + + friend class LLUICtrlFactory; +}; + /** * This class is needed to update an item being copied to the favorites folder * with a sort field value (required to save favorites bar's tabs order). @@ -788,7 +817,7 @@ void LLFavoritesBarCtrl::showDropDownMenu() menu_p.max_scrollable_items = 10; menu_p.preferred_width = DROP_DOWN_MENU_WIDTH; - LLToggleableMenu* menu = LLUICtrlFactory::create(menu_p); + LLToggleableMenu* menu = LLUICtrlFactory::create(menu_p); mPopupMenuHandle = menu->getHandle(); } diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 0511ec1063..db20b11efd 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -39,7 +39,6 @@ // Viewer includes #include "lljoystickbutton.h" -#include "llfirsttimetipmanager.h" #include "llviewercontrol.h" #include "llbottomtray.h" #include "llagent.h" @@ -54,10 +53,6 @@ const F32 CAMERA_BUTTON_DELAY = 0.0f; #define CONTROLS "controls" -void show_tip(LLFirstTimeTipsManager::EFirstTimeTipType tipType, LLView* anchorView) -{ - LLFirstTimeTipsManager::showTipsFor(tipType, anchorView, LLFirstTimeTipsManager::TPA_POS_RIGHT_ALIGN_TOP); -} // // Member functions // @@ -88,7 +83,6 @@ void LLFloaterCamera::update() { ECameraControlMode mode = determineMode(); if (mode != mCurrMode) setMode(mode); - show_tip(mMode2TipType[mode], this); } @@ -129,12 +123,11 @@ void LLFloaterCamera::onOpen(const LLSD& key) anchor_panel, this, getDockTongue(), LLDockControl::TOP)); - show_tip(mMode2TipType[mCurrMode], this); } LLFloaterCamera::LLFloaterCamera(const LLSD& val) -: LLDockableFloater(NULL, false, val), +: LLDockableFloater(NULL, val), mCurrMode(CAMERA_CTRL_MODE_ORBIT), mPrevMode(CAMERA_CTRL_MODE_ORBIT) { @@ -149,8 +142,6 @@ BOOL LLFloaterCamera::postBuild() mZoom = getChild("zoom"); mTrack = getChild(PAN); - initMode2TipTypeMap(); - assignButton2Mode(CAMERA_CTRL_MODE_ORBIT, "orbit_btn"); assignButton2Mode(CAMERA_CTRL_MODE_PAN, "pan_btn"); assignButton2Mode(CAMERA_CTRL_MODE_FREE_CAMERA, "freecamera_btn"); @@ -236,7 +227,6 @@ void LLFloaterCamera::onClickBtn(ECameraControlMode mode) switchMode(mode); - show_tip(mMode2TipType[mode], this); } void LLFloaterCamera::assignButton2Mode(ECameraControlMode mode, const std::string& button_name) @@ -247,15 +237,6 @@ void LLFloaterCamera::assignButton2Mode(ECameraControlMode mode, const std::stri mMode2Button[mode] = button; } -void LLFloaterCamera::initMode2TipTypeMap() -{ - mMode2TipType[CAMERA_CTRL_MODE_ORBIT] = LLFirstTimeTipsManager::FTT_CAMERA_ORBIT_MODE; - mMode2TipType[CAMERA_CTRL_MODE_PAN] = LLFirstTimeTipsManager::FTT_CAMERA_PAN_MODE; - mMode2TipType[CAMERA_CTRL_MODE_FREE_CAMERA] = LLFirstTimeTipsManager::FTT_CAMERA_FREE_MODE; - mMode2TipType[CAMERA_CTRL_MODE_AVATAR_VIEW] = LLFirstTimeTipsManager::FTT_AVATAR_FREE_MODE; -} - - void LLFloaterCamera::updateState() { //updating buttons @@ -305,7 +286,7 @@ void LLFloaterCamera::updateState() //-------------LLFloaterCameraPresets------------------------ LLFloaterCameraPresets::LLFloaterCameraPresets(const LLSD& key): -LLDockableFloater(NULL, false, key) +LLDockableFloater(NULL, key) {} BOOL LLFloaterCameraPresets::postBuild() @@ -330,17 +311,14 @@ void LLFloaterCameraPresets::onClickCameraPresets(LLUICtrl* ctrl, const LLSD& pa if ("rear_view" == name) { - LLFirstTimeTipsManager::showTipsFor(LLFirstTimeTipsManager::FTT_CAMERA_PRESET_REAR, ctrl); gAgent.switchCameraPreset(CAMERA_PRESET_REAR_VIEW); } else if ("group_view" == name) { - LLFirstTimeTipsManager::showTipsFor(LLFirstTimeTipsManager::FTT_CAMERA_PRESET_GROUP); gAgent.switchCameraPreset(CAMERA_PRESET_GROUP_VIEW); } else if ("front_view" == name) { - LLFirstTimeTipsManager::showTipsFor(LLFirstTimeTipsManager::FTT_CAMERA_PRESET_FRONT); gAgent.switchCameraPreset(CAMERA_PRESET_FRONT_VIEW); } diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 020cae7e82..69df861a20 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -35,8 +35,6 @@ #include "lldockablefloater.h" -#include "llfirsttimetipmanager.h" - class LLJoystickCameraRotate; class LLJoystickCameraZoom; class LLJoystickCameraTrack; @@ -105,13 +103,11 @@ private: void onClickBtn(ECameraControlMode mode); void assignButton2Mode(ECameraControlMode mode, const std::string& button_name); - void initMode2TipTypeMap(); - + ECameraControlMode mPrevMode; ECameraControlMode mCurrMode; std::map mMode2Button; - std::map mMode2TipType; }; diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 3e449e2c82..680106c7bb 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -40,9 +40,11 @@ #include "llbottomtray.h" #include "llchannelmanager.h" #include "llchiclet.h" +#include "llfloaterchat.h" #include "llfloaterreg.h" #include "llimview.h" #include "lllineeditor.h" +#include "lllogchat.h" #include "llpanelimcontrolpanel.h" #include "llscreenchannel.h" #include "lltrans.h" @@ -90,16 +92,6 @@ void LLIMFloater::onClose(bool app_quitting) gIMMgr->removeSession(mSessionID); } -void LLIMFloater::setMinimized(BOOL minimize) -{ - if(!isDocked()) - { - setVisible(!minimize); - } - - LLFloater::setMinimized(minimize); -} - /* static */ void LLIMFloater::newIMCallback(const LLSD& data){ @@ -203,6 +195,12 @@ BOOL LLIMFloater::postBuild() setTitle(LLIMModel::instance().getName(mSessionID)); setDocked(true); + if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) + { + LLLogChat::loadHistory(getTitle(), &chatFromLogFile, (void *)this); + } + + return LLDockableFloater::postBuild(); } @@ -316,13 +314,19 @@ void LLIMFloater::setVisible(BOOL visible) bool LLIMFloater::toggle(const LLUUID& session_id) { LLIMFloater* floater = LLFloaterReg::findTypedInstance("impanel", session_id); - if (floater && floater->getVisible()) + if (floater && floater->getVisible() && floater->isDocked()) { // clicking on chiclet to close floater just hides it to maintain existing // scroll/text entry state floater->setVisible(false); return false; } + else if(floater && !floater->isDocked()) + { + floater->setVisible(TRUE); + floater->setFocus(TRUE); + return true; + } else { // ensure the list of messages is updated when floater is made visible @@ -419,3 +423,37 @@ void LLIMFloater::setTyping(BOOL typing) { } +void LLIMFloater::chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata) +{ + if (!userdata) return; + + LLIMFloater* self = (LLIMFloater*) userdata; + std::string message = line; + S32 im_log_option = gSavedPerAccountSettings.getS32("IMLogOptions"); + switch (type) + { + case LLLogChat::LOG_EMPTY: + // add warning log enabled message + if (im_log_option!=LOG_CHAT) + { + message = LLTrans::getString("IM_logging_string"); + } + break; + case LLLogChat::LOG_END: + // add log end message + if (im_log_option!=LOG_CHAT) + { + message = LLTrans::getString("IM_logging_string"); + } + break; + case LLLogChat::LOG_LINE: + // just add normal lines from file + break; + default: + // nothing + break; + } + + self->mHistoryEditor->appendText(message, true, LLStyle::Params().color(LLUIColorTable::instance().getColor("ChatHistoryTextColor"))); + self->mHistoryEditor->blockUndo(); +} diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index f85a941be3..5276013568 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -34,6 +34,7 @@ #define LL_IMFLOATER_H #include "lldockablefloater.h" +#include "lllogchat.h" class LLLineEditor; class LLPanelChatControlPanel; @@ -59,7 +60,6 @@ public: /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); // override LLFloater's minimization according to EXT-1216 - /*virtual*/ void setMinimized(BOOL minimize); // Make IM conversion visible and update the message history static LLIMFloater* show(const LLUUID& session_id); @@ -91,7 +91,10 @@ private: static void* createPanelGroupControl(void* userdata); // gets a rect that bounds possible positions for the LLIMFloater on a screen (EXT-1111) void getAllowedRect(LLRect& rect); - + + static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata); + + LLPanelChatControlPanel* mControlPanel; LLUUID mSessionID; S32 mLastMessageIndex; diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index d8f00ec370..1bbcc3f98e 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -44,9 +44,7 @@ #include "llvoavatarself.h" // to check gAgent.getAvatarObject()->isSitting() #include "llbottomtray.h" #include "llbutton.h" -#include "llfirsttimetipmanager.h" #include "llfloaterreg.h" -#include "llfloaterfirsttimetip.h" #include "lljoystickbutton.h" #include "lluictrlfactory.h" #include "llviewerwindow.h" @@ -54,6 +52,7 @@ #include "llselectmgr.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" +#include "lltooltip.h" // // Constants @@ -71,7 +70,7 @@ const std::string BOTTOM_TRAY_BUTTON_NAME = "movement_btn"; // protected LLFloaterMove::LLFloaterMove(const LLSD& key) -: LLDockableFloater(NULL, false, key), +: LLDockableFloater(NULL, key), mForwardButton(NULL), mBackwardButton(NULL), mTurnLeftButton(NULL), @@ -305,7 +304,6 @@ void LLFloaterMove::setMovementMode(const EMovementMode mode) showModeButtons(!bHideModeButtons); - showQuickTips(mode); } void LLFloaterMove::updateButtonsWithMovementMode(const EMovementMode newMode) @@ -464,6 +462,11 @@ void LLFloaterMove::enableInstance(BOOL bEnable) if (instance) { instance->setEnabled(bEnable); + + if (gAgent.getFlying()) + { + instance->showModeButtons(FALSE); + } } } @@ -487,8 +490,6 @@ void LLFloaterMove::onOpen(const LLSD& key) anchor_panel, this, getDockTongue(), LLDockControl::TOP)); - showQuickTips(mCurrentMode); - sUpdateFlyingStatus(); } @@ -500,20 +501,6 @@ void LLFloaterMove::setDocked(bool docked, bool pop_on_undock/* = true*/) updateHeight(show_mode_buttons); } -void LLFloaterMove::showQuickTips(const EMovementMode mode) -{ - LLFirstTimeTipsManager::EFirstTimeTipType tipType = LLFirstTimeTipsManager::FTT_MOVE_WALK; - switch (mode) - { - case MM_FLY: tipType = LLFirstTimeTipsManager::FTT_MOVE_FLY; break; - case MM_RUN: tipType = LLFirstTimeTipsManager::FTT_MOVE_RUN; break; - case MM_WALK: tipType = LLFirstTimeTipsManager::FTT_MOVE_WALK; break; - default: llwarns << "Quick Tip type was not detected, FTT_MOVE_WALK will be used" << llendl; - } - - LLFirstTimeTipsManager::showTipsFor(tipType, this, LLFirstTimeTipsManager::TPA_POS_LEFT_ALIGN_TOP); -} - void LLFloaterMove::setModeButtonToggleState(const EMovementMode mode) { llassert_always(mModeControlButtonMap.end() != mModeControlButtonMap.find(mode)); @@ -610,6 +597,22 @@ void LLPanelStandStopFlying::setVisible(BOOL visible) LLPanel::setVisible(visible); } +BOOL LLPanelStandStopFlying::handleToolTip(S32 x, S32 y, MASK mask) +{ + LLToolTipMgr::instance().unblockToolTips(); + + if (mStandButton->getVisible()) + { + LLToolTipMgr::instance().show(mStandButton->getToolTip()); + } + else if (mStopFlyingButton->getVisible()) + { + LLToolTipMgr::instance().show(mStopFlyingButton->getToolTip()); + } + + return TRUE; +} + ////////////////////////////////////////////////////////////////////////// // Private Section ////////////////////////////////////////////////////////////////////////// @@ -635,7 +638,10 @@ void LLPanelStandStopFlying::onStandButtonClick() gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); setFocus(FALSE); // EXT-482 - setVisible(FALSE); + + BOOL fly = gAgent.getFlying(); + mStopFlyingButton->setVisible(fly); + setVisible(fly); } void LLPanelStandStopFlying::onStopFlyingButtonClick() diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h index 584c7c494c..cbed36f10d 100644 --- a/indra/newview/llmoveview.h +++ b/indra/newview/llmoveview.h @@ -142,6 +142,7 @@ public: // *HACK: due to hard enough to have this control aligned with "Move" button while resizing // let update its position in each frame /*virtual*/ void draw(){updatePosition(); LLPanel::draw();} + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); protected: diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 1d8789fde0..c2e1019f43 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -201,35 +201,8 @@ BOOL LLNearbyChatBar::postBuild() mChatBox->setMaxTextLength(1023); mChatBox->setEnableLineHistory(TRUE); - // TODO: Initialization of the output monitor's params should be done via xml - const S32 MONITOR_RIGHT_PAD = 2; - - LLRect monitor_rect = LLRect(0, 18, 18, 0); - LLRect chatbox_rect = mChatBox->getRect(); - - S32 monitor_height = monitor_rect.getHeight(); - monitor_rect.mLeft = chatbox_rect.getWidth() - monitor_rect.getWidth() - MONITOR_RIGHT_PAD; - monitor_rect.mRight = chatbox_rect.getWidth() - MONITOR_RIGHT_PAD; - monitor_rect.mBottom = (chatbox_rect.getHeight() / 2) - (monitor_height / 2); - monitor_rect.mTop = monitor_rect.mBottom + monitor_height; - - LLOutputMonitorCtrl::Params monitor_params = LLOutputMonitorCtrl::Params(); - monitor_params.name = "output_monitor"; - monitor_params.draw_border(false); - monitor_params.rect(monitor_rect); - monitor_params.auto_update(true); - monitor_params.speaker_id(gAgentID); - - LLView::Follows follows = LLView::Follows(); - follows.flags = FOLLOWS_RIGHT; - monitor_params.follows = follows; - mOutputMonitor = LLUICtrlFactory::create(monitor_params); - mChatBox->addChild(mOutputMonitor); - - // never show "muted" because you can't mute yourself - mOutputMonitor->setIsMuted(false); + mOutputMonitor = getChild("chat_zone_indicator"); mOutputMonitor->setVisible(FALSE); - mTalkBtn = getChild("talk"); // Speak button should be initially disabled because @@ -254,6 +227,12 @@ bool LLNearbyChatBar::instanceExists() return LLBottomTray::instanceExists() && LLBottomTray::getInstance()->getNearbyChatBar() != NULL; } +void LLNearbyChatBar::draw() +{ + displaySpeakingIndicator(); + LLPanel::draw(); +} + std::string LLNearbyChatBar::getCurrentChat() { return mChatBox ? mChatBox->getText() : LLStringUtil::null; @@ -470,6 +449,36 @@ void LLNearbyChatBar::onChatBoxCommit() gAgent.stopTyping(); } +void LLNearbyChatBar::displaySpeakingIndicator() +{ + LLSpeakerMgr::speaker_list_t speaker_list; + LLUUID id; + + id.setNull(); + mSpeakerMgr.update(TRUE); + mSpeakerMgr.getSpeakerList(&speaker_list, FALSE); + + for (LLSpeakerMgr::speaker_list_t::iterator i = speaker_list.begin(); i != speaker_list.end(); ++i) + { + LLPointer s = *i; + if (s->mSpeechVolume > 0 || s->mStatus == LLSpeaker::STATUS_SPEAKING) + { + id = s->mID; + break; + } + } + + if (!id.isNull()) + { + mOutputMonitor->setVisible(TRUE); + mOutputMonitor->setSpeakerId(id); + } + else + { + mOutputMonitor->setVisible(FALSE); + } +} + void LLNearbyChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate) { sendChatFromViewer(utf8str_to_wstring(utf8text), type, animate); @@ -622,7 +631,6 @@ LLWString LLNearbyChatBar::stripChannelNumber(const LLWString &mesg, S32* channe void LLNearbyChatBar::setPTTState(bool state) { mTalkBtn->setSpeakBtnToggleState(state); - mOutputMonitor->setVisible(state); } void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel) diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index 1b71ad69f2..d6827315f2 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -40,6 +40,7 @@ #include "llchiclet.h" #include "llvoiceclient.h" #include "lloutputmonitorctrl.h" +#include "llfloateractivespeakers.h" class LLGestureComboBox : public LLComboBox @@ -84,6 +85,8 @@ public: LLLineEditor* getChatBox() { return mChatBox; } + virtual void draw(); + std::string getCurrentChat(); virtual BOOL handleKeyHere( KEY key, MASK mask ); @@ -110,12 +113,15 @@ protected: static LLWString stripChannelNumber(const LLWString &mesg, S32* channel); EChatType processChatTypeTriggers(EChatType type, std::string &str); + void displaySpeakingIndicator(); + // Which non-zero channel did we last chat on? static S32 sLastSpecialChatChannel; LLLineEditor* mChatBox; LLTalkButton* mTalkBtn; LLOutputMonitorCtrl* mOutputMonitor; + LLActiveSpeakerMgr mSpeakerMgr; }; #endif diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index d9cdf2e04f..8bac9937f0 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -222,7 +222,7 @@ void LLOutputMonitorCtrl::draw() void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id) { - if (speaker_id.isNull()) return; + if (speaker_id.isNull() || speaker_id == mSpeakerId) return; mSpeakerId = speaker_id; diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index acad897fa4..e2281743c9 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -211,9 +211,19 @@ void LLPanelGroup::reposButton(const std::string& name) button->setRect(btn_rect); } -void LLPanelGroup::reshape(S32 width, S32 height, BOOL called_from_parent ) +void LLPanelGroup::reposButtons() { - LLPanel::reshape(width, height, called_from_parent ); + LLButton* button_refresh = findChild("btn_refresh"); + LLButton* button_cancel = findChild("btn_cancel"); + + if(button_refresh && button_cancel && button_refresh->getVisible() && button_cancel->getVisible()) + { + LLRect btn_refresh_rect = button_refresh->getRect(); + LLRect btn_cancel_rect = button_cancel->getRect(); + btn_refresh_rect.setLeftTopAndSize( btn_cancel_rect.mLeft + btn_cancel_rect.getWidth() + 2, + btn_refresh_rect.getHeight() + 2, btn_refresh_rect.getWidth(), btn_refresh_rect.getHeight()); + button_refresh->setRect(btn_refresh_rect); + } reposButton("btn_apply"); reposButton("btn_create"); @@ -221,6 +231,13 @@ void LLPanelGroup::reshape(S32 width, S32 height, BOOL called_from_parent ) reposButton("btn_cancel"); } +void LLPanelGroup::reshape(S32 width, S32 height, BOOL called_from_parent ) +{ + LLPanel::reshape(width, height, called_from_parent ); + + reposButtons(); +} + void LLPanelGroup::onBackBtnClick() { LLSideTrayPanelContainer* parent = dynamic_cast(getParent()); @@ -411,7 +428,6 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) getChild("group_name")->setVisible(false); getChild("group_name_editor")->setVisible(true); - } else { @@ -431,6 +447,8 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) getChild("group_name")->setVisible(true); getChild("group_name_editor")->setVisible(false); } + + reposButtons(); } bool LLPanelGroup::apply(LLPanelGroupTab* tab) diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h index f2118a7244..628e2389b6 100644 --- a/indra/newview/llpanelgroup.h +++ b/indra/newview/llpanelgroup.h @@ -104,6 +104,7 @@ protected: static bool joinDlgCB(const LLSD& notification, const LLSD& response); void reposButton(const std::string& name); + void reposButtons(); protected: diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index c5a92f52d0..67a0528a06 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -112,9 +112,12 @@ BOOL LLSysWellWindow::postBuild() void LLSysWellWindow::setMinimized(BOOL minimize) { // we don't show empty Message Well window - setVisible(!minimize && !isWindowEmpty()); + if (!minimize) + { + setVisible(!isWindowEmpty()); + } - LLFloater::setMinimized(minimize); + LLDockableFloater::setMinimized(minimize); } //--------------------------------------------------------------------------------- @@ -264,7 +267,7 @@ void LLSysWellWindow::toggleWindow() getDockTongue(), LLDockControl::TOP, boost::bind(&LLSysWellWindow::getAllowedRect, this, _1))); } - if(!getVisible()) + if(!getVisible() || isMinimized()) { if(isWindowEmpty()) { @@ -273,7 +276,7 @@ void LLSysWellWindow::toggleWindow() setVisible(TRUE); } - else + else if (isDocked()) { setVisible(FALSE); } diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index 0bb5a727e0..a588153ca2 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -100,6 +100,7 @@ void LLTeleportHistoryStorage::onTeleportHistoryChange() void LLTeleportHistoryStorage::purgeItems() { mItems.clear(); + mHistoryChangedSignal(); } void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d& global_pos) diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index fe1492d937..c2cd63900b 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -66,6 +66,7 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif mReplyBtn->setVisible(FALSE); S32 btn_height = mReplyBtn->getRect().getHeight(); LLRect msg_rect = mMessage->getRect(); + mMessage->reshape(msg_rect.getWidth(), msg_rect.getHeight() + btn_height); msg_rect.setLeftTopAndSize(msg_rect.mLeft, msg_rect.mTop, msg_rect.getWidth(), msg_rect.getHeight() + btn_height); mMessage->setRect(msg_rect); } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 8c46949d70..e88217fae6 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -58,7 +58,6 @@ #include "llfloaterchatterbox.h" #include "llfloaterdaycycle.h" #include "llfloaterdirectory.h" -#include "llfloaterfirsttimetip.h" #include "llfloaterenvsettings.h" #include "llfloaterfonttest.h" #include "llfloatergesture.h" @@ -154,7 +153,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("contacts", "floater_my_friends.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("first_time_tip", "floater_first_time_tip.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("env_day_cycle", "floater_day_cycle_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("env_post_process", "floater_post_process.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("env_settings", "floater_env_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a81d26cb7b..b4e0d88e79 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -82,7 +82,6 @@ #include "llface.h" #include "llfilepicker.h" #include "llfirstuse.h" -#include "llfirsttimetipmanager.h" #include "llfloater.h" #include "llfloaterabout.h" #include "llfloaterbuycurrency.h" @@ -7603,24 +7602,6 @@ class LLWorldDayCycle : public view_listener_t } }; -/// Show First Time Tips calbacks -class LLHelpCheckShowFirstTimeTip : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - return LLFirstTimeTipsManager::tipsEnabled(); - } -}; - -class LLHelpShowFirstTimeTip : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLFirstTimeTipsManager::enabledTip(!userdata.asBoolean()); - return true; - } -}; - void show_navbar_context_menu(LLView* ctrl, S32 x, S32 y) { static LLMenuGL* show_navbar_context_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_hide_navbar.xml", @@ -7738,9 +7719,6 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); view_listener_t::addMenu(new LLWorldDayCycle(), "World.DayCycle"); - view_listener_t::addMenu(new LLHelpCheckShowFirstTimeTip(), "Help.CheckShowFirstTimeTip"); - view_listener_t::addMenu(new LLHelpShowFirstTimeTip(), "Help.ShowQuickTips"); - // Tools menu view_listener_t::addMenu(new LLToolsSelectTool(), "Tools.SelectTool"); view_listener_t::addMenu(new LLToolsSelectOnlyMyObjects(), "Tools.SelectOnlyMyObjects"); diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index c4a2654403..86c75a3946 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -1,8 +1,8 @@ - @@ -121,7 +121,7 @@ name="camera_btn" width="70"> diff --git a/indra/newview/skins/default/xui/en/panel_chat_item.xml b/indra/newview/skins/default/xui/en/panel_chat_item.xml index 713c3a41a2..78f53562cd 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_item.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml @@ -16,7 +16,7 @@ /> Jerry Knight diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index 4088d96ebf..d914583352 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -21,15 +21,28 @@ tool_tip="Press Enter to say, Ctrl-Enter to shout." top="3" width="250" /> + + header_expand_img_pressed="Accordion_ArrowOpened_Press" + header_image="Accordion_Off.png" + header_image_over="Accordion_Over" + header_image_pressed="Accordion_Press" + /> -- cgit v1.3 From 15218864c31b991842700ed5584fc495117f7527 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 13 Oct 2009 23:50:09 +0000 Subject: EXT-1351 DEV-38496 Add "show rectangles" check to UI Preview Tool, which draws outlines of widgets and makes tooltips show their names and sizes. Used for localization to catch string truncations and fix them. Reviewed with Leyla. --- indra/llui/llview.cpp | 15 +- indra/llui/llview.h | 16 +- indra/newview/llfloateruipreview.cpp | 237 ++++++++++++++++++++- indra/newview/llfloateruipreview.h | 133 +----------- indra/newview/llviewerfloaterreg.cpp | 2 +- .../skins/default/xui/en/floater_ui_preview.xml | 9 + 6 files changed, 268 insertions(+), 144 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 1df8838738..7db6eab9ad 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -57,14 +57,13 @@ #include "lltexteditor.h" #include "lltextbox.h" -BOOL LLView::sDebugRects = FALSE; -BOOL LLView::sDebugKeys = FALSE; S32 LLView::sDepth = 0; -BOOL LLView::sDebugMouseHandling = FALSE; +bool LLView::sDebugRects = false; +bool LLView::sDebugRectsShowNames = true; +bool LLView::sDebugKeys = false; +bool LLView::sDebugMouseHandling = false; std::string LLView::sMouseHandlerMessage; -//BOOL LLView::sEditingUI = FALSE; BOOL LLView::sForceReshape = FALSE; -//LLView* LLView::sEditingUIView = NULL; std::set LLView::sPreviewHighlightedElements; BOOL LLView::sHighlightingDiffs = FALSE; LLView* LLView::sPreviewClickedElement = NULL; @@ -1353,7 +1352,7 @@ void LLView::drawDebugRect() LLRect debug_rect = mUseBoundingRect ? mBoundingRect : mRect; // draw red rectangle for the border - LLColor4 border_color(0.f, 0.f, 0.f, 1.f); + LLColor4 border_color(0.25f, 0.25f, 0.25f, 1.f); if(preview_iter != sPreviewHighlightedElements.end()) { if(LLView::sPreviewClickedElement && this == sPreviewClickedElement) @@ -1388,7 +1387,9 @@ void LLView::drawDebugRect() gGL.end(); // Draw the name if it's not a leaf node or not in editing or preview mode - if (mChildList.size() && preview_iter == sPreviewHighlightedElements.end()) + if (mChildList.size() + && preview_iter == sPreviewHighlightedElements.end() + && sDebugRectsShowNames) { //char temp[256]; S32 x, y; diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 7ddff2bd9e..5e35068733 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -586,14 +586,20 @@ private: default_widget_map_t& getDefaultWidgetMap() const; public: - static BOOL sDebugRects; // Draw debug rects behind everything. - static BOOL sDebugKeys; + // Depth in view hierarchy during rendering static S32 sDepth; - static BOOL sDebugMouseHandling; + + // Draw debug rectangles around widgets to help with alignment and spacing + static bool sDebugRects; + + // Draw widget names and sizes when drawing debug rectangles, turning this + // off is useful to make the rectangles themselves easier to see. + static bool sDebugRectsShowNames; + + static bool sDebugKeys; + static bool sDebugMouseHandling; static std::string sMouseHandlerMessage; static S32 sSelectID; -// static BOOL sEditingUI; -// static LLView* sEditingUIView; static std::set sPreviewHighlightedElements; // DEV-16869 static BOOL sHighlightingDiffs; // DEV-16869 static LLView* sPreviewClickedElement; // DEV-16869 diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 98ca33c9cc..de0b995f8f 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -56,8 +56,13 @@ #include "llfilepicker.h" #include "lldraghandle.h" #include "lllayoutstack.h" +#include "lltooltip.h" #include "llviewermenu.h" #include "llrngwriter.h" +#include "llfloater.h" // superclass +#include "llfloaterreg.h" +#include "llscrollcontainer.h" // scroll container for overlapping elements +#include "lllivefile.h" // live file poll/stat/reload // Boost (for linux/unix command-line execv) #include @@ -65,6 +70,8 @@ // External utility #include +#include +#include #if LL_DARWIN #include @@ -74,6 +81,7 @@ static const S32 PRIMARY_FLOATER = 1; static const S32 SECONDARY_FLOATER = 2; +class LLOverlapPanel; static LLDefaultChildRegistry::Register register_overlap_panel("overlap_panel"); static std::string get_xui_dir() @@ -82,6 +90,134 @@ static std::string get_xui_dir() return gDirUtilp->getSkinBaseDir() + delim + "default" + delim + "xui" + delim; } +// Forward declarations to avoid header dependencies +class LLEventTimer; +class LLColor; +class LLScrollListCtrl; +class LLComboBox; +class LLButton; +class LLLineEditor; +class LLXmlTreeNode; +class LLFloaterUIPreview; +class LLFadeEventTimer; + +class LLLocalizationResetForcer; +class LLGUIPreviewLiveFile; +class LLFadeEventTimer; +class LLPreviewedFloater; + +// Implementation of custom overlapping element display panel +class LLOverlapPanel : public LLPanel +{ +public: + struct Params : public LLInitParam::Block + { + Params() {} + }; + LLOverlapPanel(Params p = Params()) : LLPanel(p), + mSpacing(10), + // mClickedElement(NULL), + mLastClickedElement(NULL) + { + mOriginalWidth = getRect().getWidth(); + mOriginalHeight = getRect().getHeight(); + } + virtual void draw(); + + typedef std::map > OverlapMap; + OverlapMap mOverlapMap; // map, of XUI element to a list of XUI elements it overlaps + + // LLView *mClickedElement; + LLView *mLastClickedElement; + int mOriginalWidth, mOriginalHeight, mSpacing; +}; + + +class LLFloaterUIPreview : public LLFloater +{ +public: + // Setup + LLFloaterUIPreview(const LLSD& key); + virtual ~LLFloaterUIPreview(); + + std::string getLocStr(S32 ID); // fetches the localization string based on what is selected in the drop-down menu + void displayFloater(BOOL click, S32 ID, bool save = false); // needs to be public so live file can call it when it finds an update + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onClose(bool app_quitting); + + void refreshList(); // refresh list (empty it out and fill it up from scratch) + void addFloaterEntry(const std::string& path); // add a single file's entry to the list of floaters + + static BOOL containerType(LLView* viewp); // check if the element is a container type and tree traverses need to look at its children + +public: + LLPreviewedFloater* mDisplayedFloater; // the floater which is currently being displayed + LLPreviewedFloater* mDisplayedFloater_2; // the floater which is currently being displayed + LLGUIPreviewLiveFile* mLiveFile; // live file for checking for updates to the currently-displayed XML file + LLOverlapPanel* mOverlapPanel; // custom overlapping elements panel + // BOOL mHighlightingDiffs; // bool for whether localization diffs are being highlighted or not + BOOL mHighlightingOverlaps; // bool for whether overlapping elements are being highlighted + + // typedef std::map,std::list > > DiffMap; // this version copies the lists etc., and thus is bad memory-wise + typedef std::list StringList; + typedef boost::shared_ptr StringListPtr; + typedef std::map > DiffMap; + DiffMap mDiffsMap; // map, of filename to pair of list of changed element paths and list of errors + +private: + // XUI elements for this floater + LLScrollListCtrl* mFileList; // scroll list control for file list + LLLineEditor* mEditorPathTextBox; // text field for path to editor executable + LLLineEditor* mEditorArgsTextBox; // text field for arguments to editor executable + LLLineEditor* mDiffPathTextBox; // text field for path to diff file + LLButton* mDisplayFloaterBtn; // button to display primary floater + LLButton* mDisplayFloaterBtn_2; // button to display secondary floater + LLButton* mEditFloaterBtn; // button to edit floater + LLButton* mExecutableBrowseButton; // button to browse for executable + LLButton* mCloseOtherButton; // button to close primary displayed floater + LLButton* mCloseOtherButton_2; // button to close secondary displayed floater + LLButton* mDiffBrowseButton; // button to browse for diff file + LLButton* mToggleHighlightButton; // button to toggle highlight of files/elements with diffs + LLButton* mToggleOverlapButton; // button to togle overlap panel/highlighting + LLComboBox* mLanguageSelection; // combo box for primary language selection + LLComboBox* mLanguageSelection_2; // combo box for secondary language selection + LLScrollContainer* mOverlapScrollView; // overlapping elements scroll container + S32 mLastDisplayedX, mLastDisplayedY; // stored position of last floater so the new one opens up in the same place + std::string mDelim; // the OS-specific delimiter character (/ or \) (*TODO: this shouldn't be needed, right?) + + std::string mSavedEditorPath; // stored editor path so closing this floater doesn't reset it + std::string mSavedEditorArgs; // stored editor args so closing this floater doesn't reset it + std::string mSavedDiffPath; // stored diff file path so closing this floater doesn't reset it + + // Internal functionality + static void popupAndPrintWarning(std::string& warning); // pop up a warning + std::string getLocalizedDirectory(); // build and return the path to the XUI directory for the currently-selected localization + void scanDiffFile(LLXmlTreeNode* file_node); // scan a given XML node for diff entries and highlight them in its associated file + void highlightChangedElements(); // look up the list of elements to highlight and highlight them in the current floater + void highlightChangedFiles(); // look up the list of changed files to highlight and highlight them in the scroll list + void findOverlapsInChildren(LLView* parent); // fill the map below with element overlap information + static BOOL overlapIgnorable(LLView* viewp); // check it the element can be ignored for overlap/localization purposes + + // check if two elements overlap using their rectangles + // used instead of llrect functions because by adding a few pixels of leeway I can cut down drastically on the number of overlaps + BOOL elementOverlap(LLView* view1, LLView* view2); + + // Button/drop-down action listeners (self explanatory) + void onClickDisplayFloater(S32 id); + void onClickSaveFloater(S32 id); + void onClickSaveAll(S32 id); + void onClickEditFloater(); + void onClickBrowseForEditor(); + void onClickBrowseForDiffs(); + void onClickToggleDiffHighlighting(); + void onClickToggleOverlapping(); + void onClickCloseDisplayedFloater(S32 id); + void onLanguageComboSelect(LLUICtrl* ctrl); + void onClickExportSchema(); + void onClickShowRectangles(const LLSD& data); +}; + //---------------------------------------------------------------------------- // Local class declarations // Reset object to ensure that when we change the current language setting for preview purposes, @@ -137,11 +273,17 @@ public: } virtual void draw(); BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + BOOL handleToolTip(S32 x, S32 y, MASK mask); BOOL selectElement(LLView* parent, int x, int y, int depth); // select element to display its overlappers LLFloaterUIPreview* mFloaterUIPreview; + + // draw widget outlines + static bool sShowRectangles; }; +bool LLPreviewedFloater::sShowRectangles = false; + //---------------------------------------------------------------------------- // Localization reset forcer -- ensures that when localization is temporarily changed for previewed floater, it is reset @@ -257,7 +399,6 @@ LLFloaterUIPreview::LLFloaterUIPreview(const LLSD& key) mHighlightingOverlaps(FALSE), mLastDisplayedX(0), mLastDisplayedY(0) - { // called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_ui_preview.xml"); } @@ -317,6 +458,8 @@ BOOL LLFloaterUIPreview::postBuild() main_panel_tmp->getChild("save_all_floaters")->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickSaveAll, this, PRIMARY_FLOATER)); getChild("export_schema")->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickExportSchema, this)); + getChild("show_rectangles")->setCommitCallback( + boost::bind(&LLFloaterUIPreview::onClickShowRectangles, this, _2)); // get pointers to text fields mEditorPathTextBox = editor_panel_tmp->getChild("executable_path_field"); @@ -438,6 +581,10 @@ void LLFloaterUIPreview::onClickExportSchema() gViewerWindow->setCursor(UI_CURSOR_ARROW); } +void LLFloaterUIPreview::onClickShowRectangles(const LLSD& data) +{ + LLPreviewedFloater::sShowRectangles = data.asBoolean(); +} // Close click handler -- delete my displayed floater if it exists void LLFloaterUIPreview::onClose(bool app_quitting) @@ -1357,6 +1504,73 @@ void LLFloaterUIPreview::onClickCloseDisplayedFloater(S32 caller_id) } +void append_view_tooltip(LLView* tooltip_view, std::string *tooltip_msg) +{ + LLRect rect = tooltip_view->getRect(); + LLRect parent_rect = tooltip_view->getParent()->getRect(); + S32 left = rect.mLeft; + // invert coordinate system for XUI top-left layout + S32 top = parent_rect.getHeight() - rect.mTop; + if (!tooltip_msg->empty()) + { + tooltip_msg->append("\n"); + } + std::string msg = llformat("%s %d, %d (%d x %d)", + tooltip_view->getName().c_str(), + left, + top, + rect.getWidth(), + rect.getHeight() ); + tooltip_msg->append( msg ); +} + +BOOL LLPreviewedFloater::handleToolTip(S32 x, S32 y, MASK mask) +{ + if (!sShowRectangles) + { + return LLFloater::handleToolTip(x, y, mask); + } + + S32 screen_x, screen_y; + localPointToScreen(x, y, &screen_x, &screen_y); + std::string tooltip_msg; + LLView* tooltip_view = this; + LLView::tree_iterator_t end_it = endTreeDFS(); + for (LLView::tree_iterator_t it = beginTreeDFS(); it != end_it; ++it) + { + LLView* viewp = *it; + LLRect screen_rect; + viewp->localRectToScreen(viewp->getLocalRect(), &screen_rect); + if (!(viewp->getVisible() + && screen_rect.pointInRect(screen_x, screen_y))) + { + it.skipDescendants(); + } + // only report xui names for LLUICtrls, not the various container LLViews + + else if (dynamic_cast(viewp)) + { + // if we are in a new part of the tree (not a descendent of current tooltip_view) + // then push the results for tooltip_view and start with a new potential view + // NOTE: this emulates visiting only the leaf nodes that meet our criteria + + if (tooltip_view != this + && !viewp->hasAncestor(tooltip_view)) + { + append_view_tooltip(tooltip_view, &tooltip_msg); + } + tooltip_view = viewp; + } + } + + append_view_tooltip(tooltip_view, &tooltip_msg); + + LLToolTipMgr::instance().show(LLToolTip::Params() + .message(tooltip_msg) + .max_width(400)); + return TRUE; +} + BOOL LLPreviewedFloater::handleRightMouseDown(S32 x, S32 y, MASK mask) { selectElement(this,x,y,0); @@ -1415,7 +1629,22 @@ void LLPreviewedFloater::draw() { LLView::sDrawPreviewHighlights = TRUE; } + + // If we're looking for truncations, draw debug rects for the displayed + // floater only. + bool old_debug_rects = LLView::sDebugRects; + bool old_show_names = LLView::sDebugRectsShowNames; + if (sShowRectangles) + { + LLView::sDebugRects = true; + LLView::sDebugRectsShowNames = false; + } + LLFloater::draw(); + + LLView::sDebugRects = old_debug_rects; + LLView::sDebugRectsShowNames = old_show_names; + if(mFloaterUIPreview->mHighlightingOverlaps) { LLView::sDrawPreviewHighlights = FALSE; @@ -1635,3 +1864,9 @@ void LLOverlapPanel::draw() mLastClickedElement = LLView::sPreviewClickedElement; } } + +void LLFloaterUIPreviewUtil::registerFloater() +{ + LLFloaterReg::add("ui_preview", "floater_ui_preview.xml", + &LLFloaterReg::build); +} diff --git a/indra/newview/llfloateruipreview.h b/indra/newview/llfloateruipreview.h index 2a98c90727..2a31b2df59 100644 --- a/indra/newview/llfloateruipreview.h +++ b/indra/newview/llfloateruipreview.h @@ -37,137 +37,10 @@ #ifndef LL_LLUIPREVIEW_H #define LL_LLUIPREVIEW_H -#include "llfloater.h" // superclass -#include "llscrollcontainer.h" // scroll container for overlapping elements -#include "lllivefile.h" // live file poll/stat/reload -#include -#include - -// Forward declarations to avoid header dependencies -class LLEventTimer; -class LLColor; -class LLScrollListCtrl; -class LLComboBox; -class LLButton; -class LLLineEditor; -class LLXmlTreeNode; -class LLFloaterUIPreview; -class LLFadeEventTimer; - -class LLLocalizationResetForcer; -class LLGUIPreviewLiveFile; -class LLFadeEventTimer; -class LLPreviewedFloater; - -// Implementation of custom overlapping element display panel -class LLOverlapPanel : public LLPanel +namespace LLFloaterUIPreviewUtil { -public: - struct Params : public LLInitParam::Block - { - Params() {} - }; - LLOverlapPanel(Params p = Params()) : LLPanel(p), - mSpacing(10), - // mClickedElement(NULL), - mLastClickedElement(NULL) - { - mOriginalWidth = getRect().getWidth(); - mOriginalHeight = getRect().getHeight(); - } - virtual void draw(); - - typedef std::map > OverlapMap; - OverlapMap mOverlapMap; // map, of XUI element to a list of XUI elements it overlaps - - // LLView *mClickedElement; - LLView *mLastClickedElement; - int mOriginalWidth, mOriginalHeight, mSpacing; -}; - - -class LLFloaterUIPreview : public LLFloater -{ -public: - // Setup - LLFloaterUIPreview(const LLSD& key); - virtual ~LLFloaterUIPreview(); - - std::string getLocStr(S32 ID); // fetches the localization string based on what is selected in the drop-down menu - void displayFloater(BOOL click, S32 ID, bool save = false); // needs to be public so live file can call it when it finds an update - - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); - - void refreshList(); // refresh list (empty it out and fill it up from scratch) - void addFloaterEntry(const std::string& path); // add a single file's entry to the list of floaters - - static BOOL containerType(LLView* viewp); // check if the element is a container type and tree traverses need to look at its children - -public: - LLPreviewedFloater* mDisplayedFloater; // the floater which is currently being displayed - LLPreviewedFloater* mDisplayedFloater_2; // the floater which is currently being displayed - LLGUIPreviewLiveFile* mLiveFile; // live file for checking for updates to the currently-displayed XML file - LLOverlapPanel* mOverlapPanel; // custom overlapping elements panel - // BOOL mHighlightingDiffs; // bool for whether localization diffs are being highlighted or not - BOOL mHighlightingOverlaps; // bool for whether overlapping elements are being highlighted - - // typedef std::map,std::list > > DiffMap; // this version copies the lists etc., and thus is bad memory-wise - typedef std::list StringList; - typedef boost::shared_ptr StringListPtr; - typedef std::map > DiffMap; - DiffMap mDiffsMap; // map, of filename to pair of list of changed element paths and list of errors - -private: - // XUI elements for this floater - LLScrollListCtrl* mFileList; // scroll list control for file list - LLLineEditor* mEditorPathTextBox; // text field for path to editor executable - LLLineEditor* mEditorArgsTextBox; // text field for arguments to editor executable - LLLineEditor* mDiffPathTextBox; // text field for path to diff file - LLButton* mDisplayFloaterBtn; // button to display primary floater - LLButton* mDisplayFloaterBtn_2; // button to display secondary floater - LLButton* mEditFloaterBtn; // button to edit floater - LLButton* mExecutableBrowseButton; // button to browse for executable - LLButton* mCloseOtherButton; // button to close primary displayed floater - LLButton* mCloseOtherButton_2; // button to close secondary displayed floater - LLButton* mDiffBrowseButton; // button to browse for diff file - LLButton* mToggleHighlightButton; // button to toggle highlight of files/elements with diffs - LLButton* mToggleOverlapButton; // button to togle overlap panel/highlighting - LLComboBox* mLanguageSelection; // combo box for primary language selection - LLComboBox* mLanguageSelection_2; // combo box for secondary language selection - LLScrollContainer* mOverlapScrollView; // overlapping elements scroll container - S32 mLastDisplayedX, mLastDisplayedY; // stored position of last floater so the new one opens up in the same place - std::string mDelim; // the OS-specific delimiter character (/ or \) (*TODO: this shouldn't be needed, right?) - - std::string mSavedEditorPath; // stored editor path so closing this floater doesn't reset it - std::string mSavedEditorArgs; // stored editor args so closing this floater doesn't reset it - std::string mSavedDiffPath; // stored diff file path so closing this floater doesn't reset it - - // Internal functionality - static void popupAndPrintWarning(std::string& warning); // pop up a warning - std::string getLocalizedDirectory(); // build and return the path to the XUI directory for the currently-selected localization - void scanDiffFile(LLXmlTreeNode* file_node); // scan a given XML node for diff entries and highlight them in its associated file - void highlightChangedElements(); // look up the list of elements to highlight and highlight them in the current floater - void highlightChangedFiles(); // look up the list of changed files to highlight and highlight them in the scroll list - void findOverlapsInChildren(LLView* parent); // fill the map below with element overlap information - static BOOL overlapIgnorable(LLView* viewp); // check it the element can be ignored for overlap/localization purposes - - // check if two elements overlap using their rectangles - // used instead of llrect functions because by adding a few pixels of leeway I can cut down drastically on the number of overlaps - BOOL elementOverlap(LLView* view1, LLView* view2); + void registerFloater(); +} - // Button/drop-down action listeners (self explanatory) - void onClickDisplayFloater(S32 id); - void onClickSaveFloater(S32 id); - void onClickSaveAll(S32 id); - void onClickEditFloater(); - void onClickBrowseForEditor(); - void onClickBrowseForDiffs(); - void onClickToggleDiffHighlighting(); - void onClickToggleOverlapping(); - void onClickCloseDisplayedFloater(S32 id); - void onLanguageComboSelect(LLUICtrl* ctrl); - void onClickExportSchema(); -}; #endif // LL_LLUIPREVIEW_H diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index e88217fae6..22081f9efa 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -232,7 +232,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("search", "floater_directory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("ui_preview", "floater_ui_preview.xml", &LLFloaterReg::build); + LLFloaterUIPreviewUtil::registerFloater(); LLFloaterReg::add("upload_anim", "floater_animation_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "upload"); LLFloaterReg::add("upload_image", "floater_image_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "upload"); LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "upload"); diff --git a/indra/newview/skins/default/xui/en/floater_ui_preview.xml b/indra/newview/skins/default/xui/en/floater_ui_preview.xml index 4ed6787f53..c5e0c5ea13 100644 --- a/indra/newview/skins/default/xui/en/floater_ui_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_ui_preview.xml @@ -171,6 +171,15 @@ name="export_schema" top_delta="0" width="120" /> + + Date: Wed, 14 Oct 2009 01:51:49 +0000 Subject: EXT-1393 "none" does not appear in object group list EXT-1479 I18N: string in /en/widgets/location_input.xml wont honor its translation and made tabs height customizable reviewed by Richard --- indra/llui/lltabcontainer.cpp | 13 ++++++------ indra/llui/lltabcontainer.h | 5 ++++- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llavataractions.cpp | 1 + indra/newview/llfloatergroups.cpp | 23 +++++++++++++--------- indra/newview/llfloatergroups.h | 3 +++ indra/newview/llfloaterregioninfo.cpp | 1 + indra/newview/lllocationinputctrl.cpp | 11 ++++++----- indra/newview/lllocationinputctrl.h | 2 ++ indra/newview/skins/default/xui/en/strings.xml | 5 ----- .../default/xui/en/widgets/location_input.xml | 3 ++- .../skins/default/xui/en/widgets/tab_container.xml | 1 + 12 files changed, 41 insertions(+), 38 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index b1067ad6f3..3ca05ff0ff 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -107,9 +107,10 @@ static LLDefaultChildRegistry::Register r2("tab_container"); LLTabContainer::Params::Params() : tab_width("tab_width"), - tab_position("tab_position"), tab_min_width("tab_min_width"), tab_max_width("tab_max_width"), + tab_height("tab_height"), + tab_position("tab_position"), hide_tabs("hide_tabs", false), tab_padding_right("tab_padding_right"), tab_top_image_unselected("tab_top_image_unselected"), @@ -136,6 +137,7 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) mLockedTabCount(0), mMinTabWidth(0), mMaxTabWidth(p.tab_max_width), + mTabHeight(p.tab_height), mPrevArrowBtn(NULL), mNextArrowBtn(NULL), mIsVertical( p.tab_position == LEFT ), @@ -802,7 +804,6 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) static LLUICachedControl tabcntrv_pad ("UITabCntrvPad", 0); static LLUICachedControl tabcntr_button_panel_overlap ("UITabCntrButtonPanelOverlap", 0); - static LLUICachedControl tabcntr_tab_height ("UITabCntrTabHeight", 0); static LLUICachedControl tab_padding ("UITabPadding", 0); if (child->getParent() == this) { @@ -830,14 +831,14 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) { if( getTabPosition() == LLTabContainer::TOP ) { - S32 tab_height = mIsVertical ? BTN_HEIGHT : tabcntr_tab_height; + S32 tab_height = mIsVertical ? BTN_HEIGHT : mTabHeight; tab_panel_top = getRect().getHeight() - getTopBorderHeight() - (tab_height - tabcntr_button_panel_overlap); tab_panel_bottom = LLPANEL_BORDER_WIDTH; } else { tab_panel_top = getRect().getHeight() - getTopBorderHeight(); - tab_panel_bottom = (tabcntr_tab_height - tabcntr_button_panel_overlap); // Run to the edge, covering up the border + tab_panel_bottom = (mTabHeight - tabcntr_button_panel_overlap); // Run to the edge, covering up the border } } else @@ -886,13 +887,13 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) } else if( getTabPosition() == LLTabContainer::TOP ) { - btn_rect.setLeftTopAndSize( 0, getRect().getHeight() - getTopBorderHeight() + tab_fudge, button_width, tabcntr_tab_height ); + btn_rect.setLeftTopAndSize( 0, getRect().getHeight() - getTopBorderHeight() + tab_fudge, button_width, mTabHeight); tab_img = mImageTopUnselected.get(); tab_selected_img = mImageTopSelected.get(); } else { - btn_rect.setOriginAndSize( 0, 0 + tab_fudge, button_width, tabcntr_tab_height ); + btn_rect.setOriginAndSize( 0, 0 + tab_fudge, button_width, mTabHeight); tab_img = mImageBottomUnselected.get(); tab_selected_img = mImageBottomSelected.get(); } diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 7bbecc1abc..e3af5384b1 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -67,7 +67,9 @@ public: Optional tab_position; Optional tab_width, tab_min_width, - tab_max_width; + tab_max_width, + tab_height; + Optional hide_tabs; Optional tab_padding_right; @@ -246,6 +248,7 @@ private: S32 mMaxTabWidth; S32 mTotalTabWidth; + S32 mTabHeight; LLFrameTimer mDragAndDropDelayTimer; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index be48ebdf67..d05fd955db 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9645,17 +9645,6 @@ Value 16 - UITabCntrTabHeight - - Comment - UI Tab Container Tab Height - Persist - 1 - Type - S32 - Value - 16 - UITabCntrTabHPad Comment diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 2b5e2369bb..2f67401301 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -255,6 +255,7 @@ void LLAvatarActions::inviteToGroup(const LLUUID& id) LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance("group_picker", LLSD(id)); if (widget) { + widget->removeNoneOption(); widget->center(); widget->setPowersMask(GP_MEMBER_INVITE); widget->setSelectGroupCallback(boost::bind(callback_invite_to_group, _1, id)); diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 3648898f28..45af515a86 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -89,15 +89,6 @@ BOOL LLFloaterGroupPicker::postBuild() list_ctrl->setContextMenu(LLScrollListCtrl::MENU_GROUP); } - // Remove group "none" from list. Group "none" is added in init_group_list(). - // Some UI elements use group "none", we need to manually delete it here. - // Group "none" ID is LLUUID:null. - LLCtrlListInterface* group_list = list_ctrl->getListInterface(); - if(group_list) - { - group_list->selectByValue(LLUUID::null); - group_list->operateOnSelection(LLCtrlListInterface::OP_DELETE); - } childSetAction("OK", onBtnOK, this); @@ -110,6 +101,20 @@ BOOL LLFloaterGroupPicker::postBuild() return TRUE; } +void LLFloaterGroupPicker::removeNoneOption() +{ + // Remove group "none" from list. Group "none" is added in init_group_list(). + // Some UI elements use group "none", we need to manually delete it here. + // Group "none" ID is LLUUID:null. + LLCtrlListInterface* group_list = getChild("group list")->getListInterface(); + if(group_list) + { + group_list->selectByValue(LLUUID::null); + group_list->operateOnSelection(LLCtrlListInterface::OP_DELETE); + } +} + + void LLFloaterGroupPicker::onBtnOK(void* userdata) { LLFloaterGroupPicker* self = (LLFloaterGroupPicker*)userdata; diff --git a/indra/newview/llfloatergroups.h b/indra/newview/llfloatergroups.h index 489238356d..ce3a470a23 100644 --- a/indra/newview/llfloatergroups.h +++ b/indra/newview/llfloatergroups.h @@ -72,6 +72,9 @@ public: static LLFloaterGroupPicker* findInstance(const LLSD& seed); static LLFloaterGroupPicker* createInstance(const LLSD& seed); + // for cases like inviting avatar to group we don't want the none option + void removeNoneOption(); + protected: void ok(); static void onBtnOK(void* userdata); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 0330a8c692..e15fdd3e35 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -1522,6 +1522,7 @@ bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& re LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance("group_picker", LLSD(gAgent.getID())); if (widget) { + widget->removeNoneOption(); widget->setSelectGroupCallback(boost::bind(&LLPanelEstateInfo::addAllowedGroup2, this, _1)); if (parent_floater) { diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 16a10dc502..a3296dbffc 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -159,7 +159,9 @@ LLLocationInputCtrl::Params::Params() add_landmark_image_selected("add_landmark_image_selected"), add_landmark_button("add_landmark_button"), add_landmark_hpad("add_landmark_hpad", 0), - info_button("info_button") + info_button("info_button"), + add_landmark_tool_tip("add_landmark_tool_tip"), + edit_landmark_tool_tip("edit_landmark_tool_tip") { } @@ -170,7 +172,9 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) mLocationContextMenu(NULL), mAddLandmarkBtn(NULL), mLandmarkImageOn(NULL), - mLandmarkImageOff(NULL) + mLandmarkImageOff(NULL), + mAddLandmarkTooltip(p.add_landmark_tool_tip), + mEditLandmarkTooltip(p.edit_landmark_tool_tip) { // Lets replace default LLLineEditor with LLLocationLineEditor // to make needed escaping while copying and cutting url @@ -261,9 +265,6 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) mAddLandmarkObserver = new LLAddLandmarkObserver(this); gInventory.addObserver(mRemoveLandmarkObserver); gInventory.addObserver(mAddLandmarkObserver); - - mAddLandmarkTooltip = LLTrans::getString("location_ctrl_add_landmark"); - mEditLandmarkTooltip = LLTrans::getString("location_ctrl_edit_landmark"); } LLLocationInputCtrl::~LLLocationInputCtrl() diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index c74a294ca3..cd5c482005 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -66,6 +66,8 @@ public: Optional add_landmark_hpad; Optional add_landmark_button, info_button; + Optional add_landmark_tool_tip; + Optional edit_landmark_tool_tip; Params(); }; diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 071744c33a..f620e8f2d7 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2828,11 +2828,6 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Wild Wrinkles - - Add to My Landmarks - Edit My Landmark - (Loading...) - [APP_NAME] Update diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index defa6ff00d..d86103aedc 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -18,6 +18,8 @@ max_chars="20" follows="left|top" allow_new_values="true" + add_landmark_tool_tip="Add this to My Landmarks" + edit_landmark_tool_tip="Edit My Landmark" > Date: Wed, 14 Oct 2009 10:40:56 +0000 Subject: Merge a big bunch of fixes from maint-viewer. Hooray. svn merge -r136066:136073 svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-viewer/maint-viewer-24-qa-9 DEV-8553 New Server Tools - Prep Land For Sale DEV-32942 (QAR-1521) Bad border crossings or TP / Ruthing issues DEV-32942 (QAR-1521) Bad border crossings or TP / Ruthing issues DEV-33239 VWR-13816: Resizing the Search Window Causes the Results to Refresh back to First Page DEV-27746 Running a dev build of Second Life will make console window show up on non-dev builds (Windows) DEV-33209 Linux 1.24.0.120778 client fails to run DEV-29123 SVC-3871: Crash of viewer when clicking on ghost objects at (0,0,0) on a sim DEV-35433 Attempting to upload wrong file type crashes viewer DEV-33499 viewer2009 is not using KDU DEV-33912 Griefing viewer crashes others' viewers with malformed sound files DEV-3784 VWR-138: Animation Priority not working correctly, Can't create new AOs DEV-20678 VWR-9069: Region variable says 'Region Name' in AR if no object is selected DEV-19934 Help->About Second Life doesn't differentiate between 32- and 64-bit Vista DEV-6604 Restored folders have 'Purge Item' and 'Restore Item' options DEV-12867 VWR-5717: Selected Text is not replaced by Input text when Japanese IME is on DEV-11894 Notecards/Texture windows don't open completely when opened from inventory DEV-10641 VWR-4955: Local Chat doesn't show end of last conversation DEV-30039 VWR-12620: Viewer build fails on Linux when compiled with -O2 (--type=Release) DEV-20944 VWR-9065: (intermittent) Right Click >profile on avatar does not display profile DEV-24828 Menu accelerator prefixes shouldn't be hard-coded DEV-34529 VWR-14267: Clicking send in an IM window does not add the sent text to the line editor history DEV-34124 Invite to group, search by name will not show resident if their first name is two characters DEV-20930 VWR-9248: On Mac: the "--url" option causes a command line parsing error DEV-35306 Adult keyword filter triggers multiple warnings DEV-35503 VWR-3595: "Second Life requires True Color (32-bit) to run in a window" message is incorrect DEV-35656 VWR-12995: FTBFS: error: format '%-3d' expects type 'int', but argument 3 has type 'size_t' DEV-30043 VWR-12533: Linux viewer build for OpenAL fails during packaging unless FMOD library is available DEV-31898 VWR-13202: Right clicking mouse triggers arrow key control events DEV-32610 Keyboard shortcuts on OSX viewer overridden by OSX DEV-27067 Coverity Prevent: EVALUATION_ORDER defects DEV-26188 VWR-2242: Specially formatted .BVH file can cause avatar distortion DEV-25475 About Land dialog no longer shows Area: field DEV-19897 OSX Viewer Installer (for an RC) opens with poor positioning DEV-22837 Inventory> Search Recent Items highlighting incorrect characters DEV-21709 VWR-9377: Mapping will default to leave exact sim name listing first. (Searching Gar forces Gar to come up and not Garden of Dreams) DEV-23079 implement volume serial for linux client DEV-13930 VWR-6432: Space Navigator operation with vehicles is broken DEV-27666 VWR-10829: Linux Viewer: CLICK_ACTION_PAY shows CLICK_ACTION_PLAY icon DEV-23670 Viewer crashes on startup if installed into a custom folder with Korean, Japanese or Chinese characters in path DEV-19313 VWR-8454: PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS not highlighted in script editor DEV-19918 VWR-8885: Move character/*.xml files to source bundle DEV-25555 VWR-11172: A source coding mistake prevents number-pad keys from specifying Ctrl+digit shortcuts on Windows DEV-8536 VWR-4057: Multi-line chat display bug - first character in line missing DEV-29592 Mac LLFastTimer uses wall clock instead of Intel PMU DEV-29644 VWR-12587: Cmake install target has a hard coded secondlife-bin reference remaining DEV-25320 VWR-11128: Python not always detected by develop.py DEV-30040 VWR-12617: Poor type name that violates Coding Standard breaks compatibility with system header files DEV-30380 indra/newview/res-sdl/toolpay.BMP is modified during ./develop.py configure DEV-31247 VWR-12763: non-portable printf specifier used with size_t causes FTBFS on 64bit (due to -Werror) DEV-29565 VWR-12569: A comment in lluistring.h contains undefined UTF-8 code sequences DEV-22100 VWR-9620: send_parcel_select_objects in newview/llfloaterland.cpp uses the wrong datatype for the ReturnType field causing a warning DEV-31911 Selected objects / primitives should be greyed out when nothing is selected DEV-3667 Windows: Accelerator keys should be "Ctrl+X" rather than "Ctrl-X" DEV-27223 disable gstreamer on 64-bit linux DEV-8172 We Need a Linden Sale Option to Sell Land to Anyone DEV-25511 VWR-10311: Enable LipSync by default DEV-20443 Revamp group creation confirmation dialog to be more communicative DEV-20132 VWR-7800: Joystick / SpaceNavigator. Camera should remain in position when exiting flycam mode into avatar mode. DEV-18420 VWR-8393: Have build scripts copy fmod from an external location DEV-24841 VWR-10717: Right Space Navigator button should toggle fly in avatar movment, not jump/flyup. DEV-28457 change auto-populate value in buy L$ window from 1000 to 2000 DEV-15545 VWR-3725: Please add resize option to the SEARCH window UI --- doc/contributions.txt | 56 ++-- indra/cmake/00-Common.cmake | 2 + indra/cmake/LLWindow.cmake | 2 +- indra/cmake/Python.cmake | 4 + indra/linux_crash_logger/CMakeLists.txt | 2 +- indra/llaudio/llaudiodecodemgr.cpp | 35 ++- indra/llaudio/llvorbisencode.cpp | 6 +- indra/llaudio/llvorbisencode.h | 11 + indra/llcharacter/llbvhloader.cpp | 13 + indra/llcharacter/llbvhloader.h | 7 +- indra/llcharacter/llgesture.cpp | 2 +- indra/llcharacter/lljointsolverrp3.cpp | 2 +- indra/llcommon/llerror.h | 4 +- indra/llcommon/llstring.h | 1 + indra/llcommon/llsys.cpp | 39 ++- indra/llimage/llimage.cpp | 2 +- indra/llinventory/llparcel.cpp | 1 - indra/llmath/llvolume.cpp | 2 +- indra/llmessage/lltemplatemessagebuilder.cpp | 4 +- indra/llmessage/lltemplatemessagereader.cpp | 7 +- indra/llrender/CMakeLists.txt | 2 + indra/llrender/llcubemap.cpp | 2 +- indra/llrender/llfontfreetype.cpp | 5 +- indra/llrender/llfontgl.cpp | 1 + indra/llrender/llglheaders.h | 4 - indra/llrender/llimagegl.cpp | 2 +- indra/llui/lllineeditor.cpp | 64 +++-- indra/llui/lllineeditor.h | 5 +- indra/llui/llmenugl.cpp | 42 +-- indra/llui/llresmgr.cpp | 8 + indra/llui/lluistring.h | 4 +- indra/llvfs/CMakeLists.txt | 1 + indra/llvfs/lldir.cpp | 16 +- indra/llvfs/lldir.h | 1 + indra/llvfs/lldir_mac.cpp | 3 +- indra/llvfs/lldir_win32.cpp | 21 +- indra/llvfs/lldirguard.h | 78 ++++++ indra/llwindow/llkeyboard.cpp | 69 ++++- indra/llwindow/llkeyboard.h | 9 +- indra/llwindow/llkeyboardwin32.cpp | 2 +- indra/llwindow/llwindowmacosx.cpp | 6 +- indra/llwindow/llwindowsdl.cpp | 18 +- indra/llxuixml/lltrans.h | 5 + indra/newview/CMakeLists.txt | 11 +- indra/newview/app_settings/keywords.ini | 1 + indra/newview/app_settings/settings.xml | 15 +- .../installers/darwin/firstlook-dmg/_DS_Store | Bin 12292 -> 12292 bytes .../installers/darwin/publicnightly-dmg/_DS_Store | Bin 12292 -> 12292 bytes .../darwin/releasecandidate-dmg/_DS_Store | Bin 12292 -> 12292 bytes indra/newview/llagent.cpp | 21 +- indra/newview/llagent.h | 4 +- indra/newview/llappviewer.cpp | 20 +- indra/newview/llappviewerlinux.cpp | 26 +- indra/newview/llappviewerlinux.h | 5 +- indra/newview/llappviewerlinux_api_dbus.cpp | 6 +- indra/newview/llappviewermacosx.cpp | 19 +- indra/newview/lldrawpoolwater.cpp | 2 +- indra/newview/llfloateranimpreview.cpp | 10 +- indra/newview/llfloaterauction.cpp | 293 ++++++++++++++++++++- indra/newview/llfloaterauction.h | 16 +- indra/newview/llfloateravatarpicker.cpp | 11 +- indra/newview/llfloateravatarpicker.h | 2 +- indra/newview/llfloatergesture.cpp | 25 +- indra/newview/llfloaterland.cpp | 4 +- indra/newview/llfloaterreporter.cpp | 1 + indra/newview/llfloatersellland.cpp | 2 +- indra/newview/llfloatertools.cpp | 5 + indra/newview/llfloaterworldmap.cpp | 40 +-- indra/newview/llfloaterworldmap.h | 1 - indra/newview/llimpanel.cpp | 2 + indra/newview/llinventorybridge.cpp | 2 + indra/newview/llinventoryfilter.cpp | 7 + indra/newview/llmaniprotate.cpp | 4 +- indra/newview/llpanelgroup.cpp | 8 +- indra/newview/llpanelgroupgeneral.cpp | 2 +- indra/newview/llpreviewgesture.cpp | 2 +- indra/newview/llpreviewscript.cpp | 4 +- indra/newview/llpreviewtexture.cpp | 113 +++++++- indra/newview/llpreviewtexture.h | 6 +- indra/newview/llselectmgr.cpp | 2 +- indra/newview/llsky.cpp | 3 + indra/newview/llsky.h | 6 +- indra/newview/llstartup.cpp | 7 + indra/newview/lltexturefetch.cpp | 2 +- indra/newview/llviewercamera.cpp | 5 +- indra/newview/llviewercontrol.cpp | 2 +- indra/newview/llviewerjoystick.cpp | 87 ++++-- indra/newview/llviewerjoystick.h | 5 +- indra/newview/llviewermedia.cpp | 1 + indra/newview/llviewermenu.cpp | 92 +++++++ indra/newview/llviewermenufile.cpp | 2 +- indra/newview/llviewerobjectlist.cpp | 99 ++++--- indra/newview/llviewerwindow.cpp | 5 - indra/newview/llvoiceclient.cpp | 28 +- indra/newview/llvosky.cpp | 2 +- indra/newview/llvosky.h | 2 +- indra/newview/llwaterparammanager.cpp | 2 +- indra/newview/llwlparammanager.cpp | 2 +- indra/newview/llxmlrpctransaction.cpp | 10 +- indra/newview/llxmlrpctransaction.h | 6 +- indra/newview/pipeline.cpp | 6 +- indra/newview/res-sdl/arrow.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/arrowcop.BMP | Bin 0 -> 3126 bytes indra/newview/res-sdl/arrowcopmulti.BMP | Bin 0 -> 3126 bytes indra/newview/res-sdl/arrowdrag.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/circleandline.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/cross.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/hand.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/ibeam.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/ll_icon.BMP | Bin 0 -> 5174 bytes indra/newview/res-sdl/llarrow.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/llarrowdrag.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/llarrowdragmulti.BMP | Bin 0 -> 3126 bytes indra/newview/res-sdl/llarrowlocked.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/llgrablocked.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/llno.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/llnolocked.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/lltoolcamera.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/lltoolcreate.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/lltoolfocus.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/lltoolgrab.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/lltoolland.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/lltoolpan.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/lltoolpipette.BMP | Bin 0 -> 3126 bytes indra/newview/res-sdl/lltoolrotate.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/lltoolscale.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/lltooltranslate.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/lltoolzoomin.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/lltoolzoomout.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/sizenesw.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/sizens.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/sizenwse.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/sizewe.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/toolmediaopen.BMP | Bin 0 -> 3128 bytes indra/newview/res-sdl/toolpause.BMP | Bin 0 -> 3128 bytes indra/newview/res-sdl/toolpickobject.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/toolpickobject2.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/toolpickobject3.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/toolplay.BMP | Bin 0 -> 3128 bytes indra/newview/res-sdl/wait.BMP | Bin 0 -> 2102 bytes indra/newview/res-sdl/working.BMP | Bin 0 -> 2102 bytes .../skins/default/xui/en/floater_auction.xml | 42 ++- .../default/xui/en/floater_preview_texture.xml | 62 ++++- .../newview/skins/default/xui/en/floater_tools.xml | 2 - .../skins/default/xui/en/floater_world_map.xml | 3 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 69 ++++- .../newview/skins/default/xui/en/notifications.xml | 30 +-- .../skins/default/xui/en/panel_group_general.xml | 2 +- .../default/xui/en/panel_preferences_advanced.xml | 29 +- indra/newview/skins/default/xui/en/strings.xml | 16 +- indra/newview/viewer_manifest.py | 16 +- indra/test/lltut.h | 2 +- install.xml | 18 +- 153 files changed, 1468 insertions(+), 459 deletions(-) create mode 100644 indra/llvfs/lldirguard.h create mode 100644 indra/newview/res-sdl/arrow.BMP create mode 100644 indra/newview/res-sdl/arrowcop.BMP create mode 100644 indra/newview/res-sdl/arrowcopmulti.BMP create mode 100644 indra/newview/res-sdl/arrowdrag.BMP create mode 100644 indra/newview/res-sdl/circleandline.BMP create mode 100644 indra/newview/res-sdl/cross.BMP create mode 100644 indra/newview/res-sdl/hand.BMP create mode 100644 indra/newview/res-sdl/ibeam.BMP create mode 100644 indra/newview/res-sdl/ll_icon.BMP create mode 100644 indra/newview/res-sdl/llarrow.BMP create mode 100644 indra/newview/res-sdl/llarrowdrag.BMP create mode 100644 indra/newview/res-sdl/llarrowdragmulti.BMP create mode 100644 indra/newview/res-sdl/llarrowlocked.BMP create mode 100644 indra/newview/res-sdl/llgrablocked.BMP create mode 100644 indra/newview/res-sdl/llno.BMP create mode 100644 indra/newview/res-sdl/llnolocked.BMP create mode 100644 indra/newview/res-sdl/lltoolcamera.BMP create mode 100644 indra/newview/res-sdl/lltoolcreate.BMP create mode 100644 indra/newview/res-sdl/lltoolfocus.BMP create mode 100644 indra/newview/res-sdl/lltoolgrab.BMP create mode 100644 indra/newview/res-sdl/lltoolland.BMP create mode 100644 indra/newview/res-sdl/lltoolpan.BMP create mode 100644 indra/newview/res-sdl/lltoolpipette.BMP create mode 100644 indra/newview/res-sdl/lltoolrotate.BMP create mode 100644 indra/newview/res-sdl/lltoolscale.BMP create mode 100644 indra/newview/res-sdl/lltooltranslate.BMP create mode 100644 indra/newview/res-sdl/lltoolzoomin.BMP create mode 100644 indra/newview/res-sdl/lltoolzoomout.BMP create mode 100644 indra/newview/res-sdl/sizenesw.BMP create mode 100644 indra/newview/res-sdl/sizens.BMP create mode 100644 indra/newview/res-sdl/sizenwse.BMP create mode 100644 indra/newview/res-sdl/sizewe.BMP create mode 100644 indra/newview/res-sdl/toolmediaopen.BMP create mode 100644 indra/newview/res-sdl/toolpause.BMP create mode 100644 indra/newview/res-sdl/toolpickobject.BMP create mode 100644 indra/newview/res-sdl/toolpickobject2.BMP create mode 100644 indra/newview/res-sdl/toolpickobject3.BMP create mode 100644 indra/newview/res-sdl/toolplay.BMP create mode 100644 indra/newview/res-sdl/wait.BMP create mode 100644 indra/newview/res-sdl/working.BMP (limited to 'indra/llui') diff --git a/doc/contributions.txt b/doc/contributions.txt index 9b3087a0ac..6b51e2649e 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1,7 +1,7 @@ Linden Lab would like to acknowledge source code contributions from the -following residents. The Second Life resident name is given below, +following residents. The Second Life resident name is given below, along with the issue identifier corresponding to the patches we've -received from them. To see more about these contributions, visit the +received from them. To see more about these contributions, visit the browsable version: http://wiki.secondlife.com/wiki/Source_contributions Able Whitman @@ -25,19 +25,25 @@ Aimee Trescothick VWR-6348 VWR-6358 VWR-6360 + VWR-6432 VWR-6550 VWR-6583 VWR-6482 VWR-7109 VWR-7383 + VWR-7800 + VWR-8008 VWR-8341 VWR-8430 VWR-8482 VWR-9255 + VWR-10717 VWR-10990 VWR-11100 VWR-11111 - VWR-11844 + VWR-11844 + VWR-14267 + VWR-14278 VWR-14087 Alejandro Rosenthal VWR-1184 @@ -45,9 +51,11 @@ Aleric Inglewood VWR-10001 VWR-10759 VWR-10837 + VWR-12691 VWR-13996 + VWR-14426 Ales Beaumont - VWR-9352 + VWR-9352 Alissa Sabre VWR-81 VWR-83 @@ -69,7 +77,7 @@ Alissa Sabre VWR-1351 VWR-1353 VWR-1410 - VWR-1843 + VWR-1843 VWR-2116 VWR-2826 VWR-3290 @@ -77,19 +85,25 @@ Alissa Sabre VWR-3857 VWR-4010 VWR-5575 - VWR-5929 - VWR-6384 - VWR-6385 + VWR-5717 + VWR-5929 + VWR-6384 + VWR-6385 VWR-6386 - VWR-6430 + VWR-6430 VWR-6858 - VWR-6668 - VWR-7086 - VWR-7087 - VWR-7153 - VWR-7168 + VWR-6668 + VWR-7086 + VWR-7087 + VWR-7153 + VWR-7168 VWR-9190 VWR-10728 + VWR-11172 + VWR-12569 + VWR-12617 + VWR-12620 + VWR-12789 Angus Boyd VWR-592 Ann Congrejo @@ -147,6 +161,7 @@ Carjay McGinnis VWR-4212 VWR-6154 VWR-9400 + VWR-9620 Catherine Pfeffer VWR-1282 VWR-8624 @@ -294,6 +309,7 @@ Kerutsen Sellery VWR-1350 Khyota Wulluf VWR-2085 + VWR-8885 VWR-9256 VWR-9966 Kunnis Basiat @@ -336,6 +352,7 @@ McCabe Maxsted VWR-7877 VWR-7893 VWR-8080 + VWR-8454 VWR-8689 VWR-9007 Michelle2 Zenovka @@ -350,6 +367,7 @@ Michelle2 Zenovka VWR-5082 VWR-5659 VWR-7831 + VWR-8885 VWR-8889 VWR-8310 VWR-9499 @@ -464,7 +482,7 @@ Pf Shan CT-321 princess niven VWR-5733 - CT-85 + CT-85 CT-320 CT-352 Renault Clio @@ -481,7 +499,11 @@ Ringo Tuxing Robin Cornelius VWR-2488 VWR-9557 + VWR-11128 + VWR-12533 VWR-12587 + VWR-12763 + VWR-12995 Ryozu Kojima VWR-53 VWR-287 @@ -564,12 +586,16 @@ TBBle Kurosawa VWR-1892 Teardrops Fall VWR-5366 +Techwolf Lupindo + SNOW-92 + VWR-12385 tenebrous pau VWR-247 Tharax Ferraris VWR-605 Thickbrick Sleaford VWR-7109 + VWR-9287 VWR-13947 Thraxis Epsilon SVC-371 diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 2a70263446..b168c08552 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -170,6 +170,8 @@ if (LINUX) if (NOT STANDALONE) # this stops us requiring a really recent glibc at runtime add_definitions(-fno-stack-protector) + # linking can be so slow - give us a chance to figure out why + set(CMAKE_CXX_LINK_FLAGS "-Wl,--stats,--no-keep-memory") endif (NOT STANDALONE) endif (VIEWER) diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index c0efa27f6e..a5b9cf47a4 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -13,9 +13,9 @@ if (STANDALONE) SDL_LIBRARY ) else (STANDALONE) - use_prebuilt_binary(SDL) use_prebuilt_binary(mesa) if (LINUX AND VIEWER) + use_prebuilt_binary(SDL) set (SDL_FOUND TRUE) set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux) set (SDL_LIBRARY SDL) diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake index 4f86d3234e..0901c1b7a2 100644 --- a/indra/cmake/Python.cmake +++ b/indra/cmake/Python.cmake @@ -13,6 +13,10 @@ if (WINDOWS) [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath] + [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath] + [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath] + [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] + [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath] ) elseif (EXISTS /etc/debian_version) # On Debian and Ubuntu, avoid Python 2.4 if possible. diff --git a/indra/linux_crash_logger/CMakeLists.txt b/indra/linux_crash_logger/CMakeLists.txt index 6f6754ed7a..4b19e28066 100644 --- a/indra/linux_crash_logger/CMakeLists.txt +++ b/indra/linux_crash_logger/CMakeLists.txt @@ -38,7 +38,7 @@ list(APPEND linux_crash_logger_SOURCE_FILES ${linux_crash_logger_HEADER_FILES} ) -list(APPEND CMAKE_EXE_LINKER_FLAGS -Wl,--as-needed) +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") add_executable(linux-crash-logger ${linux_crash_logger_SOURCE_FILES}) diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index 099c4eba40..ae959eaa81 100644 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -43,6 +43,8 @@ #include "llassetstorage.h" #include "llrefcount.h" +#include "llvorbisencode.h" + #include "vorbis/codec.h" #include "vorbis/vorbisfile.h" @@ -218,11 +220,42 @@ BOOL LLVorbisDecodeState::initDecode() return(FALSE); } - size_t size_guess = (size_t)ov_pcm_total(&mVF, -1); + S32 sample_count = ov_pcm_total(&mVF, -1); + size_t size_guess = (size_t)sample_count; vorbis_info* vi = ov_info(&mVF, -1); size_guess *= vi->channels; size_guess *= 2; size_guess += 2048; + + bool abort_decode = false; + + if( vi->channels < 1 || vi->channels > LLVORBIS_CLIP_MAX_CHANNELS ) + { + abort_decode = true; + llwarns << "Bad channel count: " << vi->channels << llendl; + } + + if( (size_t)sample_count > LLVORBIS_CLIP_REJECT_SAMPLES ) + { + abort_decode = true; + llwarns << "Illegal sample count: " << sample_count << llendl; + } + + if( size_guess > LLVORBIS_CLIP_REJECT_SIZE ) + { + abort_decode = true; + llwarns << "Illegal sample size: " << size_guess << llendl; + } + + if( abort_decode ) + { + llwarns << "Canceling initDecode. Bad asset: " << mUUID << llendl; + llwarns << "Bad asset encoded by: " << ov_comment(&mVF,-1)->vendor << llendl; + delete mInFilep; + mInFilep = NULL; + return FALSE; + } + mWAVBuffer.reserve(size_guess); mWAVBuffer.resize(WAV_HEADER_SIZE); diff --git a/indra/llaudio/llvorbisencode.cpp b/indra/llaudio/llvorbisencode.cpp index 8ee082a245..0c1ad8191c 100644 --- a/indra/llaudio/llvorbisencode.cpp +++ b/indra/llaudio/llvorbisencode.cpp @@ -162,13 +162,13 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro return(LLVORBISENC_PCM_FORMAT_ERR); } - if ((num_channels < 1) || (num_channels > 2)) + if ((num_channels < 1) || (num_channels > LLVORBIS_CLIP_MAX_CHANNELS)) { error_msg = "SoundFileInvalidChannelCount"; return(LLVORBISENC_MULTICHANNEL_ERR); } - if (sample_rate != 44100) + if (sample_rate != LLVORBIS_CLIP_SAMPLE_RATE) { error_msg = "SoundFileInvalidSampleRate"; return(LLVORBISENC_UNSUPPORTED_SAMPLE_RATE); @@ -188,7 +188,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro F32 clip_length = (F32)raw_data_length/(F32)bytes_per_sec; - if (clip_length > 10.0f) + if (clip_length > LLVORBIS_CLIP_MAX_TIME) { error_msg = "SoundFileInvalidTooLong"; return(LLVORBISENC_CLIP_TOO_LONG); diff --git a/indra/llaudio/llvorbisencode.h b/indra/llaudio/llvorbisencode.h index ff5ce3a053..6531c1919e 100644 --- a/indra/llaudio/llvorbisencode.h +++ b/indra/llaudio/llvorbisencode.h @@ -45,6 +45,17 @@ const S32 LLVORBISENC_UNSUPPORTED_SAMPLE_RATE = 8; // unsupported sample ra const S32 LLVORBISENC_UNSUPPORTED_WORD_SIZE = 9; // unsupported word size const S32 LLVORBISENC_CLIP_TOO_LONG = 10; // source file is too long +const F32 LLVORBIS_CLIP_MAX_TIME = 10.0f; +const U8 LLVORBIS_CLIP_MAX_CHANNELS = 2; +const U32 LLVORBIS_CLIP_SAMPLE_RATE = 44100; +const U32 LLVORBIS_CLIP_MAX_SAMPLES_PER_CHANNEL = (U32)(LLVORBIS_CLIP_MAX_TIME * LLVORBIS_CLIP_SAMPLE_RATE); +const U32 LLVORBIS_CLIP_MAX_SAMPLES = LLVORBIS_CLIP_MAX_SAMPLES_PER_CHANNEL * LLVORBIS_CLIP_MAX_CHANNELS; +const size_t LLVORBIS_CLIP_MAX_SAMPLE_DATA = LLVORBIS_CLIP_MAX_SAMPLES * 2; // 2 = 16-bit + +// Treat anything this long as a bad asset. A little fudge factor at the end: +// Make that a lot of fudge factor. We're allowing 30 sec for now - 3x legal upload +const size_t LLVORBIS_CLIP_REJECT_SAMPLES = LLVORBIS_CLIP_MAX_SAMPLES * 3; +const size_t LLVORBIS_CLIP_REJECT_SIZE = LLVORBIS_CLIP_MAX_SAMPLE_DATA * 3; S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg); S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname); diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 24391eb8f3..3dd54b4760 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -91,7 +91,9 @@ const char *LLBVHLoader::ST_NO_XLT_EASEIN = "Can't get easeIn values."; const char *LLBVHLoader::ST_NO_XLT_EASEOUT = "Can't get easeOut values."; const char *LLBVHLoader::ST_NO_XLT_HAND = "Can't get hand morph value."; const char *LLBVHLoader::ST_NO_XLT_EMOTE = "Can't read emote name."; +const char *LLBVHLoader::ST_BAD_ROOT = "Illegal ROOT joint."; */ + //------------------------------------------------------------------------ // find_next_whitespace() //------------------------------------------------------------------------ @@ -777,6 +779,17 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 & return E_ST_NO_NAME; } + //--------------------------------------------------------------- + // we require the root joint be "hip" - DEV-26188 + //--------------------------------------------------------------- + const char* FORCED_ROOT_NAME = "hip"; + if ( (mJoints.size() == 0 ) && ( !strstr(jointName, FORCED_ROOT_NAME) ) ) + { + strncpy(error_text, line.c_str(), 127); /* Flawfinder: ignore */ + return E_ST_BAD_ROOT; + } + + //---------------------------------------------------------------- // add a set of keyframes for this joint //---------------------------------------------------------------- diff --git a/indra/llcharacter/llbvhloader.h b/indra/llcharacter/llbvhloader.h index ecdfc95478..85ab035e61 100644 --- a/indra/llcharacter/llbvhloader.h +++ b/indra/llcharacter/llbvhloader.h @@ -216,7 +216,8 @@ typedef enum e_load_status E_ST_NO_XLT_EASEIN, E_ST_NO_XLT_EASEOUT, E_ST_NO_XLT_HAND, - E_ST_NO_XLT_EMOTE + E_ST_NO_XLT_EMOTE, + E_ST_BAD_ROOT } ELoadStatus; //------------------------------------------------------------------------ @@ -235,7 +236,7 @@ public: /* // Status Codes - typedef const char *Status; + typedef const char *status_t; static const char *ST_OK; static const char *ST_EOF; static const char *ST_NO_CONSTRAINT; @@ -267,6 +268,7 @@ public: static const char *ST_NO_XLT_EASEOUT; static const char *ST_NO_XLT_HAND; static const char *ST_NO_XLT_EMOTE; + static const char *ST_BAD_ROOT; */ // Loads the specified translation table. ELoadStatus loadTranslationTable(const char *fileName); @@ -325,6 +327,7 @@ protected: BOOL mInitialized; ELoadStatus mStatus; + // computed values F32 mDuration; }; diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index 4ee29fe100..83e4e35b00 100644 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -304,7 +304,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask) } else { - llwarns << "NULL gesture in gesture list (" << i << ")" << llendl + llwarns << "NULL gesture in gesture list (" << i << ")" << llendl; } } return FALSE; diff --git a/indra/llcharacter/lljointsolverrp3.cpp b/indra/llcharacter/lljointsolverrp3.cpp index 0ea92a2d77..6599a76b16 100644 --- a/indra/llcharacter/lljointsolverrp3.cpp +++ b/indra/llcharacter/lljointsolverrp3.cpp @@ -211,7 +211,7 @@ void LLJointSolverRP3::solve() //------------------------------------------------------------------------- LLVector3 abacCompOrthoVec = abVec - acVec * ((abVec * acVec)/(acVec * acVec)); -// llinfos << "abacCompOrthoVec : " << abacCompOrthoVec << llendl +// llinfos << "abacCompOrthoVec : " << abacCompOrthoVec << llendl; //------------------------------------------------------------------------- // compute the normal of the original ABC plane (and store for later) diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 6794be4904..37e922d4b7 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -239,7 +239,7 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG; */ #define lllog(level, broadTag, narrowTag, once) \ - { \ + do { \ static LLError::CallSite _site( \ level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), __FUNCTION__, broadTag, narrowTag, once);\ if (_site.shouldLog()) \ @@ -252,7 +252,7 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG; LLError::End(); \ LLError::Log::flush(_out, _site); \ } \ - } + } while(0) // DEPRECATED: Use the new macros that allow tags and *look* like macros. #define lldebugs lllog(LLError::LEVEL_DEBUG, NULL, NULL, false) diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 8f70726a9e..eca7e922fd 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -34,6 +34,7 @@ #define LL_LLSTRING_H #include +#include #include #include #include "llsd.h" diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 4d03c4d40d..4737421289 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -124,9 +124,42 @@ LLOSInfo::LLOSInfo() : } else if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) { - if(osvi.wProductType == VER_NT_WORKSTATION) - mOSStringSimple = "Microsoft Windows Vista "; - else mOSStringSimple = "Microsoft Windows Vista Server "; + ///get native system info if available.. + typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); ///function pointer for loading GetNativeSystemInfo + SYSTEM_INFO si; //System Info object file contains architecture info + PGNSI pGNSI; //pointer object + ZeroMemory(&si, sizeof(SYSTEM_INFO)); //zero out the memory in information + pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); //load kernel32 get function + if(NULL != pGNSI) //check if it has failed + pGNSI(&si); //success + else + GetSystemInfo(&si); //if it fails get regular system info + //(Warning: If GetSystemInfo it may result in incorrect information in a WOW64 machine, if the kernel fails to load) + + //msdn microsoft finds 32 bit and 64 bit flavors this way.. + //http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx (example code that contains quite a few more flavors + //of windows than this code does (in case it is needed for the future) + if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 ) //check for 64 bit + { + if(osvi.wProductType == VER_NT_WORKSTATION) + mOSStringSimple = "Microsoft Windows Vista 64-bit "; + else + mOSStringSimple = "Microsoft Windows Vista Server 64-bit "; + } + else if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_INTEL ) + { + if(osvi.wProductType == VER_NT_WORKSTATION) + mOSStringSimple = "Microsoft Windows Vista 32-bit "; + else + mOSStringSimple = "Microsoft Windows Vista Server 32-bit "; + } + else // PROCESSOR_ARCHITECTURE_IA64 || PROCESSOR_ARCHITECTURE_UNKNOWN not checked + { + if(osvi.wProductType == VER_NT_WORKSTATION) + mOSStringSimple = "Microsoft Windows Vista "; + else + mOSStringSimple = "Microsoft Windows Vista Server "; + } } else // Use the registry on early versions of Windows NT. { diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 488f3bf78d..9bbc55509d 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -159,7 +159,7 @@ U8* LLImageBase::allocateData(S32 size) size = mWidth * mHeight * mComponents; if (size <= 0) { - llerrs << llformat("LLImageBase::allocateData called with bad dimentions: %dx%dx%d",mWidth,mHeight,mComponents) << llendl; + llerrs << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,mComponents) << llendl; } } else if (size <= 0 || (size > 4096*4096*16 && sSizeOverride == FALSE)) diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index e48690908e..f208d82084 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -706,7 +706,6 @@ void LLParcel::packMessage(LLSD& msg) msg["category"] = (U8)mCategory; msg["auth_buyer_id"] = mAuthBuyerID; msg["snapshot_id"] = mSnapshotID; - msg["snapshot_id"] = mSnapshotID; msg["user_location"] = ll_sd_from_vector3(mUserLocation); msg["user_look_at"] = ll_sd_from_vector3(mUserLookAt); msg["landing_type"] = (U8)mLandingType; diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 5cc0a596fd..b8ef92f9a9 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4273,7 +4273,7 @@ LLFaceID LLVolume::generateFaceMask() } break; default: - llerrs << "Unknown profile!" << llendl + llerrs << "Unknown profile!" << llendl; break; } diff --git a/indra/llmessage/lltemplatemessagebuilder.cpp b/indra/llmessage/lltemplatemessagebuilder.cpp index e6419807ff..6400310c46 100644 --- a/indra/llmessage/lltemplatemessagebuilder.cpp +++ b/indra/llmessage/lltemplatemessagebuilder.cpp @@ -728,9 +728,9 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat // out gracefully from this function. XXXTBD llerrs << "buildBlock failed. " << "Attempted to pack " - << result + mvci.getSize() + << (result + mvci.getSize()) << " bytes into a buffer with size " - << buffer_size << "." << llendl + << buffer_size << "." << llendl; } } } diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index 8c9eb7ed42..6682575ca5 100644 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -678,12 +678,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender // default to 0s. U32 size = mvci.getSize(); - std::vector data(size); - if(size) - { - // Nonsense test to get past GCC 4.3.1 bug with -O3 - memset(&(data[0]), 0, size); - } + std::vector data(size, 0); cur_data_block->addData(mvci.getName(), &(data[0]), size, mvci.getType()); } diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index aac650bec9..5c13df9f81 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -9,6 +9,7 @@ include(LLCommon) include(LLImage) include(LLMath) include(LLRender) +include(LLVFS) include(LLWindow) include(LLXML) include(LLVFS) @@ -19,6 +20,7 @@ include_directories( ${LLIMAGE_INCLUDE_DIRS} ${LLMATH_INCLUDE_DIRS} ${LLRENDER_INCLUDE_DIRS} + ${LLVFS_INCLUDE_DIRS} ${LLWINDOW_INCLUDE_DIRS} ${LLXML_INCLUDE_DIRS} ${LLVFS_INCLUDE_DIRS} diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index 754d90c854..08a96b4e31 100644 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -106,7 +106,7 @@ void LLCubeMap::initGL() } else { - llwarns << "Using cube map without extension!" << llendl + llwarns << "Using cube map without extension!" << llendl; } } diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 44e997340e..1246cfc44b 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -364,7 +364,7 @@ BOOL LLFontFreetype::addChar(llwchar wch) const glyph_index = FT_Get_Char_Index(mFTFace, wch); if (glyph_index == 0) { - //llinfos << "Trying to add glyph from fallback font!" << llendl + //llinfos << "Trying to add glyph from fallback font!" << llendl; font_vector_t::const_iterator iter; for(iter = mFallbackFonts.begin(); iter != mFallbackFonts.end(); iter++) { @@ -534,11 +534,10 @@ void LLFontFreetype::renderGlyph(U32 glyph_index) const void LLFontFreetype::reset(F32 vert_dpi, F32 horz_dpi) { resetBitmapCache(); + loadFace(mName, mPointSize, vert_dpi ,horz_dpi, mFontBitmapCachep->getNumComponents(), mIsFallback); if (!mIsFallback) { // This is the head of the list - need to rebuild ourself and all fallbacks. - loadFace(mName, mPointSize, vert_dpi ,horz_dpi, mFontBitmapCachep->getNumComponents(), mIsFallback); - if (mFallbackFonts.empty()) { llwarns << "LLFontGL::reset(), no fallback fonts present" << llendl; diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index f7bab3de67..2d7b9760e8 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -44,6 +44,7 @@ #include "llstl.h" #include "v4color.h" #include "lltexture.h" +#include "lldir.h" // Third party library includes #include diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index c7178a5552..f33ae7d8f0 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -53,8 +53,6 @@ # include "GL/glxext.h" //# define GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddressARB((const GLubyte*)(p)) # define GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddress((const GLubyte*)(p)) -// the X headers define 'Status'. Undefine to avoid confusion. -#undef Status // The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly // This header is distributed with SL. You'll find it in linden/libraries/include/GL/ @@ -277,8 +275,6 @@ extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT; // Use glXGetProcAddressARB instead of glXGetProcAddress - the ARB symbol // is considered 'legacy' but works on more machines. # define GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddressARB((const GLubyte*)(p)) -// Whee, the X headers define 'Status'. Undefine to avoid confusion. -#undef Status #endif // LL_LINUX && !LL_MESA_HEADLESS #if LL_LINUX && defined(WINGDIAPI) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index dd64d753c7..e5fea5b995 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -428,7 +428,7 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents) // Check if dimensions are a power of two! if (!checkSize(width,height)) { - llerrs << llformat("Texture has non power of two dimention: %dx%d",width,height) << llendl; + llerrs << llformat("Texture has non power of two dimension: %dx%d",width,height) << llendl; } if (mTexName) diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 693ea5bb45..0db515ab41 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -148,6 +148,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) mBgImage( p.background_image ), mBgImageDisabled( p.background_image_disabled ), mBgImageFocused( p.background_image_focused ), + mHaveHistory(FALSE), mReplaceNewlinesWithSpaces( TRUE ), mLabel(p.label), mCursorColor(p.cursor_color()), @@ -164,13 +165,8 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) mTripleClickTimer.reset(); setText(p.default_text()); - // line history support: - // - initialize line history list - mLineHistory.insert( mLineHistory.end(), "" ); - // - disable line history by default - mHaveHistory = FALSE; - // - reset current history line pointer - mCurrentHistoryLine = 0; + // Initialize current history line iterator + mCurrentHistoryLine = mLineHistory.begin(); LLRect border_rect(getLocalRect()); // adjust for gl line drawing glitch @@ -278,16 +274,31 @@ void LLLineEditor::updateHistory() // reset current history line number. // Be sure only to remember lines that are not empty and that are // different from the last on the list. - if( mHaveHistory && mText.length() && ( mLineHistory.empty() || getText() != mLineHistory.back() ) ) + if( mHaveHistory && getLength() ) { - // discard possible empty line at the end of the history - // inserted by setText() - if( !mLineHistory.back().length() ) + if( !mLineHistory.empty() ) { - mLineHistory.pop_back(); + // When not empty, last line of history should always be blank. + if( mLineHistory.back().empty() ) + { + // discard the empty line + mLineHistory.pop_back(); + } + else + { + LL_WARNS("") << "Last line of history was not blank." << LL_ENDL; + } } - mLineHistory.insert( mLineHistory.end(), getText() ); - mCurrentHistoryLine = mLineHistory.size() - 1; + + // Add text to history, ignoring duplicates + if( mLineHistory.empty() || getText() != mLineHistory.back() ) + { + mLineHistory.push_back( getText() ); + } + + // Restore the blank line and set mCurrentHistoryLine to point at it + mLineHistory.push_back( "" ); + mCurrentHistoryLine = mLineHistory.end() - 1; } } @@ -357,11 +368,8 @@ void LLLineEditor::setText(const LLStringExplicit &new_text) } setCursor(llmin((S32)mText.length(), getCursor())); - // Newly set text goes always in the last line of history. - // Possible empty strings (as with chat line) will be deleted later. - mLineHistory.insert( mLineHistory.end(), new_text ); // Set current history line to end of history. - mCurrentHistoryLine = mLineHistory.size() - 1; + mCurrentHistoryLine = mLineHistory.end() - 1; mPrevText = mText; } @@ -1254,9 +1262,9 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) case KEY_UP: if( mHaveHistory && ( MASK_CONTROL == mask ) ) { - if( mCurrentHistoryLine > 0 ) + if( mCurrentHistoryLine > mLineHistory.begin() ) { - mText.assign( mLineHistory[ --mCurrentHistoryLine ] ); + mText.assign( *(--mCurrentHistoryLine) ); setCursor(llmin((S32)mText.length(), getCursor())); } else @@ -1271,9 +1279,9 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) case KEY_DOWN: if( mHaveHistory && ( MASK_CONTROL == mask ) ) { - if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.size() - 1 ) + if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.end() - 1 ) { - mText.assign( mLineHistory[ ++mCurrentHistoryLine ] ); + mText.assign( *(++mCurrentHistoryLine) ); setCursor(llmin((S32)mText.length(), getCursor())); } else @@ -2291,14 +2299,20 @@ BOOL LLLineEditor::hasPreeditString() const void LLLineEditor::resetPreedit() { - if (hasPreeditString()) + if (hasSelection()) { - if (hasSelection()) + if (hasPreeditString()) { llwarns << "Preedit and selection!" << llendl; deselect(); } - + else + { + deleteSelection(); + } + } + if (hasPreeditString()) + { const S32 preedit_pos = mPreeditPositions.front(); mText.erase(preedit_pos, mPreeditPositions.back() - preedit_pos); mText.insert(preedit_pos, mPreeditOverwrittenWString); diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 48d68b9935..6e81969f00 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -286,8 +286,9 @@ protected: // line history support: BOOL mHaveHistory; // flag for enabled line history - std::vector mLineHistory; // line history storage - U32 mCurrentHistoryLine; // currently browsed history line + typedef std::vector line_history_t; + line_history_t mLineHistory; // line history storage + line_history_t::iterator mCurrentHistoryLine; // currently browsed history line LLViewBorder* mBorder; const LLFontGL* mGLFont; diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 14bee0465c..cf013efca0 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -279,47 +279,7 @@ BOOL LLMenuItemGL::addToAcceleratorList(std::list *listp) // the current accelerator key and mask to the provided string. void LLMenuItemGL::appendAcceleratorString( std::string& st ) const { - // break early if this is a silly thing to do. - if( KEY_NONE == mAcceleratorKey ) - { - return; - } - - // Append any masks -#ifdef LL_DARWIN - // Standard Mac names for modifier keys in menu equivalents - // We could use the symbol characters, but they only exist in certain fonts. - if( mAcceleratorMask & MASK_CONTROL ) - { - if ( mAcceleratorMask & MASK_MAC_CONTROL ) - { - st.append( "Ctrl-" ); - } - else - { - st.append( "Cmd-" ); // Symbol would be "\xE2\x8C\x98" - } - } - if( mAcceleratorMask & MASK_ALT ) - st.append( "Opt-" ); // Symbol would be "\xE2\x8C\xA5" - if( mAcceleratorMask & MASK_SHIFT ) - st.append( "Shift-" ); // Symbol would be "\xE2\x8C\xA7" -#else - if( mAcceleratorMask & MASK_CONTROL ) - st.append( "Ctrl-" ); - if( mAcceleratorMask & MASK_ALT ) - st.append( "Alt-" ); - if( mAcceleratorMask & MASK_SHIFT ) - st.append( "Shift-" ); -#endif - - std::string keystr = LLKeyboard::stringFromKey( mAcceleratorKey ); - if ((mAcceleratorMask & MASK_NORMALKEYS) && - (keystr[0] == '-' || keystr[0] == '=')) - { - st.append( " " ); - } - st.append( keystr ); + st = LLKeyboard::stringFromAccelerator( mAcceleratorMask, mAcceleratorKey ); LL_DEBUGS("HotKeys") << "appendAcceleratorString: " << st << LL_ENDL; } diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index a4e23a605b..ed870d46d5 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -279,6 +279,14 @@ std::string LLResMgr::getMonetaryString( S32 input ) const void LLResMgr::getIntegerString( std::string& output, S32 input ) const { + // handle special case of input value being zero + if (input == 0) + { + output = "0"; + return; + } + + // *NOTE: this method does not handle negative input integers correctly S32 fraction = 0; std::string fraction_string; S32 remaining_count = input; diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index aedeca27cb..195f21a6a7 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -51,9 +51,9 @@ // llinfos << mMessage.getString() << llendl; // outputs "Welcome Steve to Second Life" // mMessage.setArg("[USERNAME]", "Joe"); // llinfos << mMessage.getString() << llendl; // outputs "Welcome Joe to Second Life" -// mMessage = "Recepci￳n a la [SECONDLIFE] [USERNAME]" +// mMessage = "Bienvenido a la [SECONDLIFE] [USERNAME]" // mMessage.setArg("[SECONDLIFE]", "Segunda Vida"); -// llinfos << mMessage.getString() << llendl; // outputs "Recepci￳n a la Segunda Vida Joe" +// llinfos << mMessage.getString() << llendl; // outputs "Bienvenido a la Segunda Vida Joe" // Implementation Notes: // Attempting to have operator[](const std::string& s) return mArgs[s] fails because we have diff --git a/indra/llvfs/CMakeLists.txt b/indra/llvfs/CMakeLists.txt index cc0297e3dc..0de3fa33f9 100644 --- a/indra/llvfs/CMakeLists.txt +++ b/indra/llvfs/CMakeLists.txt @@ -23,6 +23,7 @@ set(llvfs_HEADER_FILES CMakeLists.txt lldir.h + lldirguard.h lllfsthread.h llpidlock.h llvfile.h diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index 745e53c980..781321e5e4 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -404,6 +404,12 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd prefix = getExecutableDir(); break; + case LL_PATH_FONTS: + prefix = getAppRODataDir(); + prefix += mDirDelimiter; + prefix += "fonts"; + break; + default: llassert(0); } @@ -419,6 +425,11 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd filename = subdir1 + mDirDelimiter + filename; } + if (prefix.empty()) + { + llwarns << "prefix is empty, possible bad filename" << llendl; + } + std::string expanded_filename; if (!filename.empty()) { @@ -673,11 +684,6 @@ void LLDir::dumpCurrentDirectories() LL_DEBUGS2("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL; LL_DEBUGS2("AppInit","Directories") << " SkinBaseDir: " << getSkinBaseDir() << LL_ENDL; LL_DEBUGS2("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL; - -#if LL_LIBXUL_ENABLED - LL_DEBUGS2("AppInit","Directories") << " HTML Path: " << getExpandedFilename( LL_PATH_HTML, "" ) << llendl; - LL_DEBUGS2("AppInit","Directories") << " Mozilla Profile Path: " << getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" ) << llendl; -#endif } diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index 6c9fea6b6a..07c814769e 100644 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -60,6 +60,7 @@ typedef enum ELLPath // LL_PATH_HTML = 16, LL_PATH_EXECUTABLE = 16, LL_PATH_DEFAULT_SKIN = 17, + LL_PATH_FONTS = 18, LL_PATH_LAST } ELLPath; diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp index 346f7dd8ed..7bc6f63e1f 100644 --- a/indra/llvfs/lldir_mac.cpp +++ b/indra/llvfs/lldir_mac.cpp @@ -68,7 +68,8 @@ static void CFStringRefToLLString(CFStringRef stringRef, std::string &llString, { if (stringRef) { - long bufferSize = CFStringGetLength(stringRef) + 1; + long stringSize = CFStringGetLength(stringRef) + 1; + long bufferSize = CFStringGetMaximumSizeForEncoding(stringSize,kCFStringEncodingUTF8); char* buffer = new char[bufferSize]; memset(buffer, 0, bufferSize); if (CFStringGetCString(stringRef, buffer, bufferSize, kCFStringEncodingUTF8)) diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp index 3e302764de..4c376f11a5 100644 --- a/indra/llvfs/lldir_win32.cpp +++ b/indra/llvfs/lldir_win32.cpp @@ -121,17 +121,22 @@ LLDir_Win32::LLDir_Win32() GetCurrentDirectory(MAX_PATH, w_str); mExecutableDir = utf16str_to_utf8str(llutf16string(w_str)); #endif - - // When running in a dev tree, app_settings is under indra/newview/ - // but in production it is under Program Files/SecondLife/ - // Attempt to detect which one we're using. JC - if (mExecutableDir.find("indra") != std::string::npos) - mAppRODataDir = getCurPath(); - else - mAppRODataDir = mExecutableDir; + + mAppRODataDir = "."; mSkinBaseDir = mAppRODataDir + mDirDelimiter + "skins"; + if (mExecutableDir.find("indra") == std::string::npos) + { + // Running from installed directory. Make sure current + // directory isn't something crazy (e.g. if invoking from + // command line). + SetCurrentDirectory(utf8str_to_utf16str(mExecutableDir).c_str()); + GetCurrentDirectory(MAX_PATH, w_str); + mWorkingDir = utf16str_to_utf8str(llutf16string(w_str)); + } + llinfos << "mAppRODataDir = " << mAppRODataDir << llendl; + // Build the default cache directory mDefaultCacheDir = buildSLOSCacheDir(); diff --git a/indra/llvfs/lldirguard.h b/indra/llvfs/lldirguard.h new file mode 100644 index 0000000000..85366120d8 --- /dev/null +++ b/indra/llvfs/lldirguard.h @@ -0,0 +1,78 @@ +/** + * @file lldirguard.h + * @brief Protect working directory from being changed in scope. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, 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_DIRGUARD_H +#define LL_DIRGUARD_H + +#include "linden_common.h" +#include "llerror.h" + +#if LL_WINDOWS +class LLDirectoryGuard +{ +public: + LLDirectoryGuard() + { + mOrigDirLen = GetCurrentDirectory(MAX_PATH, mOrigDir); + } + + ~LLDirectoryGuard() + { + mFinalDirLen = GetCurrentDirectory(MAX_PATH, mFinalDir); + if ((mOrigDirLen!=mFinalDirLen) || + (wcsncmp(mOrigDir,mFinalDir,mOrigDirLen)!=0)) + { + // Dir has changed + std::string mOrigDirUtf8 = utf16str_to_utf8str(llutf16string(mOrigDir)); + std::string mFinalDirUtf8 = utf16str_to_utf8str(llutf16string(mFinalDir)); + llinfos << "Resetting working dir from " << mFinalDirUtf8 << " to " << mOrigDirUtf8 << llendl; + SetCurrentDirectory(mOrigDir); + } + } + +private: + TCHAR mOrigDir[MAX_PATH]; + DWORD mOrigDirLen; + TCHAR mFinalDir[MAX_PATH]; + DWORD mFinalDirLen; +}; +#else // No-op outside Windows. +class LLDirectoryGuard +{ +public: + LLDirectoryGuard() {} + ~LLDirectoryGuard() {} +}; +#endif + + +#endif diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp index f0f618aef1..16cbf815e0 100644 --- a/indra/llwindow/llkeyboard.cpp +++ b/indra/llwindow/llkeyboard.cpp @@ -36,7 +36,6 @@ #include "llwindowcallbacks.h" - // // Globals // @@ -46,6 +45,8 @@ LLKeyboard *gKeyboard = NULL; //static std::map LLKeyboard::sKeysToNames; std::map LLKeyboard::sNamesToKeys; +LLKeyStringTranslatorFunc* LLKeyboard::mStringTranslator = NULL; // Used for l10n + PC/Mac/Linux accelerator labeling + // // Class Implementation @@ -346,6 +347,65 @@ std::string LLKeyboard::stringFromKey(KEY key) } +//static +std::string LLKeyboard::stringFromAccelerator( MASK accel_mask, KEY key ) +{ + std::string res; + + // break early if this is a silly thing to do. + if( KEY_NONE == key ) + { + return res; + } + + LLKeyStringTranslatorFunc *trans = gKeyboard->mStringTranslator; + + if( trans == NULL ) + { + llerrs << "No mKeyStringTranslator" << llendl; + return res; + } + + // Append any masks +#ifdef LL_DARWIN + // Standard Mac names for modifier keys in menu equivalents + // We could use the symbol characters, but they only exist in certain fonts. + if( accel_mask & MASK_CONTROL ) + { + if ( accel_mask & MASK_MAC_CONTROL ) + { + res.append( trans("accel-mac-control") ); + } + else + { + res.append( trans("accel-mac-command") ); // Symbol would be "\xE2\x8C\x98" + } + } + if( accel_mask & MASK_ALT ) + res.append( trans("accel-mac-option") ); // Symbol would be "\xE2\x8C\xA5" + if( accel_mask & MASK_SHIFT ) + res.append( trans("accel-mac-shift") ); // Symbol would be "\xE2\x8C\xA7" +#else + if( accel_mask & MASK_CONTROL ) + res.append( trans("accel-win-control") ); + if( accel_mask & MASK_ALT ) + res.append( trans("accel-win-alt") ); + if( accel_mask & MASK_SHIFT ) + res.append( trans("accel-win-shift") ); +#endif + std::string key_string = LLKeyboard::stringFromKey(key); + if ((accel_mask & MASK_NORMALKEYS) && + (key_string[0] == '-' || key_string[0] == '=' || key_string[0] == '+')) + { + res.append( " " ); + } + + std::string keystr = stringFromKey( key ); + res.append( keystr ); + + return res; +} + //static BOOL LLKeyboard::maskFromString(const std::string& str, MASK *mask) @@ -396,3 +456,10 @@ BOOL LLKeyboard::maskFromString(const std::string& str, MASK *mask) return FALSE; } } + + +//static +void LLKeyboard::setStringTranslatorFunc( LLKeyStringTranslatorFunc *trans_func ) +{ + mStringTranslator = trans_func; +} diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h index 0261bcbeb3..d545034070 100644 --- a/indra/llwindow/llkeyboard.h +++ b/indra/llwindow/llkeyboard.h @@ -47,7 +47,8 @@ enum EKeystate }; typedef void (*LLKeyFunc)(EKeystate keystate); - +typedef std::string (LLKeyStringTranslatorFunc)(const char *label); + enum EKeyboardInsertMode { LL_KIM_INSERT, @@ -111,7 +112,7 @@ public: static BOOL maskFromString(const std::string& str, MASK *mask); // False on failure static BOOL keyFromString(const std::string& str, KEY *key); // False on failure static std::string stringFromKey(KEY key); - + static std::string stringFromAccelerator( MASK accel_mask, KEY key ); e_numpad_distinct getNumpadDistinct() { return mNumpadDistinct; } void setNumpadDistinct(e_numpad_distinct val) { mNumpadDistinct = val; } @@ -119,6 +120,8 @@ public: F32 getKeyElapsedTime( KEY key ); // Returns time in seconds since key was pressed. S32 getKeyElapsedFrameCount( KEY key ); // Returns time in frames since key was pressed. + static void setStringTranslatorFunc( LLKeyStringTranslatorFunc *trans_func ); + protected: void addKeyName(KEY key, const std::string& name); @@ -136,6 +139,8 @@ protected: KEY mCurTranslatedKey; KEY mCurScanKey; // Used during the scanKeyboard() + static LLKeyStringTranslatorFunc* mStringTranslator; // Used for l10n + PC/Mac/Linux accelerator labeling + e_numpad_distinct mNumpadDistinct; EKeyboardInsertMode mInsertMode; diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp index ea11e0537e..35a3e7621a 100644 --- a/indra/llwindow/llkeyboardwin32.cpp +++ b/indra/llwindow/llkeyboardwin32.cpp @@ -65,7 +65,7 @@ LLKeyboardWin32::LLKeyboardWin32() // numpad number keys for (cur_char = 0x60; cur_char <= 0x69; cur_char++) { - mTranslateKeyMap[cur_char] = (KEY)('0' + (0x60 - cur_char)); + mTranslateKeyMap[cur_char] = (KEY)('0' + (cur_char - 0x60)); } diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 7137c93476..96e5a1b7ca 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1389,11 +1389,11 @@ void LLWindowMacOSX::setMouseClipping( BOOL b ) if(b) { - // llinfos << "setMouseClipping(TRUE)" << llendl + // llinfos << "setMouseClipping(TRUE)" << llendl; } else { - // llinfos << "setMouseClipping(FALSE)" << llendl + // llinfos << "setMouseClipping(FALSE)" << llendl; } adjustCursorDecouple(); @@ -1411,7 +1411,7 @@ BOOL LLWindowMacOSX::setCursorPosition(const LLCoordWindow position) CGPoint newPosition; - // llinfos << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << llendl + // llinfos << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << llendl; newPosition.x = screen_pos.mX; newPosition.y = screen_pos.mY; diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 00a8d429ba..9f03c8f695 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -70,7 +70,7 @@ extern BOOL gDebugWindowProc; const S32 MAX_NUM_RESOLUTIONS = 200; // static variable for ATI mouse cursor crash work-around: -static bool ATIbug = false; +static bool ATIbug = false; // // LLWindowSDL @@ -219,8 +219,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, #endif // LL_X11 #if LL_GTK - // We MUST be the first to initialize GTK, i.e. we have to beat - // our embedded Mozilla to the punch so that GTK doesn't get badly + // We MUST be the first to initialize GTK so that GTK doesn't get badly // initialized with a non-C locale and cause lots of serious random // weirdness. ll_try_gtk_init(); @@ -674,12 +673,12 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B glGetIntegerv(GL_DEPTH_BITS, &depthBits); glGetIntegerv(GL_STENCIL_BITS, &stencilBits); - llinfos << "GL buffer:" << llendl - llinfos << " Red Bits " << S32(redBits) << llendl - llinfos << " Green Bits " << S32(greenBits) << llendl - llinfos << " Blue Bits " << S32(blueBits) << llendl - llinfos << " Alpha Bits " << S32(alphaBits) << llendl - llinfos << " Depth Bits " << S32(depthBits) << llendl + llinfos << "GL buffer:" << llendl; + llinfos << " Red Bits " << S32(redBits) << llendl; + llinfos << " Green Bits " << S32(greenBits) << llendl; + llinfos << " Blue Bits " << S32(blueBits) << llendl; + llinfos << " Alpha Bits " << S32(alphaBits) << llendl; + llinfos << " Depth Bits " << S32(depthBits) << llendl; llinfos << " Stencil Bits " << S32(stencilBits) << llendl; GLint colorBits = redBits + greenBits + blueBits + alphaBits; @@ -2252,6 +2251,7 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) GtkColorSelection *colorsel = GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG(win)->colorsel); GdkColor color, orig_color; + orig_color.pixel = 0; orig_color.red = guint16(65535 * *r); orig_color.green= guint16(65535 * *g); orig_color.blue = guint16(65535 * *b); diff --git a/indra/llxuixml/lltrans.h b/indra/llxuixml/lltrans.h index 79df5802e5..856b9e04fc 100644 --- a/indra/llxuixml/lltrans.h +++ b/indra/llxuixml/lltrans.h @@ -103,6 +103,11 @@ public: return findString(result, xml_desc, empty); } + static std::string getKeyboardString(const char* keystring) + { + // These map directly - no need to specialize + return getString( ll_safe_string(keystring) ); + } // get the default args static const LLStringUtil::format_map_t& getDefaultArgs() diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index b9e5664ff7..c402c3979a 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1025,7 +1025,7 @@ endif (DARWIN) if (LINUX) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) - LIST(APPEND CMAKE_EXE_LINKER_FLAGS -Wl,--as-needed) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") set(viewer_LIBRARIES Xinerama @@ -1113,7 +1113,9 @@ if (WINDOWS) SOURCE_GROUP("Resource Files" FILES ${viewer_RESOURCE_FILES}) - list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES}) + if (NOT STANDALONE) + list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES}) + endif (NOT STANDALONE) find_library(DINPUT_LIBRARY dinput8 ${DIRECTX_LIBRARY_DIR}) find_library(DXGUID_LIBRARY dxguid ${DIRECTX_LIBRARY_DIR}) @@ -1223,8 +1225,9 @@ source_group("Character File" FILES ${viewer_CHARACTER_FILES}) set_source_files_properties(${viewer_CHARACTER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) - -list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES}) +if (NOT STANDALONE) + list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES}) +endif (NOT STANDALONE) if (WINDOWS) file(GLOB viewer_INSTALLER_FILES installers/windows/*.nsi) diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 5d52158298..544f1c598e 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -459,6 +459,7 @@ PARCEL_FLAG_ALLOW_LANDMARK Used with llGetParcelFlags to find if a parcel allo PARCEL_FLAG_ALLOW_TERRAFORM Used with llGetParcelFlags to find if a parcel allows anyone to terraform the land PARCEL_FLAG_ALLOW_DAMAGE Used with llGetParcelFlags to find if a parcel allows damage PARCEL_FLAG_ALLOW_CREATE_OBJECTS Used with llGetParcelFlags to find if a parcel allows anyone to create objects +PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS Used with llGetParcelFlags to find if a parcel allows group members or objects to create objects PARCEL_FLAG_USE_ACCESS_GROUP Used with llGetParcelFlags to find if a parcel limits access to a group PARCEL_FLAG_USE_ACCESS_LIST Used with llGetParcelFlags to find if a parcel limits access to a list of residents PARCEL_FLAG_USE_BAN_LIST Used with llGetParcelFlags to find if a parcel uses a ban list diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d05fd955db..467e1e8342 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1599,7 +1599,7 @@ Cursor3D Comment - Tread Joystick values as absolute positions (not deltas). + Treat Joystick values as absolute positions (not deltas). Persist 1 Type @@ -3851,6 +3851,17 @@ Value + JoystickMouselookYaw + + Comment + Pass joystick yaw to scripts in Mouselook. + Persist + 1 + Type + Boolean + Value + 1 + JoystickRunThreshold Comment @@ -4158,7 +4169,7 @@ Type Boolean Value - 0 + 1 LipSyncOoh diff --git a/indra/newview/installers/darwin/firstlook-dmg/_DS_Store b/indra/newview/installers/darwin/firstlook-dmg/_DS_Store index 6c5a3f3452..408a4d4992 100644 Binary files a/indra/newview/installers/darwin/firstlook-dmg/_DS_Store and b/indra/newview/installers/darwin/firstlook-dmg/_DS_Store differ diff --git a/indra/newview/installers/darwin/publicnightly-dmg/_DS_Store b/indra/newview/installers/darwin/publicnightly-dmg/_DS_Store index 6a91b38d6d..b901e46b65 100644 Binary files a/indra/newview/installers/darwin/publicnightly-dmg/_DS_Store and b/indra/newview/installers/darwin/publicnightly-dmg/_DS_Store differ diff --git a/indra/newview/installers/darwin/releasecandidate-dmg/_DS_Store b/indra/newview/installers/darwin/releasecandidate-dmg/_DS_Store index a8b757372e..309c8adaaa 100644 Binary files a/indra/newview/installers/darwin/releasecandidate-dmg/_DS_Store and b/indra/newview/installers/darwin/releasecandidate-dmg/_DS_Store differ diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 08681db6cb..41aeeee82a 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -330,7 +330,7 @@ LLAgent::LLAgent() : mLeftKey(0), mUpKey(0), mYawKey(0.f), - mPitchKey(0), + mPitchKey(0.f), mOrbitLeftKey(0.f), mOrbitRightKey(0.f), @@ -723,15 +723,15 @@ void LLAgent::moveYaw(F32 mag, bool reset_view) //----------------------------------------------------------------------------- // movePitch() //----------------------------------------------------------------------------- -void LLAgent::movePitch(S32 direction) +void LLAgent::movePitch(F32 mag) { - setKey(direction, mPitchKey); + mPitchKey = mag; - if (direction > 0) + if (mag > 0) { - setControlFlags(AGENT_CONTROL_PITCH_POS ); + setControlFlags(AGENT_CONTROL_PITCH_POS); } - else if (direction < 0) + else if (mag < 0) { setControlFlags(AGENT_CONTROL_PITCH_NEG); } @@ -2509,10 +2509,10 @@ void LLAgent::propagate(const F32 dt) // handle rotation based on keyboard levels const F32 YAW_RATE = 90.f * DEG_TO_RAD; // radians per second - yaw( YAW_RATE * mYawKey * dt ); + yaw(YAW_RATE * mYawKey * dt); const F32 PITCH_RATE = 90.f * DEG_TO_RAD; // radians per second - pitch(PITCH_RATE * (F32) mPitchKey * dt); + pitch(PITCH_RATE * mPitchKey * dt); // handle auto-land behavior if (mAvatarObject.notNull()) @@ -2537,7 +2537,7 @@ void LLAgent::propagate(const F32 dt) mLeftKey = 0; mUpKey = 0; mYawKey = 0.f; - mPitchKey = 0; + mPitchKey = 0.f; } //----------------------------------------------------------------------------- @@ -3168,6 +3168,7 @@ void LLAgent::updateCamera() mFollowCam.copyParams(*current_cam); mFollowCam.setSubjectPositionAndRotation( mAvatarObject->getRenderPosition(), avatarRotationForFollowCam ); mFollowCam.update(); + LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true); } else { @@ -4245,7 +4246,7 @@ void LLAgent::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL camera_ani { if(avatar_animate) { - // Remove any pitch from the avatar + // Remove any pitch from the avatar LLVector3 at = mFrameAgent.getAtAxis(); at.mV[VZ] = 0.f; at.normalize(); diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 5ca630f8d1..b334874e6e 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -471,7 +471,7 @@ private: S32 mLeftKey; S32 mUpKey; F32 mYawKey; - S32 mPitchKey; + F32 mPitchKey; //-------------------------------------------------------------------- // Movement from user input @@ -486,7 +486,7 @@ public: void moveLeftNudge(S32 direction); void moveUp(S32 direction); void moveYaw(F32 mag, bool reset_view = true); - void movePitch(S32 direction); + void movePitch(F32 mag); //-------------------------------------------------------------------- // Orbit diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d47b994322..785179f7b3 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -686,8 +686,12 @@ bool LLAppViewer::init() LLUI::setupPaths(); LLTransUtil::parseStrings("strings.xml", default_trans_args); LLTransUtil::parseLanguageStrings("language_settings.xml"); - LLWeb::initClass(); // do this after LLUI + + // LLKeyboard relies on LLUI to know what some accelerator keys are called. + LLKeyboard::setStringTranslatorFunc( LLTrans::getKeyboardString ); + LLWeb::initClass(); // do this after LLUI + // Provide the text fields with callbacks for opening Urls LLUrlAction::setOpenURLCallback(&LLWeb::loadURL); LLUrlAction::setOpenURLInternalCallback(&LLWeb::loadURLInternal); @@ -1802,8 +1806,18 @@ bool LLAppViewer::initConfiguration() gSavedSettings.setString("VersionChannelName", LL_CHANNEL); #ifndef LL_RELEASE_FOR_DOWNLOAD - gSavedSettings.setBOOL("ShowConsoleWindow", TRUE); - gSavedSettings.setBOOL("AllowMultipleViewers", TRUE); + // provide developer build only overrides for these control variables that are not + // persisted to settings.xml + LLControlVariable* c = gSavedSettings.getControl("ShowConsoleWindow"); + if (c) + { + c->setValue(true, false); + } + c = gSavedSettings.getControl("AllowMultipleViewers"); + if (c) + { + c->setValue(true, false); + } #endif //*FIX:Mani - Set default to disabling watchdog mainloop diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index ed291c16a8..d34bcb4a68 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -188,7 +188,7 @@ static inline BOOL do_basic_glibc_backtrace() for (i = 0; i < size; i++) { // the format of the StraceFile is very specific, to allow (kludgy) machine-parsing - fprintf(StraceFile, "%-3d ", i); + fprintf(StraceFile, "%-3lu ", (unsigned long)i); fprintf(StraceFile, "%-32s\t", "unknown"); fprintf(StraceFile, "%p ", stackarray[i]); fprintf(StraceFile, "%s\n", strings[i]); @@ -263,7 +263,7 @@ static inline BOOL do_elfio_glibc_backtrace() for (btpos = 0; btpos < btsize; ++btpos) { // the format of the StraceFile is very specific, to allow (kludgy) machine-parsing - fprintf(StraceFile, "%-3d ", btpos); + fprintf(StraceFile, "%-3ld ", (long)btpos); int symidx; for (symidx = 0; symidx < nSymNo; ++symidx) { @@ -354,7 +354,7 @@ bool LLAppViewerLinux::init() bool LLAppViewerLinux::restoreErrorTrap() { - // *NOTE:Mani there is a case for implementing this or the mac. + // *NOTE:Mani there is a case for implementing this on the mac. // Linux doesn't need it to my knowledge. return true; } @@ -727,8 +727,26 @@ std::string LLAppViewerLinux::generateSerialNumber() { char serial_md5[MD5HEX_STR_SIZE]; serial_md5[0] = 0; + std::string best; + std::string uuiddir("/dev/disk/by-uuid/"); - // TODO + // trawl /dev/disk/by-uuid looking for a good-looking UUID to grab + std::string this_name; + BOOL wrap = FALSE; + while (gDirUtilp->getNextFileInDir(uuiddir, "*", this_name, wrap)) + { + if (this_name.length() > best.length() || + (this_name.length() == best.length() && + this_name > best)) + { + // longest (and secondarily alphabetically last) so far + best = this_name; + } + } + + // we don't return the actual serial number, just a hash of it. + LLMD5 md5( reinterpret_cast(best.c_str()) ); + md5.hex_digest(serial_md5); return serial_md5; } diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h index 365fcfeb6b..230c0dc24b 100644 --- a/indra/newview/llappviewerlinux.h +++ b/indra/newview/llappviewerlinux.h @@ -33,9 +33,12 @@ #ifndef LL_LLAPPVIEWERLINUX_H #define LL_LLAPPVIEWERLINUX_H -#if LL_DBUS_ENABLED extern "C" { # include +} + +#if LL_DBUS_ENABLED +extern "C" { # include # include } diff --git a/indra/newview/llappviewerlinux_api_dbus.cpp b/indra/newview/llappviewerlinux_api_dbus.cpp index ee160d0151..da67493e67 100644 --- a/indra/newview/llappviewerlinux_api_dbus.cpp +++ b/indra/newview/llappviewerlinux_api_dbus.cpp @@ -41,9 +41,9 @@ extern "C" { #include "apr_dso.h" } -#define DEBUGMSG(...) lldebugs << llformat(__VA_ARGS__) << llendl -#define INFOMSG(...) llinfos << llformat(__VA_ARGS__) << llendl -#define WARNMSG(...) llwarns << llformat(__VA_ARGS__) << llendl +#define DEBUGMSG(...) do { lldebugs << llformat(__VA_ARGS__) << llendl; } while(0) +#define INFOMSG(...) do { llinfos << llformat(__VA_ARGS__) << llendl; } while(0) +#define WARNMSG(...) do { llwarns << llformat(__VA_ARGS__) << llendl; } while(0) #define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) RTN (*ll##DBUSSYM)(__VA_ARGS__) = NULL #include "llappviewerlinux_api_dbus_syms_raw.inc" diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 2b3939d92f..1282e437f2 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -159,15 +159,7 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) clp.addOptionDesc("psn", NULL, 1, "MacOSX process serial number"); clp.setCustomParser(parse_psn); - // First parse the command line, not often used on the mac. - if(clp.parseCommandLine(gArgC, gArgV) == false) - { - return false; - } - - // Now read in the args from arguments txt. - // Succesive calls to clp.parse... will NOT override earlier - // options. + // First read in the args from arguments txt. const char* filename = "arguments.txt"; llifstream ifs(filename, llifstream::binary); if (!ifs.is_open()) @@ -180,7 +172,14 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) { return false; } - + + // Then parse the user's command line, so that any --url arg can appear last + // Succesive calls to clp.parse... will NOT override earlier options. + if(clp.parseCommandLine(gArgC, gArgV) == false) + { + return false; + } + // Get the user's preferred language string based on the Mac OS localization mechanism. // To add a new localization: // go to the "Resources" section of the project diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index f56359afc3..21e17cc207 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -369,7 +369,7 @@ void LLDrawPoolWater::shade() LLVector3 light_dir; LLColor3 light_color; - if (gSky.getSunDirection().mV[2] > NIGHTTIME_ELEVATION_COS) + if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS) { light_dir = gSky.getSunDirection(); light_dir.normVec(); diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index c062e6ccf2..55b7ed0c99 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -426,8 +426,8 @@ void LLFloaterAnimPreview::resetMotion() LLUUID base_id = mIDList[childGetValue("preview_base_anim").asString()]; avatarp->deactivateAllMotions(); - avatarp->startMotion(base_id, BASE_ANIM_TIME_OFFSET); avatarp->startMotion(mMotionID, 0.0f); + avatarp->startMotion(base_id, BASE_ANIM_TIME_OFFSET); childSetValue("playback_slider", 0.0f); // Set pose @@ -638,10 +638,10 @@ void LLFloaterAnimPreview::onCommitBaseAnim(LLUICtrl* ctrl, void* data) BOOL paused = avatarp->areAnimationsPaused(); // stop all other possible base motions - avatarp->stopMotion(ANIM_AGENT_STAND, TRUE); - avatarp->stopMotion(ANIM_AGENT_WALK, TRUE); - avatarp->stopMotion(ANIM_AGENT_SIT, TRUE); - avatarp->stopMotion(ANIM_AGENT_HOVER, TRUE); + avatarp->stopMotion(previewp->mIDList["Standing"], TRUE); + avatarp->stopMotion(previewp->mIDList["Walking"], TRUE); + avatarp->stopMotion(previewp->mIDList["Sitting"], TRUE); + avatarp->stopMotion(previewp->mIDList["Flying"], TRUE); previewp->resetMotion(); diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index da2a4d9d93..cb0d304aa0 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterauction.h" +#include "llfloaterregioninfo.h" #include "lldir.h" #include "llgl.h" @@ -56,6 +57,7 @@ #include "llviewercontrol.h" #include "llui.h" #include "llrender.h" +#include "llsdutil.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -77,7 +79,9 @@ LLFloaterAuction::LLFloaterAuction(const LLSD& key) { // LLUICtrlFactory::getInstance()->buildFloater(this, "floater_auction.xml"); mCommitCallbackRegistrar.add("ClickSnapshot", boost::bind(&LLFloaterAuction::onClickSnapshot, this)); - mCommitCallbackRegistrar.add("ClickOK", boost::bind(&LLFloaterAuction::onClickOK, this)); + mCommitCallbackRegistrar.add("ClickSellToAnyone", boost::bind(&LLFloaterAuction::onClickSellToAnyone, this)); + mCommitCallbackRegistrar.add("ClickStartAuction", boost::bind(&LLFloaterAuction::onClickStartAuction, this)); + mCommitCallbackRegistrar.add("ClickResetParcel", boost::bind(&LLFloaterAuction::onClickResetParcel, this)); } // Destroys the object @@ -97,6 +101,8 @@ void LLFloaterAuction::onOpen(const LLSD& key) void LLFloaterAuction::initialize() { + mParcelUpdateCapUrl.clear(); + mParcelp = LLViewerParcelMgr::getInstance()->getParcelSelection(); LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); LLParcel* parcelp = mParcelp->getParcel(); @@ -104,10 +110,23 @@ void LLFloaterAuction::initialize() { mParcelHost = region->getHost(); mParcelID = parcelp->getLocalID(); + mParcelUpdateCapUrl = region->getCapability("ParcelPropertiesUpdate"); childSetText("parcel_text", parcelp->getName()); childEnable("snapshot_btn"); - childEnable("ok_btn"); + childEnable("reset_parcel_btn"); + childEnable("start_auction_btn"); + + LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); + if (panel) + { // Only enable "Sell to Anyone" on Teen grid or if we don't know the ID yet + U32 estate_id = panel->getEstateID(); + childSetEnabled("sell_to_anyone_btn", (estate_id == ESTATE_TEEN || estate_id == 0)); + } + else + { // Don't have the panel up, so don't know if we're on the teen grid or not. Default to enabling it + childEnable("sell_to_anyone_btn"); + } } else { @@ -122,8 +141,11 @@ void LLFloaterAuction::initialize() } mParcelID = -1; childSetEnabled("snapshot_btn", false); - childSetEnabled("ok_btn", false); + childSetEnabled("reset_parcel_btn", false); + childSetEnabled("sell_to_anyone_btn", false); + childSetEnabled("start_auction_btn", false); } + mImageID.setNull(); mImage = NULL; } @@ -205,7 +227,7 @@ void LLFloaterAuction::onClickSnapshot(void* data) } // static -void LLFloaterAuction::onClickOK(void* data) +void LLFloaterAuction::onClickStartAuction(void* data) { LLFloaterAuction* self = (LLFloaterAuction*)(data); @@ -244,11 +266,264 @@ void LLFloaterAuction::onClickOK(void* data) msg->sendReliable(self->mParcelHost); // clean up floater, and get out - self->mImageID.setNull(); - self->mImage = NULL; - self->mParcelID = -1; - self->mParcelHost.invalidate(); - self->closeFloater(); + self->cleanupAndClose(); +} + + +void LLFloaterAuction::cleanupAndClose() +{ + mImageID.setNull(); + mImage = NULL; + mParcelID = -1; + mParcelHost.invalidate(); + closeFloater(); +} + + + +// static glue +void LLFloaterAuction::onClickResetParcel(void* data) +{ + LLFloaterAuction* self = (LLFloaterAuction*)(data); + if (self) + { + self->doResetParcel(); + } +} + + +// Reset all the values for the parcel in preparation for a sale +void LLFloaterAuction::doResetParcel() +{ + LLParcel* parcelp = mParcelp->getParcel(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); + + if (parcelp + && region + && !mParcelUpdateCapUrl.empty()) + { + LLSD body; + std::string empty; + + // request new properties update from simulator + U32 message_flags = 0x01; + body["flags"] = ll_sd_from_U32(message_flags); + + // Set all the default parcel properties for auction + body["local_id"] = parcelp->getLocalID(); + + U32 parcel_flags = PF_ALLOW_LANDMARK | + PF_ALLOW_FLY | + PF_CREATE_GROUP_OBJECTS | + PF_ALLOW_ALL_OBJECT_ENTRY | + PF_ALLOW_GROUP_OBJECT_ENTRY | + PF_ALLOW_GROUP_SCRIPTS | + PF_RESTRICT_PUSHOBJECT | + PF_SOUND_LOCAL | + PF_ALLOW_VOICE_CHAT | + PF_USE_ESTATE_VOICE_CHAN; + + body["parcel_flags"] = ll_sd_from_U32(parcel_flags); + + // Build a parcel name like "Ahern (128,128) PG 4032m" + std::ostringstream parcel_name; + LLVector3 center_point( parcelp->getCenterpoint() ); + center_point.snap(0); // Get rid of fractions + parcel_name << region->getName() + << " (" + << (S32) center_point.mV[VX] + << "," + << (S32) center_point.mV[VY] + << ") " + << region->getSimAccessString() + << " " + << parcelp->getArea() + << "m"; + + std::string new_name(parcel_name.str().c_str()); + body["name"] = new_name; + childSetText("parcel_text", new_name); // Set name in dialog as well, since it won't get updated otherwise + + body["sale_price"] = (S32) 0; + body["description"] = empty; + body["music_url"] = empty; + body["media_url"] = empty; + body["media_desc"] = empty; + body["media_type"] = std::string("none/none"); + body["media_width"] = (S32) 0; + body["media_height"] = (S32) 0; + body["auto_scale"] = (S32) 0; + body["media_loop"] = (S32) 0; + body["obscure_media"] = (S32) 0; + body["obscure_music"] = (S32) 0; + body["media_id"] = LLUUID::null; + body["group_id"] = MAINTENANCE_GROUP_ID; // Use maintenance group + body["pass_price"] = (S32) 10; // Defaults to $10 + body["pass_hours"] = 0.0f; + body["category"] = (U8) LLParcel::C_NONE; + body["auth_buyer_id"] = LLUUID::null; + body["snapshot_id"] = LLUUID::null; + body["user_location"] = ll_sd_from_vector3( LLVector3::zero ); + body["user_look_at"] = ll_sd_from_vector3( LLVector3::zero ); + body["landing_type"] = (U8) LLParcel::L_DIRECT; + + llinfos << "Sending parcel update to reset for auction via capability to: " + << mParcelUpdateCapUrl << llendl; + LLHTTPClient::post(mParcelUpdateCapUrl, body, new LLHTTPClient::Responder()); + + // Send a message to clear the object return time + LLMessageSystem *msg = gMessageSystem; + msg->newMessageFast(_PREHASH_ParcelSetOtherCleanTime); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_ParcelData); + msg->addS32Fast(_PREHASH_LocalID, parcelp->getLocalID()); + msg->addS32Fast(_PREHASH_OtherCleanTime, 5); // 5 minute object auto-return + + msg->sendReliable(region->getHost()); + + // Clear the access lists + clearParcelAccessLists(parcelp, region); + } +} + + + +void LLFloaterAuction::clearParcelAccessLists(LLParcel* parcel, LLViewerRegion* region) +{ + if (!region || !parcel) return; + + LLUUID transactionUUID; + transactionUUID.generate(); + + LLMessageSystem* msg = gMessageSystem; + + // Clear access list + // parcel->mAccessList.clear(); + + msg->newMessageFast(_PREHASH_ParcelAccessListUpdate); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); + msg->nextBlockFast(_PREHASH_Data); + msg->addU32Fast(_PREHASH_Flags, AL_ACCESS); + msg->addS32(_PREHASH_LocalID, parcel->getLocalID() ); + msg->addUUIDFast(_PREHASH_TransactionID, transactionUUID); + msg->addS32Fast(_PREHASH_SequenceID, 1); // sequence_id + msg->addS32Fast(_PREHASH_Sections, 0); // num_sections + + // pack an empty block since there will be no data + msg->nextBlockFast(_PREHASH_List); + msg->addUUIDFast(_PREHASH_ID, LLUUID::null ); + msg->addS32Fast(_PREHASH_Time, 0 ); + msg->addU32Fast(_PREHASH_Flags, 0 ); + + msg->sendReliable( region->getHost() ); + + // Send message for empty ban list + //parcel->mBanList.clear(); + msg->newMessageFast(_PREHASH_ParcelAccessListUpdate); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); + msg->nextBlockFast(_PREHASH_Data); + msg->addU32Fast(_PREHASH_Flags, AL_BAN); + msg->addS32(_PREHASH_LocalID, parcel->getLocalID() ); + msg->addUUIDFast(_PREHASH_TransactionID, transactionUUID); + msg->addS32Fast(_PREHASH_SequenceID, 1); // sequence_id + msg->addS32Fast(_PREHASH_Sections, 0); // num_sections + + // pack an empty block since there will be no data + msg->nextBlockFast(_PREHASH_List); + msg->addUUIDFast(_PREHASH_ID, LLUUID::null ); + msg->addS32Fast(_PREHASH_Time, 0 ); + msg->addU32Fast(_PREHASH_Flags, 0 ); + + msg->sendReliable( region->getHost() ); +} + + + +// static - 'Sell to Anyone' clicked, throw up a confirmation dialog +void LLFloaterAuction::onClickSellToAnyone(void* data) +{ + LLFloaterAuction* self = (LLFloaterAuction*)(data); + if (self) + { + LLParcel* parcelp = self->mParcelp->getParcel(); + + // Do a confirmation + S32 sale_price = parcelp->getArea(); // Selling for L$1 per meter + S32 area = parcelp->getArea(); + + LLSD args; + args["LAND_SIZE"] = llformat("%d", area); + args["SALE_PRICE"] = llformat("%d", sale_price); + args["NAME"] = "Anyone"; + + LLNotification::Params params("ConfirmLandSaleChange"); // Re-use existing dialog + params.substitutions(args) + .functor.function(boost::bind(&LLFloaterAuction::onSellToAnyoneConfirmed, self, _1, _2)); + + params.name("ConfirmLandSaleToAnyoneChange"); + + // ask away + LLNotifications::instance().add(params); + } +} + + +// Sell confirmation clicked +bool LLFloaterAuction::onSellToAnyoneConfirmed(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + if (option == 0) + { + doSellToAnyone(); + } + + return false; +} + + + +// Reset all the values for the parcel in preparation for a sale +void LLFloaterAuction::doSellToAnyone() +{ + LLParcel* parcelp = mParcelp->getParcel(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); + + if (parcelp + && region + && !mParcelUpdateCapUrl.empty()) + { + LLSD body; + std::string empty; + + // request new properties update from simulator + U32 message_flags = 0x01; + body["flags"] = ll_sd_from_U32(message_flags); + + // Set all the default parcel properties for auction + body["local_id"] = parcelp->getLocalID(); + + // Set 'for sale' flag + U32 parcel_flags = parcelp->getParcelFlags() | PF_FOR_SALE; + // Ensure objects not included + parcel_flags &= ~PF_FOR_SALE_OBJECTS; + body["parcel_flags"] = ll_sd_from_U32(parcel_flags); + + body["sale_price"] = parcelp->getArea(); // Sell for L$1 per square meter + body["auth_buyer_id"] = LLUUID::null; // To anyone + + llinfos << "Sending parcel update to sell to anyone for L$1 via capability to: " + << mParcelUpdateCapUrl << llendl; + LLHTTPClient::post(mParcelUpdateCapUrl, body, new LLHTTPClient::Responder()); + + // clean up floater, and get out + cleanupAndClose(); + } } diff --git a/indra/newview/llfloaterauction.h b/indra/newview/llfloaterauction.h index 1acc08057c..c599af782d 100644 --- a/indra/newview/llfloaterauction.h +++ b/indra/newview/llfloaterauction.h @@ -45,6 +45,8 @@ // Class which holds the functionality to start auctions. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLParcelSelection; +class LLParcel; +class LLViewerRegion; class LLFloaterAuction : public LLFloater { @@ -62,16 +64,28 @@ private: void initialize(); static void onClickSnapshot(void* data); - static void onClickOK(void* data); + static void onClickResetParcel(void* data); + static void onClickSellToAnyone(void* data); // Sell to anyone clicked + bool onSellToAnyoneConfirmed(const LLSD& notification, const LLSD& response); // Sell confirmation clicked + static void onClickStartAuction(void* data); /*virtual*/ BOOL postBuild(); + + void doResetParcel(); + void doSellToAnyone(); + void clearParcelAccessLists( LLParcel* parcel, LLViewerRegion* region ); + void cleanupAndClose(); + private: + LLTransactionID mTransactionID; LLAssetID mImageID; LLPointer mImage; LLSafeHandle mParcelp; S32 mParcelID; LLHost mParcelHost; + + std::string mParcelUpdateCapUrl; // "ParcelPropertiesUpdate" capability }; diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 890d863db7..ccfe7d4b64 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -69,7 +69,7 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback, // Default constructor LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key) : LLFloater(key), - mResultsReturned(FALSE), + mNumResultsReturned(0), mCallback(NULL), mCallbackUserdata(NULL), mNearMeListComplete(FALSE), @@ -314,7 +314,7 @@ void LLFloaterAvatarPicker::find() getChild("SearchResults")->setCommentText(getString("searching")); childSetEnabled("Select", FALSE); - mResultsReturned = FALSE; + mNumResultsReturned = 0; } void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple) @@ -349,9 +349,10 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* LLScrollListCtrl* search_results = floater->getChild("SearchResults"); // clear "Searching" label on first results - search_results->deleteAllItems(); - - floater->mResultsReturned = TRUE; + if (floater->mNumResultsReturned++ == 0) + { + search_results->deleteAllItems(); + } BOOL found_one = FALSE; S32 num_new_rows = msg->getNumberOfBlocks("Data"); diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index f3b9aefb9c..85aacb68a5 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -76,7 +76,7 @@ private: virtual BOOL handleKeyHere(KEY key, MASK mask); LLUUID mQueryID; - BOOL mResultsReturned; + int mNumResultsReturned; BOOL mNearMeListComplete; BOOL mCloseOnSelect; diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index e0fe87f9ae..1300103423 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -211,25 +211,16 @@ void LLFloaterGesture::buildGestureList() std::string key_string = LLKeyboard::stringFromKey(gesture->mKey); std::string buffer; + if (gesture->mKey == KEY_NONE) { - if (gesture->mKey == KEY_NONE) - { - buffer = "---"; - key_string = "~~~"; // alphabetize to end - } - else - { - if (gesture->mMask & MASK_CONTROL) buffer.append("Ctrl-"); - if (gesture->mMask & MASK_ALT) buffer.append("Alt-"); - if (gesture->mMask & MASK_SHIFT) buffer.append("Shift-"); - if ((gesture->mMask & (MASK_CONTROL|MASK_ALT|MASK_SHIFT)) && - (key_string[0] == '-' || key_string[0] == '=')) - { - buffer.append(" "); - } - buffer.append(key_string); - } + buffer = "---"; + key_string = "~~~"; // alphabetize to end } + else + { + buffer = LLKeyboard::stringFromAccelerator( gesture->mMask, gesture->mKey ); + } + element["columns"][1]["column"] = "shortcut"; element["columns"][1]["value"] = buffer; element["columns"][1]["font"]["name"] = "SANSSERIF"; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index a378a511b5..c1031ee437 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -105,7 +105,7 @@ public: // LLFloaterLand //--------------------------------------------------------------------------- -void send_parcel_select_objects(S32 parcel_local_id, S32 return_type, +void send_parcel_select_objects(S32 parcel_local_id, U32 return_type, uuid_list_t* return_ids = NULL) { LLMessageSystem *msg = gMessageSystem; @@ -123,7 +123,7 @@ void send_parcel_select_objects(S32 parcel_local_id, S32 return_type, msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ParcelData); msg->addS32Fast(_PREHASH_LocalID, parcel_local_id); - msg->addS32Fast(_PREHASH_ReturnType, return_type); + msg->addU32Fast(_PREHASH_ReturnType, return_type); // Throw all return ids into the packet. // TODO: Check for too many ids. diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 1ec869da73..70a3ad5252 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -143,6 +143,7 @@ BOOL LLFloaterReporter::postBuild() LLViewerRegion *regionp = gAgent.getRegion(); if (regionp) { + childSetText("sim_field", regionp->getName()); pos -= regionp->getOriginGlobal(); } setPosBox(pos); diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index 43d31aa30a..2d8ccd1aef 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -47,7 +47,7 @@ #include "llviewerwindow.h" // defined in llfloaterland.cpp -void send_parcel_select_objects(S32 parcel_local_id, S32 return_type, +void send_parcel_select_objects(S32 parcel_local_id, U32 return_type, uuid_list_t* return_ids = NULL); enum Badge { BADGE_OK, BADGE_NOTE, BADGE_WARN, BADGE_ERROR }; diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index b64d8ab334..e00b352c9b 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -417,6 +417,11 @@ void LLFloaterTools::refresh() LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); childSetTextArg("prim_count", "[COUNT]", prim_count_string); + // disable the object and prim counts if nothing selected + bool have_selection = ! LLSelectMgr::getInstance()->getSelection()->isEmpty(); + childSetEnabled("obj_count", have_selection); + childSetEnabled("prim_count", have_selection); + // Refresh child tabs mPanelPermissions->refresh(); mPanelObject->refresh(); diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index d653d44f8c..b7e8835fb8 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -49,6 +49,7 @@ #include "llfirstuse.h" #include "llfloaterreg.h" // getTypedInstance() #include "llfocusmgr.h" +#include "llinventorymodel.h" #include "lllandmarklist.h" #include "lllineeditor.h" #include "llregionhandle.h" @@ -57,7 +58,7 @@ #include "lltabcontainer.h" #include "lltextbox.h" #include "lltracker.h" -#include "llinventorymodel.h" +#include "lltrans.h" #include "llviewerinventory.h" // LLViewerInventoryItem #include "llviewermenu.h" #include "llviewerregion.h" @@ -151,7 +152,6 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) mFriendObserver(NULL), mCompletingRegionName(""), mWaitingForTracker(FALSE), - mExactMatch(FALSE), mIsClosing(FALSE), mSetToUserPosition(TRUE), mTrackedLocation(0,0,0), @@ -903,7 +903,6 @@ void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui) } LLWorldMap::getInstance()->mIsTrackingCommit = FALSE; mCompletingRegionName = ""; - mExactMatch = FALSE; } @@ -1163,7 +1162,6 @@ void LLFloaterWorldMap::onLocationCommit() LLStringUtil::toLower(str); mCompletingRegionName = str; LLWorldMap::getInstance()->mIsTrackingCommit = TRUE; - mExactMatch = FALSE; if (str.length() >= 3) { LLWorldMap::getInstance()->sendNamedRegionRequest(str); @@ -1418,11 +1416,10 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) LLScrollListCtrl *list = getChild("search_results"); list->operateOnAll(LLCtrlListInterface::OP_DELETE); - LLSD selected_value = list->getSelectedValue(); - S32 name_length = mCompletingRegionName.length(); - BOOL match_found = FALSE; + LLSD match; + S32 num_results = 0; std::map::const_iterator it; for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) @@ -1434,15 +1431,11 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) if (sim_name_lower.substr(0, name_length) == mCompletingRegionName) { - if (LLWorldMap::getInstance()->mIsTrackingCommit) + if (sim_name_lower == mCompletingRegionName) { - if (sim_name_lower == mCompletingRegionName) - { - selected_value = sim_name; - match_found = TRUE; - } + match = sim_name; } - + LLSD value; value["id"] = sim_name; value["columns"][0]["column"] = "sim_name"; @@ -1451,29 +1444,24 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) num_results++; } } - - list->selectByValue(selected_value); if (found_null_sim) { mCompletingRegionName = ""; } - if (match_found) - { - mExactMatch = TRUE; - childSetFocus("search_results"); - onCommitSearchResult(); - } - else if (!mExactMatch && num_results > 0) + // if match found, highlight it and go + if (!match.isUndefined()) { - list->selectFirstItem(); // select first item by default + list->selectByValue(match); childSetFocus("search_results"); onCommitSearchResult(); } - else if (num_results == 0) + + // if we found nothing, say "none" + if (num_results == 0) { - list->setCommentText(std::string("None found.")); + list->setCommentText(LLTrans::getString("worldmap_results_none_found")); list->operateOnAll(LLCtrlListInterface::OP_DESELECT); } } diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 6d5b7543d4..20a8e6d321 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -174,7 +174,6 @@ protected: std::string mCompletingRegionName; std::string mLastRegionName; BOOL mWaitingForTracker; - BOOL mExactMatch; BOOL mIsClosing; BOOL mSetToUserPosition; diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 99f331d087..c2d515f158 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -1654,6 +1654,8 @@ void LLFloaterIMPanel::sendMsg() LLWString text = mInputEditor->getConvertedText(); if(!text.empty()) { + // store sent line in history, duplicates will get filtered + if (mInputEditor) mInputEditor->updateHistory(); // Truncate and convert to UTF8 for transport std::string utf8_text = wstring_to_utf8str(text); utf8_text = utf8str_truncate(utf8_text, MAX_MSG_BUF_SIZE - 1); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d4a9324208..1880a574a7 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2316,6 +2316,8 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); + mItems.clear(); //adding code to clear out member Items (which means Items should not have other data here at this point) + mDisabledItems.clear(); //adding code to clear out disabled members from previous if (lost_and_found_id == mUUID) { // This is the lost+found folder. diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index b4d3f4575b..7ec8d3d003 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -131,6 +131,13 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item) && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); + + BOOL is_folder = (dynamic_cast(item) != NULL); + if (is_folder && mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS) + { + passed = TRUE; + } + return passed; } diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 14a8b7cb59..c99e67be3f 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -1234,9 +1234,9 @@ LLVector3 LLManipRotate::getConstraintAxis() else { #ifndef LL_RELEASE_FOR_DOWNLOAD - llerrs << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << llendl + llerrs << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << llendl; #else - llwarns << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << llendl + llwarns << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << llendl; #endif axis.mV[0] = 1.f; } diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index e2281743c9..206d8428be 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -101,14 +101,13 @@ void LLPanelGroupTab::handleClickHelp() } LLPanelGroup::LLPanelGroup() -: LLPanel() - ,LLGroupMgrObserver( LLUUID() ) - ,mAllowEdit(TRUE) +: LLPanel(), + LLGroupMgrObserver( LLUUID() ), + mAllowEdit( TRUE ) { // Set up the factory callbacks. // Roles sub tabs LLGroupMgr::getInstance()->addObserver(this); - } @@ -247,6 +246,7 @@ void LLPanelGroup::onBackBtnClick() } } + void LLPanelGroup::onBtnCreate() { LLPanelGroupGeneral* panel_general = findChild("group_general_tab_panel"); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 0331fad60c..a6b67d668a 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -186,7 +186,7 @@ BOOL LLPanelGroupGeneral::postBuild() } mIncompleteMemberDataStr = getString("incomplete_member_data_str"); - + // If the group_id is null, then we are creating a new group if (mGroupID.isNull()) { diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 32ed20bd56..ab2afb8056 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -1178,7 +1178,7 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data, else { llwarns << "Inventory item for gesture " << info->mItemUUID - << " is no longer in agent inventory." << llendl + << " is no longer in agent inventory." << llendl; } } else diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 19bb60b237..ac7abf1448 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1260,7 +1260,7 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 else { llwarns << "Inventory item for script " << info->mItemUUID - << " is no longer in agent inventory." << llendl + << " is no longer in agent inventory." << llendl; } // Find our window and close it if requested. @@ -1383,6 +1383,7 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset delete item_uuid; } + /// --------------------------------------------------------------------------- /// LLLiveLSLEditor /// --------------------------------------------------------------------------- @@ -2145,6 +2146,7 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) } } + void LLLiveLSLEditor::onMonoCheckboxClicked(LLUICtrl*, void* userdata) { LLLiveLSLEditor* self = static_cast(userdata); diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 9d7338c111..9c21faa3be 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -38,6 +38,7 @@ #include "llagent.h" #include "llbutton.h" +#include "llcombobox.h" #include "llfilepicker.h" #include "llfloaterreg.h" #include "llimagetga.h" @@ -57,6 +58,10 @@ const S32 CLIENT_RECT_VPAD = 4; const F32 SECONDS_TO_SHOW_FILE_SAVED_MSG = 8.f; +const F32 PREVIEW_TEXTURE_MAX_ASPECT = 200.f; +const F32 PREVIEW_TEXTURE_MIN_ASPECT = 0.005f; + + LLPreviewTexture::LLPreviewTexture(const LLSD& key) : LLPreview( key ), mLoadingFullImage( FALSE ), @@ -65,7 +70,8 @@ LLPreviewTexture::LLPreviewTexture(const LLSD& key) mIsCopyable(FALSE), mUpdateDimensions(TRUE), mLastHeight(0), - mLastWidth(0) + mLastWidth(0), + mAspectRatio(0.f) { const LLInventoryItem *item = getItem(); if(item) @@ -144,6 +150,10 @@ BOOL LLPreviewTexture::postBuild() } } + childSetCommitCallback("combo_aspect_ratio", onAspectRatioCommit, this); + LLComboBox* combo = getChild("combo_aspect_ratio"); + combo->setCurrentByIndex(0); + return LLPreview::postBuild(); } @@ -369,8 +379,13 @@ void LLPreviewTexture::updateDimensions() S32 max_client_width = gViewerWindow->getWindowWidth() - horiz_pad; S32 max_client_height = gViewerWindow->getWindowHeight() - vert_pad; + if (mAspectRatio > 0.f) + { + client_height = llceil((F32)client_width / mAspectRatio); + } + while ((client_width > max_client_width) || - (client_height > max_client_height ) ) + (client_height > max_client_height )) { client_width /= 2; client_height /= 2; @@ -383,12 +398,12 @@ void LLPreviewTexture::updateDimensions() childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->getFullWidth())); childSetTextArg("dimensions", "[HEIGHT]", llformat("%d", mImage->getFullHeight())); - // add space for dimensions + // add space for dimensions and aspect ratio S32 info_height = 0; - LLRect dim_rect; - childGetRect("dimensions", dim_rect); - S32 dim_height = dim_rect.getHeight(); - info_height += dim_height + CLIENT_RECT_VPAD; + LLRect aspect_rect; + childGetRect("combo_aspect_ratio", aspect_rect); + S32 aspect_height = aspect_rect.getHeight(); + info_height += aspect_height + CLIENT_RECT_VPAD; view_height += info_height; S32 button_height = 0; @@ -445,24 +460,96 @@ void LLPreviewTexture::updateDimensions() else { client_width = getRect().getWidth() - horiz_pad; - client_height = getRect().getHeight() - vert_pad; + if (mAspectRatio > 0) + { + client_height = llround(client_width / mAspectRatio); + } + else + { + client_height = getRect().getHeight() - vert_pad; + } } - S32 max_height = getRect().getHeight() - PREVIEW_BORDER - button_height + S32 max_height = getRect().getHeight() - PREVIEW_BORDER - button_height - CLIENT_RECT_VPAD - info_height - CLIENT_RECT_VPAD - PREVIEW_HEADER_SIZE; - S32 max_width = getRect().getWidth() - horiz_pad; - client_height = llclamp(client_height, 1, max_height); - client_width = llclamp(client_width, 1, max_width); + if (mAspectRatio > 0.f) + { + max_height = llmax(max_height, 1); + + if (client_height > max_height) + { + client_height = max_height; + client_width = llround(client_height * mAspectRatio); + } + } + else + { + S32 max_width = getRect().getWidth() - horiz_pad; + + client_height = llclamp(client_height, 1, max_height); + client_width = llclamp(client_width, 1, max_width); + } LLRect window_rect(0, getRect().getHeight(), getRect().getWidth(), 0); window_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD); window_rect.mBottom += PREVIEW_BORDER + button_height + CLIENT_RECT_VPAD + info_height + CLIENT_RECT_VPAD; - mClientRect.setLeftTopAndSize(window_rect.getCenterX() - (client_width / 2), window_rect.mTop, client_width, client_height); + mClientRect.setLeftTopAndSize(window_rect.getCenterX() - (client_width / 2), window_rect.mTop, client_width, client_height); + + // Hide the aspect ratio label if the window is too narrow + // Assumes the label should be to the right of the dimensions + LLRect dim_rect, aspect_label_rect; + childGetRect("aspect_ratio", aspect_label_rect); + childGetRect("dimensions", dim_rect); + childSetVisible("aspect_ratio", dim_rect.mRight < aspect_label_rect.mLeft); +} + + +// Return true if everything went fine, false if we somewhat modified the ratio as we bumped on border values +bool LLPreviewTexture::setAspectRatio(const F32 width, const F32 height) +{ + mUpdateDimensions = TRUE; + + // We don't allow negative width or height. Also, if height is positive but too small, we reset to default + // A default 0.f value for mAspectRatio means "unconstrained" in the rest of the code + if ((width <= 0.f) || (height <= F_APPROXIMATELY_ZERO)) + { + mAspectRatio = 0.f; + return false; + } + + // Compute and store the ratio + F32 ratio = width / height; + mAspectRatio = llclamp(ratio, PREVIEW_TEXTURE_MIN_ASPECT, PREVIEW_TEXTURE_MAX_ASPECT); + + // Return false if we clamped the value, true otherwise + return (ratio == mAspectRatio); } +void LLPreviewTexture::onAspectRatioCommit(LLUICtrl* ctrl, void* userdata) +{ + LLPreviewTexture* self = (LLPreviewTexture*) userdata; + + std::string ratio(ctrl->getValue().asString()); + std::string::size_type separator(ratio.find_first_of(":/\\")); + + if (std::string::npos == separator) { + // If there's no separator assume we want an unconstrained ratio + self->setAspectRatio( 0.f, 0.f ); + return; + } + + F32 width, height; + std::istringstream numerator(ratio.substr(0, separator)); + std::istringstream denominator(ratio.substr(separator + 1)); + numerator >> width; + denominator >> height; + + self->setAspectRatio( width, height ); +} + void LLPreviewTexture::loadAsset() { mImage = LLViewerTextureManager::getFetchedTexture(mImageID, MIPMAP_TRUE, FALSE, LLViewerTexture::LOD_TEXTURE); diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index 9ace304fa6..520626b49f 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -38,6 +38,7 @@ #include "llframetimer.h" #include "llviewertexture.h" +class LLComboBox; class LLImageRaw; class LLPreviewTexture : public LLPreview @@ -71,7 +72,9 @@ public: protected: void init(); /* virtual */ BOOL postBuild(); - + bool setAspectRatio(const F32 width, const F32 height); + static void onAspectRatioCommit(LLUICtrl*,void* userdata); + private: void updateDimensions(); LLUUID mImageID; @@ -88,6 +91,7 @@ private: S32 mLastHeight; S32 mLastWidth; + F32 mAspectRatio; BOOL mUpdateDimensions; }; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index d163ceb30e..288cf728b9 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -545,7 +545,7 @@ BOOL LLSelectMgr::removeObjectFromSelections(const LLUUID &id) object_found = TRUE; break; // must break here, may have removed multiple objects from list } - else if (object->isAvatar()) + else if (object->isAvatar() && object->getParent() && ((LLViewerObject*)object->getParent())->mID == id) { // It's possible the item being removed has an avatar sitting on it // So remove the avatar that is sitting on the object. diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index a49b07c5d9..de99cb86fa 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -66,6 +66,9 @@ F32 elevation_from_vector(const LLVector3 &v); LLSky gSky; // ---------------- LLSky ---------------- +const F32 LLSky::NIGHTTIME_ELEVATION = -8.0f; // degrees +const F32 LLSky::NIGHTTIME_ELEVATION_COS = (F32)sin(NIGHTTIME_ELEVATION*DEG_TO_RAD); + ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llsky.h b/indra/newview/llsky.h index abd4205e6c..d7796dea83 100644 --- a/indra/newview/llsky.h +++ b/indra/newview/llsky.h @@ -42,9 +42,6 @@ #include "llvosky.h" #include "llvoground.h" -const F32 NIGHTTIME_ELEVATION = -8.0f; // degrees -const F32 NIGHTTIME_ELEVATION_COS = (F32)sin(NIGHTTIME_ELEVATION*DEG_TO_RAD); - class LLViewerCamera; class LLVOWLSky; @@ -111,6 +108,9 @@ public: // Legacy stuff LLVector3 mSunDefaultPosition; + static const F32 NIGHTTIME_ELEVATION; // degrees + static const F32 NIGHTTIME_ELEVATION_COS; + protected: BOOL mOverrideSimSunPosition; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 62435c6288..9cd3acf13e 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -977,6 +977,13 @@ bool idle_startup() LLFile::mkdir(gDirUtilp->getChatLogsDir()); LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); + // chat history must be loaded AFTER chat directories are defined. + if (!gNoRender && gSavedPerAccountSettings.getBOOL("LogShowHistory")) + { + LLFloaterChat::loadHistory(); + } + + //good as place as any to create user windlight directories std::string user_windlight_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", "")); LLFile::mkdir(user_windlight_path_name.c_str()); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 63af170fa9..88fc7f98c0 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1371,7 +1371,7 @@ bool LLTextureFetch::createRequest(const std::string& filename, const LLUUID& id } else if (w*h*c > 0) { - // If the requester knows the dimentions of the image, + // If the requester knows the dimensions of the image, // this will calculate how much data we need without having to parse the header desired_size = LLImageJ2C::calcDataSizeJ2C(w, h, c, desired_discard); diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index ee6ef6ffee..f65baea6ca 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -120,9 +120,8 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, const LLVector3 &up_direction, const LLVector3 &point_of_interest) { - // do not update if we are in build mode AND avatar didn't move - if (LLToolMgr::getInstance()->inBuildMode() - && !LLViewerJoystick::getInstance()->getCameraNeedsUpdate()) + // do not update if avatar didn't move + if (!LLViewerJoystick::getInstance()->getCameraNeedsUpdate()) { return; } diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index fa82612114..b71291f834 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -688,7 +688,7 @@ static LLCachedControl test_BrowserHomePage("BrowserHomePage", "hah void test_cached_control() { -#define TEST_LLCC(T, V) if((T)mySetting_##T != V) llerrs << "Fail "#T << llendl +#define do { TEST_LLCC(T, V) if((T)mySetting_##T != V) llerrs << "Fail "#T << llendl; } while(0) TEST_LLCC(U32, 666); TEST_LLCC(S32, (S32)-666); TEST_LLCC(F32, (F32)-666.666); diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index b919e3d1c1..b593fbfb00 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -414,14 +414,41 @@ void LLViewerJoystick::agentFly(F32 inc) } // ----------------------------------------------------------------------------- -void LLViewerJoystick::agentRotate(F32 pitch_inc, F32 yaw_inc) +void LLViewerJoystick::agentPitch(F32 pitch_inc) { - LLQuaternion new_rot; - pitch_inc = gAgent.clampPitchToLimits(-pitch_inc); - const LLQuaternion qx(pitch_inc, gAgent.getLeftAxis()); - const LLQuaternion qy(-yaw_inc, gAgent.getReferenceUpVector()); - new_rot.setQuat(qx * qy); - gAgent.rotate(new_rot); + if (pitch_inc < 0) + { + gAgent.setControlFlags(AGENT_CONTROL_PITCH_POS); + } + else if (pitch_inc > 0) + { + gAgent.setControlFlags(AGENT_CONTROL_PITCH_NEG); + } + + gAgent.pitch(-pitch_inc); +} + +// ----------------------------------------------------------------------------- +void LLViewerJoystick::agentYaw(F32 yaw_inc) +{ + // Cannot steer some vehicles in mouselook if the script grabs the controls + if (gAgent.cameraMouselook() && !gSavedSettings.getBOOL("JoystickMouselookYaw")) + { + gAgent.rotate(-yaw_inc, gAgent.getReferenceUpVector()); + } + else + { + if (yaw_inc < 0) + { + gAgent.setControlFlags(AGENT_CONTROL_YAW_POS); + } + else if (yaw_inc > 0) + { + gAgent.setControlFlags(AGENT_CONTROL_YAW_NEG); + } + + gAgent.yaw(-yaw_inc); + } } // ----------------------------------------------------------------------------- @@ -595,12 +622,38 @@ void LLViewerJoystick::moveAvatar(bool reset) } bool is_zero = true; + static bool button_held = false; if (mBtn[1] == 1) { - agentJump(); + // If AutomaticFly is enabled, then button1 merely causes a + // jump (as the up/down axis already controls flying) if on the + // ground, or cease flight if already flying. + // If AutomaticFly is disabled, then button1 toggles flying. + if (gSavedSettings.getBOOL("AutomaticFly")) + { + if (!gAgent.getFlying()) + { + gAgent.moveUp(1); + } + else if (!button_held) + { + button_held = true; + gAgent.setFlying(FALSE); + } + } + else if (!button_held) + { + button_held = true; + gAgent.setFlying(!gAgent.getFlying()); + } + is_zero = false; } + else + { + button_held = false; + } F32 axis_scale[] = { @@ -758,11 +811,13 @@ void LLViewerJoystick::moveAvatar(bool reset) { if (gAgent.getFlying()) { - agentRotate(eff_rx, eff_ry); + agentPitch(eff_rx); + agentYaw(eff_ry); } else { - agentRotate(eff_rx, 2.f * eff_ry); + agentPitch(eff_rx); + agentYaw(2.f * eff_ry); } } } @@ -771,7 +826,8 @@ void LLViewerJoystick::moveAvatar(bool reset) agentSlide(sDelta[X_I]); // move sideways agentFly(sDelta[Y_I]); // up/down & crouch agentPush(sDelta[Z_I]); // forward/back - agentRotate(sDelta[RX_I], sDelta[RY_I]); // pitch & turn + agentPitch(sDelta[RX_I]); // pitch + agentYaw(sDelta[RY_I]); // turn } } @@ -963,15 +1019,10 @@ bool LLViewerJoystick::toggleFlycam() moveFlycam(true); } - else if (!LLToolMgr::getInstance()->inBuildMode()) - { - moveAvatar(true); - } else { - // we are in build mode, exiting from the flycam mode: since we are - // going to keep the flycam POV for the main camera until the avatar - // moves, we need to track this situation. + // Exiting from the flycam mode: since we are going to keep the flycam POV for + // the main camera until the avatar moves, we need to track this situation. setCameraNeedsUpdate(false); setNeedsReset(true); } diff --git a/indra/newview/llviewerjoystick.h b/indra/newview/llviewerjoystick.h index b565ed5696..a3904bd2c3 100644 --- a/indra/newview/llviewerjoystick.h +++ b/indra/newview/llviewerjoystick.h @@ -82,8 +82,9 @@ protected: void agentSlide(F32 inc); void agentPush(F32 inc); void agentFly(F32 inc); - void agentRotate(F32 pitch_inc, F32 turn_inc); - void agentJump(); + void agentPitch(F32 pitch_inc); + void agentYaw(F32 yaw_inc); + void agentJump(); void resetDeltas(S32 axis[]); #if LIB_NDOF static NDOF_HotPlugResult HotPlugAddCallback(NDOF_Device *dev); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 2b972614f1..b8e945a7b8 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1000,6 +1000,7 @@ BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask) return TRUE; } + ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateHome() { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index b4e0d88e79..c2def610dc 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4733,6 +4733,96 @@ class LLToolsSnapObjectXY : public view_listener_t } }; +// Determine if the option to cycle between linked prims is shown +class LLToolsEnableSelectNextPart : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = (gSavedSettings.getBOOL("EditLinkedParts") && + !LLSelectMgr::getInstance()->getSelection()->isEmpty()); + return new_value; + } +}; + +// Cycle selection through linked children in selected object. +// FIXME: Order of children list is not always the same as sim's idea of link order. This may confuse +// resis. Need link position added to sim messages to address this. +class LLToolsSelectNextPart : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); + if (gSavedSettings.getBOOL("EditLinkedParts") && object_count) + { + LLViewerObject* selected = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); + if (selected && selected->getRootEdit()) + { + bool fwd = (userdata.asString() == "next"); + bool prev = (userdata.asString() == "previous"); + bool ifwd = (userdata.asString() == "includenext"); + bool iprev = (userdata.asString() == "includeprevious"); + LLViewerObject* to_select = NULL; + LLViewerObject::child_list_t children = selected->getRootEdit()->getChildren(); + children.push_front(selected->getRootEdit()); // need root in the list too + + for (LLViewerObject::child_list_t::iterator iter = children.begin(); iter != children.end(); ++iter) + { + if ((*iter)->isSelected()) + { + if (object_count > 1 && (fwd || prev)) // multiple selection, find first or last selected if not include + { + to_select = *iter; + if (fwd) + { + // stop searching if going forward; repeat to get last hit if backward + break; + } + } + else if ((object_count == 1) || (ifwd || iprev)) // single selection or include + { + if (fwd || ifwd) + { + ++iter; + while (iter != children.end() && ((*iter)->isAvatar() || (ifwd && (*iter)->isSelected()))) + { + ++iter; // skip sitting avatars and selected if include + } + } + else // backward + { + iter = (iter == children.begin() ? children.end() : iter); + --iter; + while (iter != children.begin() && ((*iter)->isAvatar() || (iprev && (*iter)->isSelected()))) + { + --iter; // skip sitting avatars and selected if include + } + } + iter = (iter == children.end() ? children.begin() : iter); + to_select = *iter; + break; + } + } + } + + if (to_select) + { + if (gFocusMgr.childHasKeyboardFocus(gFloaterTools)) + { + gFocusMgr.setKeyboardFocus(NULL); // force edit toolbox to commit any changes + } + if (fwd || prev) + { + LLSelectMgr::getInstance()->deselectAll(); + } + LLSelectMgr::getInstance()->selectObjectOnly(to_select); + return true; + } + } + } + return true; + } +}; + // in order to link, all objects must have the same owner, and the // agent must have the ability to modify all of the objects. However, // we're not answering that question with this method. The question @@ -7729,6 +7819,7 @@ void initialize_menus() view_listener_t::addMenu(new LLToolsEditLinkedParts(), "Tools.EditLinkedParts"); view_listener_t::addMenu(new LLToolsSnapObjectXY(), "Tools.SnapObjectXY"); view_listener_t::addMenu(new LLToolsUseSelectionForGrid(), "Tools.UseSelectionForGrid"); + view_listener_t::addMenu(new LLToolsSelectNextPart(), "Tools.SelectNextPart"); view_listener_t::addMenu(new LLToolsLink(), "Tools.Link"); view_listener_t::addMenu(new LLToolsUnlink(), "Tools.Unlink"); view_listener_t::addMenu(new LLToolsStopAllAnimations(), "Tools.StopAllAnimations"); @@ -7742,6 +7833,7 @@ void initialize_menus() view_listener_t::addMenu(new LLToolsSelectedScriptAction(), "Tools.SelectedScriptAction"); view_listener_t::addMenu(new LLToolsEnableToolNotPie(), "Tools.EnableToolNotPie"); + view_listener_t::addMenu(new LLToolsEnableSelectNextPart(), "Tools.EnableSelectNextPart"); view_listener_t::addMenu(new LLToolsEnableLink(), "Tools.EnableLink"); view_listener_t::addMenu(new LLToolsEnableUnlink(), "Tools.EnableUnlink"); view_listener_t::addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake"); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 1cfeec5627..d3a9e1cef8 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -219,7 +219,7 @@ const std::string upload_pick(void* data) args["EXTENSION"] = ext; args["VALIDS"] = valid_extensions; LLNotifications::instance().add("InvalidFileExtension", args); - return NULL; + return std::string(); } }//end else (non-null extension) diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index acdc2c2513..1d982265ca 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -174,11 +174,28 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) U32 port = region_host.getPort(); U64 ipport = (((U64)ip) << 32) | (U64)port; U32 index = sIPAndPortToIndex[ipport]; - + + // llinfos << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << llendl; + U64 indexid = (((U64)index) << 32) | (U64)local_id; - return sIndexAndLocalIDToUUID.erase(indexid) > 0 ? TRUE : FALSE; + + std::map::iterator iter = sIndexAndLocalIDToUUID.find(indexid); + if (iter == sIndexAndLocalIDToUUID.end()) + { + return FALSE; + } + + // Found existing entry + if (iter->second == object.getID()) + { // Full UUIDs match, so remove the entry + sIndexAndLocalIDToUUID.erase(iter); + return TRUE; + } + // UUIDs did not match - this would zap a valid entry, so don't erase it + //llinfos << "Tried to erase entry where id in table (" + // << iter->second << ") did not match object " << object.getID() << llendl; } - + return FALSE ; } @@ -200,6 +217,9 @@ void LLViewerObjectList::setUUIDAndLocal(const LLUUID &id, U64 indexid = (((U64)index) << 32) | (U64)local_id; sIndexAndLocalIDToUUID[indexid] = id; + + //llinfos << "Adding object to table, full ID " << id + // << ", local ID " << local_id << ", ip " << ip << ":" << port << llendl; } S32 gFullObjectUpdates = 0; @@ -246,8 +266,8 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, { if ( LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance() ) { - //llinfos << "DEBUG selecting " << objectp->mID << " " - // << objectp->mLocalID << llendl; + // llinfos << "DEBUG selecting " << objectp->mID << " " + // << objectp->mLocalID << llendl; LLSelectMgr::getInstance()->selectObjectAndFamily(objectp); dialog_refresh_all(); } @@ -294,7 +314,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { size = mesgsys->getReceiveSize(); } -// llinfos << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl; + // llinfos << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl; } else { @@ -308,7 +328,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, size = mesgsys->getReceiveSize(); } -// llinfos << "Received " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl; + // llinfos << "Received " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl; gFullObjectUpdates += num_objects; } @@ -318,7 +338,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (!regionp) { - llwarns << "Object update from unknown region!" << llendl; + llwarns << "Object update from unknown region! " << region_handle << llendl; return; } @@ -357,7 +377,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, U8 compbuffer[2048]; S32 uncompressed_length = 2048; S32 compressed_length; - compressed_dp.reset(); U32 flags = 0; @@ -398,7 +417,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, gMessageSystem->getSenderPort()); if (fullid.isNull()) { - //llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << llendl; + // llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << ":" << gMessageSystem->getSenderPort() << llendl; mNumUnknownUpdates++; } } @@ -412,7 +431,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, gMessageSystem->getSenderPort()); if (fullid.isNull()) { - //llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << llendl; + // llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << llendl; mNumUnknownUpdates++; } } @@ -420,19 +439,43 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { mesgsys->getUUIDFast(_PREHASH_ObjectData, _PREHASH_FullID, fullid, i); mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i); - // llinfos << "Full Update, obj " << local_id << ", global ID" << fullid << "from " << mesgsys->getSender() << llendl; + // llinfos << "Full Update, obj " << local_id << ", global ID" << fullid << "from " << mesgsys->getSender() << llendl; } objectp = findObject(fullid); // This looks like it will break if the local_id of the object doesn't change // upon boundary crossing, but we check for region id matching later... - if (objectp && (objectp->mLocalID != local_id)) + // Reset object local id and region pointer if things have changed + if (objectp && + ((objectp->mLocalID != local_id) || + (objectp->getRegion() != regionp))) { + //if (objectp->getRegion()) + //{ + // llinfos << "Local ID change: Removing object from table, local ID " << objectp->mLocalID + // << ", id from message " << local_id << ", from " + // << LLHost(objectp->getRegion()->getHost().getAddress(), objectp->getRegion()->getHost().getPort()) + // << ", full id " << fullid + // << ", objects id " << objectp->getID() + // << ", regionp " << (U32) regionp << ", object region " << (U32) objectp->getRegion() + // << llendl; + //} removeFromLocalIDTable(*objectp); setUUIDAndLocal(fullid, local_id, gMessageSystem->getSenderIP(), gMessageSystem->getSenderPort()); + + if (objectp->mLocalID != local_id) + { // Update local ID in object with the one sent from the region + objectp->mLocalID = local_id; + } + + if (objectp->getRegion() != regionp) + { // Object changed region, so update it + objectp->setRegion(regionp); + objectp->updateRegion(regionp); // for LLVOAvatar + } } if (!objectp) @@ -441,7 +484,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { if (update_type == OUT_TERSE_IMPROVED) { - // llinfos << "terse update for an unknown object:" << fullid << llendl; + // llinfos << "terse update for an unknown object:" << fullid << llendl; continue; } } @@ -452,7 +495,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { if (update_type != OUT_FULL) { -// llinfos << "terse update for an unknown object:" << fullid << llendl; + // llinfos << "terse update for an unknown object:" << fullid << llendl; continue; } @@ -462,7 +505,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (mDeadObjects.find(fullid) != mDeadObjects.end()) { mNumDeadObjectUpdates++; - //llinfos << "update for a dead object:" << fullid << llendl; + // llinfos << "update for a dead object:" << fullid << llendl; continue; } #endif @@ -475,20 +518,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, justCreated = TRUE; mNumNewObjects++; } - else - { - if (objectp->getRegion() != regionp) - { - // Object has changed region! Update lookup tables, set region pointer. - removeFromLocalIDTable(*objectp); - setUUIDAndLocal(fullid, - local_id, - gMessageSystem->getSenderIP(), - gMessageSystem->getSenderPort()); - objectp->setRegion(regionp); - } - objectp->updateRegion(regionp); // for LLVOAvatar - } if (objectp->isDead()) @@ -623,7 +652,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent) mCurLazyUpdateIndex = 0; } - mCurBin = (++mCurBin) % NUM_BINS; + mCurBin = (mCurBin + 1) % NUM_BINS; LLVOAvatar::cullAvatarsByPixelArea(); } @@ -808,6 +837,14 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) // Remove from object map so noone can look it up. mUUIDObjectMap.erase(objectp->mID); + + //if (objectp->getRegion()) + //{ + // llinfos << "cleanupReferences removing object from table, local ID " << objectp->mLocalID << ", ip " + // << objectp->getRegion()->getHost().getAddress() << ":" + // << objectp->getRegion()->getHost().getPort() << llendl; + //} + removeFromLocalIDTable(*objectp); if (objectp->onActiveList()) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 3cc379821a..273ca8bd1a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1502,11 +1502,6 @@ void LLViewerWindow::initWorldUI() // currently needs to happen before initializing chat or IM LLFloaterReg::getInstance("communicate"); - if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) - { - LLFloaterChat::loadHistory(); - } - LLRect morph_view_rect = full_window; morph_view_rect.stretch( -STATUS_BAR_HEIGHT ); morph_view_rect.mTop = full_window.mTop - 32; diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 6401389c8f..ca028269fe 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -1664,7 +1664,6 @@ void LLVoiceClient::stateMachine() // SLIM SDK: these arguments are no longer necessary. // std::string args = " -p tcp -h -c"; std::string args; - std::string cmd; std::string loglevel = gSavedSettings.getString("VivoxDebugLevel"); if(loglevel.empty()) @@ -1679,17 +1678,18 @@ void LLVoiceClient::stateMachine() #if LL_WINDOWS PROCESS_INFORMATION pinfo; - STARTUPINFOA sinfo; + STARTUPINFOW sinfo; memset(&sinfo, 0, sizeof(sinfo)); - std::string exe_dir = gDirUtilp->getAppRODataDir(); - cmd = "SLVoice.exe"; - cmd += args; - - // So retarded. Windows requires that the second parameter to CreateProcessA be a writable (non-const) string... - char *args2 = new char[args.size() + 1]; - strcpy(args2, args.c_str()); - if(!CreateProcessA(exe_path.c_str(), args2, NULL, NULL, FALSE, 0, NULL, exe_dir.c_str(), &sinfo, &pinfo)) + std::string exe_dir = gDirUtilp->getExecutableDir(); + + llutf16string exe_path16 = utf8str_to_utf16str(exe_path); + llutf16string exe_dir16 = utf8str_to_utf16str(exe_dir); + llutf16string args16 = utf8str_to_utf16str(args); + // Create a writeable copy to keep Windows happy. + U16 *argscpy_16 = new U16[args16.size() + 1]; + wcscpy_s(argscpy_16,args16.size()+1,args16.c_str()); + if(!CreateProcessW(exe_path16.c_str(), argscpy_16, NULL, NULL, FALSE, 0, NULL, exe_dir16.c_str(), &sinfo, &pinfo)) { // DWORD dwErr = GetLastError(); } @@ -1701,7 +1701,7 @@ void LLVoiceClient::stateMachine() CloseHandle(pinfo.hThread); // stops leaks - nothing else } - delete[] args2; + delete[] argscpy_16; #else // LL_WINDOWS // This should be the same for mac and linux { @@ -4972,7 +4972,7 @@ void LLVoiceClient::sessionState::removeAllParticipants() if(!mParticipantsByUUID.empty()) { - LL_ERRS("Voice") << "Internal error: empty URI map, non-empty UUID map" << LL_ENDL + LL_ERRS("Voice") << "Internal error: empty URI map, non-empty UUID map" << LL_ENDL; } } @@ -6488,7 +6488,7 @@ void LLVoiceClient::deleteSession(sessionState *session) { if(iter->second != session) { - LL_ERRS("Voice") << "Internal error: session mismatch" << LL_ENDL + LL_ERRS("Voice") << "Internal error: session mismatch" << LL_ENDL; } mSessionsByHandle.erase(iter); } @@ -6528,7 +6528,7 @@ void LLVoiceClient::deleteAllSessions() if(!mSessionsByHandle.empty()) { - LL_ERRS("Voice") << "Internal error: empty session map, non-empty handle map" << LL_ENDL + LL_ERRS("Voice") << "Internal error: empty session map, non-empty handle map" << LL_ENDL; } } diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 33b86660fa..d44c543266 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -965,7 +965,7 @@ void LLVOSky::calcAtmospherics(void) // and vary_sunlight will work properly with moon light F32 lighty = unclamped_lightnorm[1]; - if(lighty < NIGHTTIME_ELEVATION_COS) + if(lighty < LLSky::NIGHTTIME_ELEVATION_COS) { lighty = -lighty; } diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index 466cdfdcd0..62c934fb41 100644 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -147,7 +147,7 @@ protected: static S32 getResolution() { return sResolution; } static S32 getCurrent() { return sCurrent; } - static S32 stepCurrent() { return (sCurrent = ++sCurrent % 2); } + static S32 stepCurrent() { return (sCurrent = (sCurrent + 1) % 2); } static S32 getNext() { return ((sCurrent+1) % 2); } static S32 getWhich(const BOOL curr) { return curr ? sCurrent : getNext(); } diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index 136ffe607d..c8cc6a3d8e 100644 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -304,7 +304,7 @@ void LLWaterParamManager::update(LLViewerCamera * cam) mWaterPlane = LLVector4(enorm.v[0], enorm.v[1], enorm.v[2], -ep.dot(enorm)); LLVector3 sunMoonDir; - if (gSky.getSunDirection().mV[2] > NIGHTTIME_ELEVATION_COS) + if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS) { sunMoonDir = gSky.getSunDirection(); } diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index 4bf64816c7..1581153c19 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -317,7 +317,7 @@ void LLWLParamManager::propagateParameters(void) { mLightDir = sunDir; } - else if(sunDir.mV[1] < 0 && sunDir.mV[1] > NIGHTTIME_ELEVATION_COS) + else if(sunDir.mV[1] < 0 && sunDir.mV[1] > LLSky::NIGHTTIME_ELEVATION_COS) { // clamp v1 to 0 so sun never points up and causes weirdness on some machines LLVector3 vec(sunDir.mV[0], sunDir.mV[1], sunDir.mV[2]); diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index a2fd0f0d9c..58ff84a8a6 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -150,11 +150,11 @@ XMLRPC_VALUE LLXMLRPCValue::getValue() const class LLXMLRPCTransaction::Impl { public: - typedef LLXMLRPCTransaction::Status Status; + typedef LLXMLRPCTransaction::EStatus EStatus; LLCurlEasyRequest* mCurlRequest; - Status mStatus; + EStatus mStatus; CURLcode mCurlCode; std::string mStatusMessage; std::string mStatusURI; @@ -176,7 +176,7 @@ public: bool process(); - void setStatus(Status code, + void setStatus(EStatus code, const std::string& message = "", const std::string& uri = ""); void setCurlStatus(CURLcode); @@ -385,7 +385,7 @@ bool LLXMLRPCTransaction::Impl::process() return false; } -void LLXMLRPCTransaction::Impl::setStatus(Status status, +void LLXMLRPCTransaction::Impl::setStatus(EStatus status, const std::string& message, const std::string& uri) { mStatus = status; @@ -509,7 +509,7 @@ bool LLXMLRPCTransaction::process() return impl.process(); } -LLXMLRPCTransaction::Status LLXMLRPCTransaction::status(int* curlCode) +LLXMLRPCTransaction::EStatus LLXMLRPCTransaction::status(int* curlCode) { if (curlCode) { diff --git a/indra/newview/llxmlrpctransaction.h b/indra/newview/llxmlrpctransaction.h index 528451fcb2..c835423d67 100644 --- a/indra/newview/llxmlrpctransaction.h +++ b/indra/newview/llxmlrpctransaction.h @@ -100,7 +100,7 @@ public: ~LLXMLRPCTransaction(); - typedef enum { + typedef enum e_status { StatusNotStarted, StatusStarted, StatusDownloading, @@ -108,12 +108,12 @@ public: StatusCURLError, StatusXMLRPCError, StatusOtherError - } Status; + } EStatus; bool process(); // run the request a little, returns true when done - Status status(int* curlCode); + EStatus status(int* curlCode); // return status, and extended CURL code, if code isn't null std::string statusMessage(); // return a message string, suitable for showing the user diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index c736d0ccc8..3800b9223d 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -35,7 +35,7 @@ #include "pipeline.h" // library includes -#include "llaudioengine.h" // For MAX_BUFFERS for debugging. +#include "llaudioengine.h" // For debugging. #include "imageids.h" #include "llerror.h" #include "llviewercontrol.h" @@ -4289,7 +4289,7 @@ void LLPipeline::setupAvatarLights(BOOL for_edit) } } F32 backlight_mag; - if (gSky.getSunDirection().mV[2] >= NIGHTTIME_ELEVATION_COS) + if (gSky.getSunDirection().mV[2] >= LLSky::NIGHTTIME_ELEVATION_COS) { backlight_mag = BACKLIGHT_DAY_MAGNITUDE_OBJECT; } @@ -4475,7 +4475,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) // Light 0 = Sun or Moon (All objects) { - if (gSky.getSunDirection().mV[2] >= NIGHTTIME_ELEVATION_COS) + if (gSky.getSunDirection().mV[2] >= LLSky::NIGHTTIME_ELEVATION_COS) { mSunDir.setVec(gSky.getSunDirection()); mSunDiffuse.setVec(gSky.getSunDiffuseColor()); diff --git a/indra/newview/res-sdl/arrow.BMP b/indra/newview/res-sdl/arrow.BMP new file mode 100644 index 0000000000..a8f6da64b5 Binary files /dev/null and b/indra/newview/res-sdl/arrow.BMP differ diff --git a/indra/newview/res-sdl/arrowcop.BMP b/indra/newview/res-sdl/arrowcop.BMP new file mode 100644 index 0000000000..1a26a0df34 Binary files /dev/null and b/indra/newview/res-sdl/arrowcop.BMP differ diff --git a/indra/newview/res-sdl/arrowcopmulti.BMP b/indra/newview/res-sdl/arrowcopmulti.BMP new file mode 100644 index 0000000000..48f153cef6 Binary files /dev/null and b/indra/newview/res-sdl/arrowcopmulti.BMP differ diff --git a/indra/newview/res-sdl/arrowdrag.BMP b/indra/newview/res-sdl/arrowdrag.BMP new file mode 100644 index 0000000000..cd868eec20 Binary files /dev/null and b/indra/newview/res-sdl/arrowdrag.BMP differ diff --git a/indra/newview/res-sdl/circleandline.BMP b/indra/newview/res-sdl/circleandline.BMP new file mode 100644 index 0000000000..284ae8b7d5 Binary files /dev/null and b/indra/newview/res-sdl/circleandline.BMP differ diff --git a/indra/newview/res-sdl/cross.BMP b/indra/newview/res-sdl/cross.BMP new file mode 100644 index 0000000000..0b4672d4d6 Binary files /dev/null and b/indra/newview/res-sdl/cross.BMP differ diff --git a/indra/newview/res-sdl/hand.BMP b/indra/newview/res-sdl/hand.BMP new file mode 100644 index 0000000000..2a092fbb7f Binary files /dev/null and b/indra/newview/res-sdl/hand.BMP differ diff --git a/indra/newview/res-sdl/ibeam.BMP b/indra/newview/res-sdl/ibeam.BMP new file mode 100644 index 0000000000..820904a228 Binary files /dev/null and b/indra/newview/res-sdl/ibeam.BMP differ diff --git a/indra/newview/res-sdl/ll_icon.BMP b/indra/newview/res-sdl/ll_icon.BMP new file mode 100644 index 0000000000..4a44aafbfa Binary files /dev/null and b/indra/newview/res-sdl/ll_icon.BMP differ diff --git a/indra/newview/res-sdl/llarrow.BMP b/indra/newview/res-sdl/llarrow.BMP new file mode 100644 index 0000000000..a8f6da64b5 Binary files /dev/null and b/indra/newview/res-sdl/llarrow.BMP differ diff --git a/indra/newview/res-sdl/llarrowdrag.BMP b/indra/newview/res-sdl/llarrowdrag.BMP new file mode 100644 index 0000000000..cd868eec20 Binary files /dev/null and b/indra/newview/res-sdl/llarrowdrag.BMP differ diff --git a/indra/newview/res-sdl/llarrowdragmulti.BMP b/indra/newview/res-sdl/llarrowdragmulti.BMP new file mode 100644 index 0000000000..fb528bc92d Binary files /dev/null and b/indra/newview/res-sdl/llarrowdragmulti.BMP differ diff --git a/indra/newview/res-sdl/llarrowlocked.BMP b/indra/newview/res-sdl/llarrowlocked.BMP new file mode 100644 index 0000000000..0aaa441ab1 Binary files /dev/null and b/indra/newview/res-sdl/llarrowlocked.BMP differ diff --git a/indra/newview/res-sdl/llgrablocked.BMP b/indra/newview/res-sdl/llgrablocked.BMP new file mode 100644 index 0000000000..847439670f Binary files /dev/null and b/indra/newview/res-sdl/llgrablocked.BMP differ diff --git a/indra/newview/res-sdl/llno.BMP b/indra/newview/res-sdl/llno.BMP new file mode 100644 index 0000000000..284ae8b7d5 Binary files /dev/null and b/indra/newview/res-sdl/llno.BMP differ diff --git a/indra/newview/res-sdl/llnolocked.BMP b/indra/newview/res-sdl/llnolocked.BMP new file mode 100644 index 0000000000..61f0170cb3 Binary files /dev/null and b/indra/newview/res-sdl/llnolocked.BMP differ diff --git a/indra/newview/res-sdl/lltoolcamera.BMP b/indra/newview/res-sdl/lltoolcamera.BMP new file mode 100644 index 0000000000..c961d7a49c Binary files /dev/null and b/indra/newview/res-sdl/lltoolcamera.BMP differ diff --git a/indra/newview/res-sdl/lltoolcreate.BMP b/indra/newview/res-sdl/lltoolcreate.BMP new file mode 100644 index 0000000000..08a4a9322d Binary files /dev/null and b/indra/newview/res-sdl/lltoolcreate.BMP differ diff --git a/indra/newview/res-sdl/lltoolfocus.BMP b/indra/newview/res-sdl/lltoolfocus.BMP new file mode 100644 index 0000000000..afb90a95e3 Binary files /dev/null and b/indra/newview/res-sdl/lltoolfocus.BMP differ diff --git a/indra/newview/res-sdl/lltoolgrab.BMP b/indra/newview/res-sdl/lltoolgrab.BMP new file mode 100644 index 0000000000..f2ac68bf3c Binary files /dev/null and b/indra/newview/res-sdl/lltoolgrab.BMP differ diff --git a/indra/newview/res-sdl/lltoolland.BMP b/indra/newview/res-sdl/lltoolland.BMP new file mode 100644 index 0000000000..64e6365625 Binary files /dev/null and b/indra/newview/res-sdl/lltoolland.BMP differ diff --git a/indra/newview/res-sdl/lltoolpan.BMP b/indra/newview/res-sdl/lltoolpan.BMP new file mode 100644 index 0000000000..ffbef21ec7 Binary files /dev/null and b/indra/newview/res-sdl/lltoolpan.BMP differ diff --git a/indra/newview/res-sdl/lltoolpipette.BMP b/indra/newview/res-sdl/lltoolpipette.BMP new file mode 100644 index 0000000000..2d27118289 Binary files /dev/null and b/indra/newview/res-sdl/lltoolpipette.BMP differ diff --git a/indra/newview/res-sdl/lltoolrotate.BMP b/indra/newview/res-sdl/lltoolrotate.BMP new file mode 100644 index 0000000000..dd84673018 Binary files /dev/null and b/indra/newview/res-sdl/lltoolrotate.BMP differ diff --git a/indra/newview/res-sdl/lltoolscale.BMP b/indra/newview/res-sdl/lltoolscale.BMP new file mode 100644 index 0000000000..882515e5e3 Binary files /dev/null and b/indra/newview/res-sdl/lltoolscale.BMP differ diff --git a/indra/newview/res-sdl/lltooltranslate.BMP b/indra/newview/res-sdl/lltooltranslate.BMP new file mode 100644 index 0000000000..d084f6a026 Binary files /dev/null and b/indra/newview/res-sdl/lltooltranslate.BMP differ diff --git a/indra/newview/res-sdl/lltoolzoomin.BMP b/indra/newview/res-sdl/lltoolzoomin.BMP new file mode 100644 index 0000000000..e4e46cc702 Binary files /dev/null and b/indra/newview/res-sdl/lltoolzoomin.BMP differ diff --git a/indra/newview/res-sdl/lltoolzoomout.BMP b/indra/newview/res-sdl/lltoolzoomout.BMP new file mode 100644 index 0000000000..7f958383ab Binary files /dev/null and b/indra/newview/res-sdl/lltoolzoomout.BMP differ diff --git a/indra/newview/res-sdl/sizenesw.BMP b/indra/newview/res-sdl/sizenesw.BMP new file mode 100644 index 0000000000..559579f40e Binary files /dev/null and b/indra/newview/res-sdl/sizenesw.BMP differ diff --git a/indra/newview/res-sdl/sizens.BMP b/indra/newview/res-sdl/sizens.BMP new file mode 100644 index 0000000000..8373077dff Binary files /dev/null and b/indra/newview/res-sdl/sizens.BMP differ diff --git a/indra/newview/res-sdl/sizenwse.BMP b/indra/newview/res-sdl/sizenwse.BMP new file mode 100644 index 0000000000..6d069fa765 Binary files /dev/null and b/indra/newview/res-sdl/sizenwse.BMP differ diff --git a/indra/newview/res-sdl/sizewe.BMP b/indra/newview/res-sdl/sizewe.BMP new file mode 100644 index 0000000000..878df453a4 Binary files /dev/null and b/indra/newview/res-sdl/sizewe.BMP differ diff --git a/indra/newview/res-sdl/toolmediaopen.BMP b/indra/newview/res-sdl/toolmediaopen.BMP new file mode 100644 index 0000000000..ac4b231994 Binary files /dev/null and b/indra/newview/res-sdl/toolmediaopen.BMP differ diff --git a/indra/newview/res-sdl/toolpause.BMP b/indra/newview/res-sdl/toolpause.BMP new file mode 100644 index 0000000000..dd2c6857d2 Binary files /dev/null and b/indra/newview/res-sdl/toolpause.BMP differ diff --git a/indra/newview/res-sdl/toolpickobject.BMP b/indra/newview/res-sdl/toolpickobject.BMP new file mode 100644 index 0000000000..25469fc3a8 Binary files /dev/null and b/indra/newview/res-sdl/toolpickobject.BMP differ diff --git a/indra/newview/res-sdl/toolpickobject2.BMP b/indra/newview/res-sdl/toolpickobject2.BMP new file mode 100644 index 0000000000..09df69e675 Binary files /dev/null and b/indra/newview/res-sdl/toolpickobject2.BMP differ diff --git a/indra/newview/res-sdl/toolpickobject3.BMP b/indra/newview/res-sdl/toolpickobject3.BMP new file mode 100644 index 0000000000..fc28698050 Binary files /dev/null and b/indra/newview/res-sdl/toolpickobject3.BMP differ diff --git a/indra/newview/res-sdl/toolplay.BMP b/indra/newview/res-sdl/toolplay.BMP new file mode 100644 index 0000000000..9c40d7dbec Binary files /dev/null and b/indra/newview/res-sdl/toolplay.BMP differ diff --git a/indra/newview/res-sdl/wait.BMP b/indra/newview/res-sdl/wait.BMP new file mode 100644 index 0000000000..26dec59afe Binary files /dev/null and b/indra/newview/res-sdl/wait.BMP differ diff --git a/indra/newview/res-sdl/working.BMP b/indra/newview/res-sdl/working.BMP new file mode 100644 index 0000000000..26dec59afe Binary files /dev/null and b/indra/newview/res-sdl/working.BMP differ diff --git a/indra/newview/skins/default/xui/en/floater_auction.xml b/indra/newview/skins/default/xui/en/floater_auction.xml index 29f8b49794..fb0994b4cd 100644 --- a/indra/newview/skins/default/xui/en/floater_auction.xml +++ b/indra/newview/skins/default/xui/en/floater_auction.xml @@ -1,9 +1,9 @@ + width="150"> + + diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml index a243cb399e..5ee136c422 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_texture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml @@ -49,7 +49,7 @@ layout="topleft" left="80" name="Discard" - top="302" + top="283" width="100" /> + width="222" + sort_column="1"> + shortcut="control|M" + use_mac_ctrl="true"> @@ -981,6 +982,57 @@ + + + + + + + + + + + + + + + + + + + shortcut="control|shift|3" + use_mac_ctrl="true"> @@ -1615,7 +1668,8 @@ label="Debug Console" layout="topleft" name="Debug Console" - shortcut="control|shift|4"> + shortcut="control|shift|4" + use_mac_ctrl="true"> @@ -1627,7 +1681,8 @@ label="Fast Timers" layout="topleft" name="Fast Timers" - shortcut="control|shift|9"> + shortcut="control|shift|9" + use_mac_ctrl="true"> @@ -1639,7 +1694,8 @@ label="Memory" layout="topleft" name="Memory" - shortcut="control|shift|0"> + shortcut="control|shift|0" + use_mac_ctrl="true"> @@ -1651,7 +1707,8 @@ label="Notifications Console" layout="topleft" name="Notifications" - shortcut="control|shift|5"> + shortcut="control|shift|5" + use_mac_ctrl="true"> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 91c19badfa..217178a5ef 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -483,6 +483,20 @@ Joining this group costs L$[COST]. You do not have enough L$ to join this group. + +Creating this group will cost L$100. +Groups need more than one member, or they are deleted forever. +Please invite members within 48 hours. + + + - + - - -Creating this group will cost L$100. -Groups need more than one member, or they are deleted forever. -Please invite members within 48 hours. - - diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml index 9a4480127d..6f01202680 100644 --- a/indra/newview/skins/default/xui/en/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -212,4 +212,4 @@ Hover your mouse over the options for more help. value="Not Mature" /> - \ No newline at end of file + diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 06ecfdc995..f7d7d52b68 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -217,7 +217,7 @@ My Avatar: width="237" top_pad="0"/> - - - \ No newline at end of file + diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index f620e8f2d7..360fd3c2db 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -230,8 +230,10 @@ Yes (Happy) Yes + Loading... Offline + None found. OK @@ -2110,6 +2112,15 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh Add Landmark... Edit Landmark... + + Ctrl- + Cmd- + Opt- + Shift- + Ctrl+ + Alt+ + Shift+ + File Saved Receiving @@ -2225,9 +2236,8 @@ Running in window. Can't find suitable pixel format Can't get pixel format description - [APP_NAME] requires True Color (32-bit) to run in a window. -Please go to Control Panels > Display > Settings and set the screen to 32-bit color. -Alternately, if you choose to run fullscreen, [APP_NAME] will automatically adjust the screen each time it runs. + [APP_NAME] requires True Color (32-bit) to run. +Please go to your computer's display settings and set the color mode to 32-bit. [APP_NAME] is unable to run because it can't get an 8 bit alpha channel. Usually this is due to video card driver issues. diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 545fa29675..89f916937b 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -696,20 +696,30 @@ class Linux_i686Manifest(LinuxManifest): #self.path("secondlife-i686.supp") if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"): - #self.path("libkdu_v42R.so", "libkdu.so") - self.path("libfmod-3.75.so") self.path("libapr-1.so.0") self.path("libaprutil-1.so.0") self.path("libdb-4.2.so") self.path("libcrypto.so.0.9.7") self.path("libexpat.so.1") self.path("libssl.so.0.9.7") - self.path("libuuid.so", "libuuid.so.1") + self.path("libuuid.so.1") self.path("libSDL-1.2.so.0") self.path("libELFIO.so") self.path("libopenjpeg.so.1.3.0", "libopenjpeg.so.1.3") self.path("libalut.so") self.path("libopenal.so", "libopenal.so.1") + try: + self.path("libkdu_v42R.so", "libkdu.so") + pass + except: + print "Skipping libkdu_v42R.so - not found" + pass + try: + self.path("libfmod-3.75.so") + pass + except: + print "Skipping libkdu_v42R.so - not found" + pass self.end_prefix("lib") # Vivox runtimes diff --git a/indra/test/lltut.h b/indra/test/lltut.h index 47ea9d3f9e..bbb437c3f9 100644 --- a/indra/test/lltut.h +++ b/indra/test/lltut.h @@ -74,7 +74,7 @@ namespace tut inline void ensure_memory_matches(const char* msg,const void* actual, U32 actual_len, const void* expected,U32 expected_len) { if((expected_len != actual_len) || - (memcmp(actual, expected, actual_len) != 0)) + (std::memcmp(actual, expected, actual_len) != 0)) { std::stringstream ss; ss << (msg?msg:"") << (msg?": ":"") << "not equal"; diff --git a/install.xml b/install.xml index e7a7648345..44224664ca 100644 --- a/install.xml +++ b/install.xml @@ -53,26 +53,12 @@ lgpl packages - darwin - - md5sum - 40b8a63b553d91304588fba6796d7cc1 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/SDL-1.2.5-darwin-20091006.tar.bz2 - linux md5sum - 298fd8a3351f6a8d757d205a1e9ad82f - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/SDL-1.2.12-linux-20091006.tar.bz2 - - windows - - md5sum - 33bb17ecbef6cdadff533d97135f3a56 + fce0ff7d2cdf0f36c1647e6a3916e29e url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/SDL-1.2.5-windows-20091006.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/SDL-1.2.12-linux-20090218.tar.bz2 -- cgit v1.3 From ed56c1ca37dd2e09990bb9757e43d110ea71e974 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 14 Oct 2009 16:50:10 +0000 Subject: Added comment to clarify EXT-1488 resolution, LLUICtrl::clear() only clears user-input data. --- indra/llui/lluictrl.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 69207eb8ea..1d34cb39ec 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -228,7 +228,11 @@ public: // Default to no-op: virtual void onTabInto(); + + // Clear any user-provided input (text in a text editor, checked checkbox, + // selected radio button, etc.). Defaults to no-op. virtual void clear(); + virtual void setColor(const LLColor4& color); BOOL focusNextItem(BOOL text_entry_only); -- cgit v1.3 From b10122ffdc5b5a373616b3555549410f3ecec4b9 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 14 Oct 2009 17:24:27 +0000 Subject: EXT-1475 No scroll bar in IM window, About dialog, etc. LLTextBase was hiding scroll bars by default. Reviewed with Richard. --- indra/llui/lltextbase.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index e85bee7775..97a2c70fe8 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -210,8 +210,6 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) scroll_params.mouse_opaque = false; scroll_params.min_auto_scroll_rate = 200; scroll_params.max_auto_scroll_rate = 800; - // all text widgets only show scrollbar on demand - scroll_params.hide_scrollbar = true; scroll_params.border_visible = p.border_visible; mScroller = LLUICtrlFactory::create(scroll_params); addChild(mScroller); -- cgit v1.3 From fd312d1929de708e5765cf1b3815cb61752fc355 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 14 Oct 2009 20:16:18 +0000 Subject: improved metrics for llfontgl::getWidth (use greater of character width/xadvance) llfontgl::Addchar now called consistently when requesting font metrics no longer possible to have font glyph info without rendered font EXT-1294 - LLExpandableTextBox: wrong ellipses reviewed by James and Mani --- indra/llrender/llfontfreetype.cpp | 127 +++++---------------- indra/llrender/llfontfreetype.h | 21 +--- indra/llrender/llfontgl.cpp | 50 +++----- indra/llrender/llfontgl.h | 2 - indra/llui/lltextbase.cpp | 19 ++- indra/newview/llexpandabletextbox.cpp | 15 ++- .../default/xui/en/widgets/expandable_text.xml | 1 + 7 files changed, 72 insertions(+), 163 deletions(-) (limited to 'indra/llui') diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 1246cfc44b..786dc64452 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -98,9 +98,7 @@ LLFontGlyphInfo::LLFontGlyphInfo(U32 index) mWidth(0), // In pixels mHeight(0), // In pixels mXAdvance(0.f), // In pixels - mYAdvance(0.f), // In pixels - mIsRendered(FALSE), - mMetricsValid(FALSE) + mYAdvance(0.f) // In pixels { } @@ -199,7 +197,7 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v if (!mIsFallback) { // Add the default glyph - addGlyph(0, 0); + addGlyphFromFont(this, 0, 0); } mName = filename; @@ -251,57 +249,10 @@ F32 LLFontFreetype::getXAdvance(llwchar wch) const if (mFTFace == NULL) return 0.0; - //llassert(!mIsFallback); - U32 glyph_index; - // Return existing info only if it is current LLFontGlyphInfo* gi = getGlyphInfo(wch); - if (gi && gi->mMetricsValid) - { - return gi->mXAdvance; - } - - const LLFontFreetype* fontp = this; - - // Initialize char to glyph map - glyph_index = FT_Get_Char_Index(mFTFace, wch); - if (glyph_index == 0) - { - font_vector_t::const_iterator iter; - for(iter = mFallbackFonts.begin(); (iter != mFallbackFonts.end()) && (glyph_index == 0); iter++) - { - glyph_index = FT_Get_Char_Index((*iter)->mFTFace, wch); - if(glyph_index) - { - fontp = *iter; - } - } - } - - if (glyph_index) + if (gi) { - // This font has this glyph - fontp->renderGlyph(glyph_index); - - // Create the entry if it's not there - char_glyph_info_map_t::iterator iter2 = mCharGlyphInfoMap.find(wch); - if (iter2 == mCharGlyphInfoMap.end()) - { - gi = new LLFontGlyphInfo(glyph_index); - insertGlyphInfo(wch, gi); - } - else - { - gi = iter2->second; - } - - gi->mWidth = fontp->mFTFace->glyph->bitmap.width; - gi->mHeight = fontp->mFTFace->glyph->bitmap.rows; - - // Convert these from 26.6 units to float pixels. - gi->mXAdvance = fontp->mFTFace->glyph->advance.x / 64.f; - gi->mYAdvance = fontp->mFTFace->glyph->advance.y / 64.f; - gi->mMetricsValid = TRUE; return gi->mXAdvance; } else @@ -323,10 +274,10 @@ F32 LLFontFreetype::getXKerning(llwchar char_left, llwchar char_right) const return 0.0; //llassert(!mIsFallback); - LLFontGlyphInfo* left_glyph_info = get_if_there(mCharGlyphInfoMap, char_left, (LLFontGlyphInfo*)NULL); + LLFontGlyphInfo* left_glyph_info = getGlyphInfo(char_left);; U32 left_glyph = left_glyph_info ? left_glyph_info->mGlyphIndex : 0; // Kern this puppy. - LLFontGlyphInfo* right_glyph_info = get_if_there(mCharGlyphInfoMap, char_right, (LLFontGlyphInfo*)NULL); + LLFontGlyphInfo* right_glyph_info = getGlyphInfo(char_right); U32 right_glyph = right_glyph_info ? right_glyph_info->mGlyphIndex : 0; FT_Vector delta; @@ -339,18 +290,10 @@ F32 LLFontFreetype::getXKerning(llwchar char_left, llwchar char_right) const BOOL LLFontFreetype::hasGlyph(llwchar wch) const { llassert(!mIsFallback); - const LLFontGlyphInfo* gi = getGlyphInfo(wch); - if (gi && gi->mIsRendered) - { - return TRUE; - } - else - { - return FALSE; - } + return(mCharGlyphInfoMap.find(wch) != mCharGlyphInfoMap.end()); } -BOOL LLFontFreetype::addChar(llwchar wch) const +LLFontGlyphInfo* LLFontFreetype::addGlyph(llwchar wch) const { if (mFTFace == NULL) return FALSE; @@ -371,30 +314,23 @@ BOOL LLFontFreetype::addChar(llwchar wch) const glyph_index = FT_Get_Char_Index((*iter)->mFTFace, wch); if (glyph_index) { - addGlyphFromFont(*iter, wch, glyph_index); - return TRUE; + return addGlyphFromFont(*iter, wch, glyph_index); } } } char_glyph_info_map_t::iterator iter = mCharGlyphInfoMap.find(wch); - if (iter == mCharGlyphInfoMap.end() || !(iter->second->mIsRendered)) + if (iter == mCharGlyphInfoMap.end()) { - BOOL result = addGlyph(wch, glyph_index); - return result; + return addGlyphFromFont(this, wch, glyph_index); } - return FALSE; -} - -BOOL LLFontFreetype::addGlyph(llwchar wch, U32 glyph_index) const -{ - return addGlyphFromFont(this, wch, glyph_index); + return NULL; } -BOOL LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, llwchar wch, U32 glyph_index) const +LLFontGlyphInfo* LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, llwchar wch, U32 glyph_index) const { if (mFTFace == NULL) - return FALSE; + return NULL; llassert(!mIsFallback); fontp->renderGlyph(glyph_index); @@ -417,8 +353,6 @@ BOOL LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, llwchar wch, // Convert these from 26.6 units to float pixels. gi->mXAdvance = fontp->mFTFace->glyph->advance.x / 64.f; gi->mYAdvance = fontp->mFTFace->glyph->advance.y / 64.f; - gi->mIsRendered = TRUE; - gi->mMetricsValid = TRUE; insertGlyphInfo(wch, gi); @@ -489,7 +423,11 @@ BOOL LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, llwchar wch, // omit it from the font-image. } - return TRUE; + LLImageGL *image_gl = mFontBitmapCachep->getImageGL(bitmap_num); + LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_num); + image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight()); + + return gi; } LLFontGlyphInfo* LLFontFreetype::getGlyphInfo(llwchar wch) const @@ -499,7 +437,11 @@ LLFontGlyphInfo* LLFontFreetype::getGlyphInfo(llwchar wch) const { return iter->second; } - return NULL; + else + { + // this glyph doesn't yet exist, so render it and return the result + return addGlyph(wch); + } } void LLFontFreetype::insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const @@ -556,19 +498,12 @@ void LLFontFreetype::reset(F32 vert_dpi, F32 horz_dpi) void LLFontFreetype::resetBitmapCache() { - // Iterate through glyphs and clear the mIsRendered flag - for (char_glyph_info_map_t::iterator iter = mCharGlyphInfoMap.begin(); - iter != mCharGlyphInfoMap.end(); ++iter) - { - iter->second->mIsRendered = FALSE; - //FIXME: this is only strictly necessary when resetting the entire font, - //not just flushing the bitmap - iter->second->mMetricsValid = FALSE; - } + for_each(mCharGlyphInfoMap.begin(), mCharGlyphInfoMap.end(), DeletePairedPointer()); + mCharGlyphInfoMap.clear(); mFontBitmapCachep->reset(); // Add the empty glyph - addGlyph(0, 0); + addGlyphFromFont(this, 0, 0); } void LLFontFreetype::destroyGL() @@ -576,21 +511,11 @@ void LLFontFreetype::destroyGL() mFontBitmapCachep->destroyGL(); } -BOOL LLFontFreetype::getIsFallback() const -{ - return mIsFallback; -} - const std::string &LLFontFreetype::getName() const { return mName; } -F32 LLFontFreetype::getPointSize() const -{ - return mPointSize; -} - const LLPointer LLFontFreetype::getFontBitmapCache() const { return mFontBitmapCachep; diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h index 5adaab3a88..1325b4995b 100644 --- a/indra/llrender/llfontfreetype.h +++ b/indra/llrender/llfontfreetype.h @@ -70,10 +70,8 @@ public: S32 mHeight; // In pixels F32 mXAdvance; // In pixels F32 mYAdvance; // In pixels - BOOL mMetricsValid; // We have up-to-date metrics for this glyph // Information for actually rendering - BOOL mIsRendered; // We actually have rendered this glyph S32 mXBitmapOffset; // Offset to the origin in the bitmap S32 mYBitmapOffset; // Offset to the origin in the bitmap S32 mXBearing; // Distance from baseline to left in pixels @@ -133,34 +131,27 @@ public: F32 getXAdvance(llwchar wc) const; F32 getXKerning(llwchar char_left, llwchar char_right) const; // Get the kerning between the two characters - BOOL hasGlyph(llwchar wch) const; // Has a glyph for this character - BOOL addChar(llwchar wch) const; // Add a new character to the font if necessary - BOOL addGlyph(llwchar wch, U32 glyph_index) const; // Add a new glyph to the existing font - BOOL addGlyphFromFont(const LLFontFreetype *fontp, llwchar wch, U32 glyph_index) const; // Add a glyph from this font to the other (returns the glyph_index, 0 if not found) - LLFontGlyphInfo* getGlyphInfo(llwchar wch) const; - void insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const; - void renderGlyph(U32 glyph_index) const; - void reset(F32 vert_dpi, F32 horz_dpi); - void resetBitmapCache(); void destroyGL(); - BOOL getIsFallback() const; - const std::string& getName() const; - F32 getPointSize() const; - const LLPointer getFontBitmapCache() const; void setStyle(U8 style); U8 getStyle() const; private: + void resetBitmapCache(); void setSubImageLuminanceAlpha(U32 x, U32 y, U32 bitmap_num, U32 width, U32 height, U8 *data, S32 stride = 0) const; + BOOL hasGlyph(llwchar wch) const; // Has a glyph for this character + LLFontGlyphInfo* addGlyph(llwchar wch) const; // Add a new character to the font if necessary + LLFontGlyphInfo* addGlyphFromFont(const LLFontFreetype *fontp, llwchar wch, U32 glyph_index) const; // Add a glyph from this font to the other (returns the glyph_index, 0 if not found) + void renderGlyph(U32 glyph_index) const; + void insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const; std::string mName; diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 2d7b9760e8..c9163d2890 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -252,11 +252,6 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons { llwchar wch = wstr[i]; - if (!mFontFreetype->hasGlyph(wch)) - { - addChar(wch); - } - const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch); if (!fgi) { @@ -299,10 +294,6 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons if (next_char && (next_char < LAST_CHARACTER)) { // Kern this puppy. - if (!mFontFreetype->hasGlyph(next_char)) - { - addChar(next_char); - } cur_x += mFontFreetype->getXKerning(wch, next_char); } @@ -442,15 +433,22 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars F32 cur_x = 0; const S32 max_index = begin_offset + max_chars; - for (S32 i = begin_offset; i < max_index; i++) + + F32 width_padding = 0.f; + for (S32 i = begin_offset; i < max_index && wchars[i] != 0; i++) { llwchar wch = wchars[i]; - if (wch == 0) - { - break; // done - } - cur_x += mFontFreetype->getXAdvance(wch); + const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch); + + F32 advance = mFontFreetype->getXAdvance(wch); + + // for the last character we want to measure the greater of its width and xadvance values + // so keep track of the difference between these values for the each character we measure + // so we can fix things up at the end + width_padding = llmax(0.f, (F32)fgi->mWidth - advance); + + cur_x += advance; llwchar next_char = wchars[i+1]; if (((i + 1) < begin_offset + max_chars) @@ -464,6 +462,9 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars cur_x = (F32)llfloor(cur_x + 0.5f); } + // add in extra pixels for last character's width past its xadvance + cur_x += width_padding; + return cur_x / sScaleX; } @@ -663,25 +664,6 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t return llmin(max_chars, pos - begin_offset); } -BOOL LLFontGL::addChar(llwchar wch) const -{ - if (!mFontFreetype->addChar(wch)) - { - return FALSE; - } - - stop_glerror(); - - LLFontGlyphInfo *glyph_info = mFontFreetype->getGlyphInfo(wch); - U32 bitmap_num = glyph_info->mBitmapNum; - - const LLFontBitmapCache* font_bitmap_cache = mFontFreetype->getFontBitmapCache(); - LLImageGL *image_gl = font_bitmap_cache->getImageGL(bitmap_num); - LLImageRaw *image_raw = font_bitmap_cache->getImageRaw(bitmap_num); - image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight()); - return TRUE; -} - const LLFontDescriptor& LLFontGL::getFontDesc() const { return mFontDescriptor; diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index ad84b6d641..a278d88287 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -131,8 +131,6 @@ public: // Returns the index of the character closest to pixel position x (ignoring text to the right of max_pixels and max_chars) S32 charFromPixelOffset(const llwchar* wchars, S32 char_offset, F32 x, F32 max_pixels=F32_MAX, S32 max_chars = S32_MAX, BOOL round = TRUE) const; - BOOL addChar(const llwchar wch) const; - const LLFontDescriptor& getFontDesc() const; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 97a2c70fe8..3c5213a0b3 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1106,12 +1106,17 @@ void LLTextBase::reflow(S32 start_index) S32 segment_width = segment->getWidth(seg_offset, character_count); remaining_pixels -= segment_width; - S32 text_left = getLeftOffset(text_width - remaining_pixels); seg_offset += character_count; S32 last_segment_char_on_line = segment->getStart() + seg_offset; + S32 text_left = getLeftOffset(text_width - remaining_pixels); + LLRect line_rect(text_left, + cur_top, + text_left + (text_width - remaining_pixels), + cur_top - line_height); + // if we didn't finish the current segment... if (last_segment_char_on_line < segment->getEnd()) { @@ -1129,10 +1134,7 @@ void LLTextBase::reflow(S32 start_index) mLineInfoList.push_back(line_info( line_start_index, last_segment_char_on_line, - LLRect(text_left, - cur_top, - text_left + (text_width - remaining_pixels), - cur_top - line_height), + line_rect, line_count)); line_start_index = segment->getStart() + seg_offset; @@ -1147,15 +1149,12 @@ void LLTextBase::reflow(S32 start_index) mLineInfoList.push_back(line_info( line_start_index, last_segment_char_on_line, - LLRect(text_left, - cur_top, - text_left + (text_width - remaining_pixels), - cur_top - line_height), + line_rect, line_count)); cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; break; } - // finished a segment and there are segments remaining on this line + // ...or finished a segment and there are segments remaining on this line else { // subtract pixels used and increment segment diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 2467356018..e2d6bcee8f 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -57,7 +57,20 @@ public: { return start_offset; } - /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const { return getEnd() - getStart(); } + /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const + { + // require full line to ourselves + if (line_offset == 0) + { + // print all our text + return getEnd() - getStart(); + } + else + { + // wait for next line + return 0; + } + } /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) { F32 right_x; diff --git a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml index 120deaaef5..319beac291 100644 --- a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml +++ b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml @@ -5,6 +5,7 @@ more_label="More" follows="left|top" name="text" + allow_scroll="true" use_ellipses="true" word_wrap="true" tab_stop="true" -- cgit v1.3 From 925f01f6a066113049e8c829c6fc3875c69ef566 Mon Sep 17 00:00:00 2001 From: Martin Reddy Date: Thu, 15 Oct 2009 13:08:12 +0000 Subject: DEV-41253: Updated the help context calculation code so that it will now search through a panel's children to see if there are any visible tabs that have a help topic string defined. If so, we use this string. Updated all of the XUI files that include a tab_container to define help topic strings for their child panels. I named all of these strings with the floater name as the prefix and "tab" at the end. For example, "preferences_display_tab" or "people_nearby_tab". --- indra/llui/llfloater.cpp | 13 ++++++- indra/llui/llpanel.cpp | 41 ++++++++++++++++++++++ indra/llui/llpanel.h | 1 + indra/llui/lluictrl.cpp | 23 +++++++++--- .../newview/skins/default/xui/en/floater_about.xml | 3 ++ .../skins/default/xui/en/floater_about_land.xml | 7 ++++ .../skins/default/xui/en/floater_avatar_picker.xml | 2 ++ .../skins/default/xui/en/floater_god_tools.xml | 4 +++ .../skins/default/xui/en/floater_my_friends.xml | 2 ++ .../skins/default/xui/en/floater_post_process.xml | 4 +++ .../skins/default/xui/en/floater_preferences.xml | 9 +++++ .../newview/skins/default/xui/en/floater_tools.xml | 7 +++- .../newview/skins/default/xui/en/floater_water.xml | 2 ++ .../default/xui/en/floater_windlight_options.xml | 3 ++ .../skins/default/xui/en/floater_world_map.xml | 2 ++ .../default/xui/en/panel_group_land_money.xml | 3 ++ .../skins/default/xui/en/panel_group_roles.xml | 3 ++ .../newview/skins/default/xui/en/panel_people.xml | 4 +++ .../newview/skins/default/xui/en/panel_places.xml | 2 ++ .../skins/default/xui/en/panel_profile_view.xml | 3 ++ 20 files changed, 131 insertions(+), 7 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 8d2783db20..47ca4899df 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1443,7 +1443,18 @@ void LLFloater::onClickHelp( LLFloater* self ) { if (self && LLUI::sHelpImpl) { - LLUI::sHelpImpl->showTopic(self->getHelpTopic()); + // get the help topic for this floater + std::string help_topic = self->getHelpTopic(); + + // but use a more specific help topic for the currently + // displayed tab inside of this floater, if present + LLPanel *curtab = self->childGetVisibleTabWithHelp(); + if (curtab) + { + help_topic = curtab->getHelpTopic(); + } + + LLUI::sHelpImpl->showTopic(help_topic); } } diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 69ff3dddc3..742427525b 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -810,6 +810,47 @@ LLPanel *LLPanel::childGetVisibleTab(const std::string& id) const return NULL; } +static LLPanel *childGetVisibleTabWithHelp(LLView *parent) +{ + LLView *child; + + // look through immediate children first for an active tab with help + for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child)) + { + LLTabContainer *tab = dynamic_cast(child); + if (tab && tab->getVisible()) + { + LLPanel *curTabPanel = tab->getCurrentPanel(); + if (curTabPanel && !curTabPanel->getHelpTopic().empty()) + { + return curTabPanel; + } + } + } + + // then try a bit harder and recurse through all children + for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child)) + { + if (child->getVisible()) + { + LLPanel* tab = ::childGetVisibleTabWithHelp(child); + if (tab) + { + return tab; + } + } + } + + // couldn't find any active tabs with a help topic string + return NULL; +} + +LLPanel *LLPanel::childGetVisibleTabWithHelp() +{ + // find a visible tab with a help topic (to determine help context) + return ::childGetVisibleTabWithHelp(this); +} + void LLPanel::childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) ) { LLLineEditor* child = findChild(id); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 0594762333..e8db68ffbb 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -208,6 +208,7 @@ public: // LLTabContainer void childShowTab(const std::string& id, const std::string& tabname, bool visible = true); LLPanel *childGetVisibleTab(const std::string& id) const; + LLPanel *childGetVisibleTabWithHelp(); // LLTextBox/LLTextEditor/LLLineEditor void childSetText(const std::string& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); } diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 5b72f87a78..84b1c92097 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -795,16 +795,29 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) LLUICtrl* ctrl = this; // search back through the control's parents for a panel - // with a help_topic string defined + // or tab with a help_topic string defined while (ctrl) { LLPanel *panel = dynamic_cast(ctrl); - if (panel && !panel->getHelpTopic().empty()) + + if (panel) { - help_topic_out = panel->getHelpTopic(); - return true; // success + // does the panel have an active tab with a help topic? + LLPanel *tab = panel->childGetVisibleTabWithHelp(); + if (tab) + { + help_topic_out = tab->getHelpTopic(); + return true; // success (tab) + } + + // otherwise, does the panel have a help topic itself? + if (!panel->getHelpTopic().empty()) + { + help_topic_out = panel->getHelpTopic(); + return true; // success (panel) + } } - + ctrl = ctrl->getParentUICtrl(); } diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index dc6af79db5..4d7433233a 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -78,6 +78,7 @@ @@ -535,6 +536,7 @@ Go to World menu > About Land or select another parcel to show its details. label="Covenant" layout="topleft" left_delta="-1" + help_topic="land_covenant_tab" name="land_covenant_panel" top_delta="-47" width="458"> @@ -801,6 +803,7 @@ Go to World menu > About Land or select another parcel to show its details. label="Objects" layout="topleft" left_delta="0" + help_topic="land_objects_tab" name="land_objects_panel" top_delta="-47" width="458"> @@ -1166,6 +1169,7 @@ Go to World menu > About Land or select another parcel to show its details. label="Options" layout="topleft" left_delta="0" + help_topic="land_options_tab" name="land_options_panel" top_delta="31" width="458"> @@ -1603,6 +1607,7 @@ Only large parcels can be listed in search. label="Media" layout="topleft" left_delta="0" + help_topic="land_media_tab" name="land_media_panel" top_delta="1" width="458"> @@ -1865,6 +1870,7 @@ Texture: label="Audio" layout="topleft" left_delta="0" + help_topic="land_audio_tab" name="land_audio_panel" top_delta="1" width="458"> @@ -1968,6 +1974,7 @@ Texture: label="Access" layout="topleft" left_delta="0" + help_topic="land_access_tab" name="land_access_panel" top_delta="31" width="458"> diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml index e1f8011cbe..0542d4509e 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -40,6 +40,7 @@ label="Search" layout="topleft" left="6" + help_topic="avatarpicker_search_tab" name="SearchPanel" top="150" width="132"> @@ -91,6 +92,7 @@ label="Near Me" layout="topleft" left="6" + help_topic="avatarpicker_near_me_tab" name="NearMePanel" top="150" width="132"> diff --git a/indra/newview/skins/default/xui/en/floater_god_tools.xml b/indra/newview/skins/default/xui/en/floater_god_tools.xml index 615c35e6c3..53d05f3c61 100644 --- a/indra/newview/skins/default/xui/en/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_god_tools.xml @@ -23,6 +23,7 @@ layout="topleft" left="1" mouse_opaque="false" + help_topic="godtools_grid_tab" name="grid" top="16" width="398"> @@ -61,6 +62,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="godtools_region_tab" name="region" top_delta="0" width="398"> @@ -483,6 +485,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="godtools_objects_tab" name="objects" top_delta="0" width="398"> @@ -690,6 +693,7 @@ label="Request" layout="topleft" left_delta="0" + help_topic="godtools_request_tab" name="request" top_delta="0" width="398"> diff --git a/indra/newview/skins/default/xui/en/floater_my_friends.xml b/indra/newview/skins/default/xui/en/floater_my_friends.xml index a9a18f44c4..0ca4fc825a 100644 --- a/indra/newview/skins/default/xui/en/floater_my_friends.xml +++ b/indra/newview/skins/default/xui/en/floater_my_friends.xml @@ -28,6 +28,7 @@ label="Friends" layout="topleft" left="0" + help_topic="my_friends_friends_tab" name="friends_panel" width="370" /> diff --git a/indra/newview/skins/default/xui/en/floater_post_process.xml b/indra/newview/skins/default/xui/en/floater_post_process.xml index aaf7aecd6b..571f4149f0 100644 --- a/indra/newview/skins/default/xui/en/floater_post_process.xml +++ b/indra/newview/skins/default/xui/en/floater_post_process.xml @@ -23,6 +23,7 @@ layout="topleft" left="1" mouse_opaque="false" + help_topic="post_process_color_filter_tab" name="wmiColorFilterPanel" top="0" width="398"> @@ -184,6 +185,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="post_process_night_vision_tab" name="wmiNightVisionPanel" top_delta="-236" width="398"> @@ -279,6 +281,7 @@ label="Bloom" layout="topleft" left_delta="0" + help_topic="post_process_bloom_tab" name="wmiBloomPanel" top_delta="-236" width="398"> @@ -374,6 +377,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="post_process_extras_tab" name="Extras" top_delta="-236" width="398"> diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml index d655c268b2..cf9e3a82fc 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences.xml @@ -52,54 +52,63 @@ filename="panel_preferences_general.xml" label="General" layout="topleft" + help_topic="preferences_general_tab" name="general" /> diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 8df0d759ce..d3ceb67ceb 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -761,6 +761,7 @@ label="General" layout="topleft" mouse_opaque="false" + help_topic="toolbox_general_tab" name="General" top="16"> F: - + @@ -2009,6 +2011,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="toolbox_features_tab" name="Features" top_delta="0" width="280"> @@ -2246,6 +2249,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="toolbox_texture_tab" name="Texture" top_delta="0" width="280"> @@ -2751,6 +2755,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="toolbox_contents_tab" name="Contents" top_delta="0" width="280"> diff --git a/indra/newview/skins/default/xui/en/floater_water.xml b/indra/newview/skins/default/xui/en/floater_water.xml index febfd1929e..6206ea29c2 100644 --- a/indra/newview/skins/default/xui/en/floater_water.xml +++ b/indra/newview/skins/default/xui/en/floater_water.xml @@ -75,6 +75,7 @@ layout="topleft" left="1" mouse_opaque="false" + help_topic="water_settings_tab" name="Settings" top="60" width="698"> @@ -465,6 +466,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="water_waves_tab" name="Waves" top_delta="44" width="698"> diff --git a/indra/newview/skins/default/xui/en/floater_windlight_options.xml b/indra/newview/skins/default/xui/en/floater_windlight_options.xml index 872bd704d5..2b3bc5f11a 100644 --- a/indra/newview/skins/default/xui/en/floater_windlight_options.xml +++ b/indra/newview/skins/default/xui/en/floater_windlight_options.xml @@ -84,6 +84,7 @@ layout="topleft" left="1" mouse_opaque="false" + help_topic="windlight_atmosphere_tab" name="Atmosphere" top="60" width="698"> @@ -519,6 +520,7 @@ label="Lighting" layout="topleft" left_delta="0" + help_topic="windlight_lighting_tab" name="Lighting" top_delta="4" width="698"> @@ -978,6 +980,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + help_topic="windlight_clouds_tab" name="Clouds" top_delta="4" width="698"> diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index 4386c0c5ee..8f88366842 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -30,6 +30,7 @@ label="Objects" layout="topleft" left="1" + help_topic="worldmap_objects_tab" name="objects_mapview" top="19" width="540" /> @@ -40,6 +41,7 @@ label="Terrain" layout="topleft" left_delta="0" + help_topic="worldmap_terrain_tab" name="terrain_mapview" top_delta="3" width="540" /> diff --git a/indra/newview/skins/default/xui/en/panel_group_land_money.xml b/indra/newview/skins/default/xui/en/panel_group_land_money.xml index 999aa814b1..d61fcf529a 100644 --- a/indra/newview/skins/default/xui/en/panel_group_land_money.xml +++ b/indra/newview/skins/default/xui/en/panel_group_land_money.xml @@ -259,6 +259,7 @@ label="Planning" layout="topleft" left="1" + help_topic="group_money_planning_tab" name="group_money_planning_tab" top="5" width="265"> @@ -284,6 +285,7 @@ label="Details" layout="topleft" left_delta="0" + help_topic="group_money_details_tab" name="group_money_details_tab" top_delta="0" width="265"> @@ -329,6 +331,7 @@ label="Sales" layout="topleft" left_delta="0" + help_topic="group_money_sales_tab" name="group_money_sales_tab" top_delta="-1" width="265"> diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 6435951157..bf861af4f2 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -174,6 +174,7 @@ label="Members" layout="topleft" left="1" + help_topic="roles_members_tab" name="members_sub_tab" tool_tip="Members" top="17" @@ -283,6 +284,7 @@ clicking on their names. label="Roles" layout="topleft" left_delta="0" + help_topic="roles_roles_tab" name="roles_sub_tab" class="panel_group_roles_subtab" top="17" @@ -400,6 +402,7 @@ including the Everyone and Owner Roles. label="Abilities" layout="topleft" left_delta="0" + help_topic="roles_actions_tab" name="actions_sub_tab" class="panel_group_actions_subtab" top="17" diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 786c39c5e9..b51d53a1b4 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -60,6 +60,7 @@ color="DkGray" label="Nearby" layout="topleft" left="0" + help_topic="people_nearby_tab" name="nearby_panel" top="0" width="313"> @@ -109,6 +110,7 @@ color="DkGray" top="0" label="Friends" layout="topleft" + help_topic="people_friends_tab" name="friends_panel" width="313"> @@ -48,6 +49,7 @@ height="25" layout="topleft" left="0" + help_topic="places_button_tab" name="button_panel" top_pad="10" width="313"> diff --git a/indra/newview/skins/default/xui/en/panel_profile_view.xml b/indra/newview/skins/default/xui/en/panel_profile_view.xml index cf9ac3a94b..8a48574440 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_view.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_view.xml @@ -63,18 +63,21 @@ filename="panel_profile.xml" label="Profile" layout="topleft" + help_topic="profile_profile_tab" name="panel_profile" /> -- cgit v1.3 From 5edb4f2171fb92ff64913459a63afb20474db25a Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Thu, 15 Oct 2009 19:56:45 +0000 Subject: removed requirement for specializing ParamCompare on boost::function types eliminated usage of iterator_range from LLInitParam made LLTextEditor::addChar consistent with truncate in counting text bytes (not including null terminator) EXT-1494 - Avatar profile description text truncated to 255 characters reviewed by Leyla --- indra/llui/lllineeditor.cpp | 17 ------ indra/llui/lllineeditor.h | 11 ---- indra/llui/llscrollbar.cpp | 12 ----- indra/llui/llscrollbar.h | 7 --- indra/llui/lltexteditor.cpp | 2 +- indra/llui/llui.cpp | 13 ++--- indra/llui/llui.h | 7 +++ indra/llui/lluictrl.cpp | 21 -------- indra/llui/lluictrl.h | 17 ------ indra/llui/lluiimage.cpp | 3 +- indra/llui/lluiimage.h | 6 ++- indra/llxuixml/llinitparam.cpp | 41 +++------------ indra/llxuixml/llinitparam.h | 61 ++++++++++------------ indra/llxuixml/lluicolor.cpp | 13 ++--- indra/llxuixml/lluicolor.h | 16 ++++-- .../skins/default/xui/en/panel_edit_profile.xml | 2 + 16 files changed, 71 insertions(+), 178 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 0db515ab41..e053477d58 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -2514,20 +2514,3 @@ LLWString LLLineEditor::getConvertedText() const } return text; } - -namespace LLInitParam -{ - template<> - bool ParamCompare::equals(const LLLinePrevalidateFunc &a, const LLLinePrevalidateFunc &b) - { - return false; - } - - template<> - bool ParamCompare >::equals( - const boost::function &a, - const boost::function &b) - { - return false; - } -} diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 6e81969f00..3d7bbdff89 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -391,15 +391,4 @@ private: }; // end class LLLineEditor -namespace LLInitParam -{ - template<> - bool ParamCompare::equals( - const LLLinePrevalidateFunc &a, const LLLinePrevalidateFunc &b); - - template<> - bool ParamCompare >::equals( - const boost::function &a, const boost::function &b); -} - #endif // LL_LINEEDITOR_ diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 7db34a0608..cb4147709d 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -640,15 +640,3 @@ void LLScrollbar::onLineDownBtnPressed( const LLSD& data ) { changeLine( mStepSize, TRUE ); } - - -namespace LLInitParam -{ - template<> - bool ParamCompare >::equals( - const boost::function &a, - const boost::function &b) - { - return false; - } -} diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h index e4c5712fb7..2e95779624 100644 --- a/indra/llui/llscrollbar.h +++ b/indra/llui/llscrollbar.h @@ -167,11 +167,4 @@ private: }; -namespace LLInitParam -{ - template<> - bool ParamCompare >::equals( - const boost::function &a, const boost::function &b); -} - #endif // LL_SCROLLBAR_H diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 74373e7803..74ffad0f53 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -990,7 +990,7 @@ void LLTextEditor::removeChar() // Add a single character to the text S32 LLTextEditor::addChar(S32 pos, llwchar wc) { - if ( (wstring_utf8_length( getWText() ) + wchar_utf8_length( wc )) >= mMaxTextByteLength) + if ( (wstring_utf8_length( getWText() ) + wchar_utf8_length( wc )) > mMaxTextByteLength) { make_ui_sound("UISndBadKeystroke"); return 0; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 9a90ee267e..ec9220a984 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1918,16 +1918,11 @@ namespace LLInitParam declare("blue", LLColor4::blue); } - template<> - class ParamCompare + bool ParamCompare::equals(const LLFontGL* a, const LLFontGL* b) { - public: - static bool equals(const LLFontGL* a, const LLFontGL* b) - { - return !(a->getFontDesc() < b->getFontDesc()) - && !(b->getFontDesc() < a->getFontDesc()); - } - }; + return !(a->getFontDesc() < b->getFontDesc()) + && !(b->getFontDesc() < a->getFontDesc()); + } TypedParam::TypedParam(BlockDescriptor& descriptor, const char* _name, const LLFontGL*const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) : super_t(descriptor, _name, value, func, min_count, max_count), diff --git a/indra/llui/llui.h b/indra/llui/llui.h index f071e8dc47..db18957a97 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -436,6 +436,13 @@ namespace LLInitParam static void declareValues(); }; + template<> + struct ParamCompare + { + static bool equals(const LLFontGL* a, const LLFontGL* b); + }; + + template<> class TypedParam : public BlockValue diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 84b1c92097..0faff5eff6 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -849,24 +849,3 @@ BOOL LLUICtrl::getTentative() const // virtual void LLUICtrl::setColor(const LLColor4& color) { } - - -namespace LLInitParam -{ - template<> - bool ParamCompare::equals( - const LLUICtrl::commit_callback_t &a, - const LLUICtrl::commit_callback_t &b) - { - return false; - } - - - template<> - bool ParamCompare::equals( - const LLUICtrl::enable_callback_t &a, - const LLUICtrl::enable_callback_t &b) - { - return false; - } -} diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 1d34cb39ec..45fe47772b 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -327,21 +327,4 @@ private: class DefaultTabGroupFirstSorter; }; -namespace LLInitParam -{ - template<> - bool ParamCompare::equals( - const LLUICtrl::commit_callback_t &a, - const LLUICtrl::commit_callback_t &b); - - template<> - bool ParamCompare::equals( - const LLUICtrl::enable_callback_t &a, - const LLUICtrl::enable_callback_t &b); - - template<> - bool ParamCompare >::equals( - const LLLazyValue &a, const LLLazyValue &b); -} - #endif // LL_LLUICTRL_H diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index ab0d65e731..51828e5731 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -152,8 +152,7 @@ namespace LLInitParam } - template<> - bool ParamCompare::equals( + bool ParamCompare::equals( LLUIImage* const &a, LLUIImage* const &b) { diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h index 4ec24e98dc..9f505bea79 100644 --- a/indra/llui/lluiimage.h +++ b/indra/llui/lluiimage.h @@ -108,8 +108,10 @@ namespace LLInitParam // Need custom comparison function for our test app, which only loads // LLUIImage* as NULL. template<> - bool ParamCompare::equals( - LLUIImage* const &a, LLUIImage* const &b); + struct ParamCompare + { + static bool equals(LLUIImage* const &a, LLUIImage* const &b); + }; } typedef LLPointer LLUIImagePtr; diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp index 1b867b79c9..1abd411f37 100644 --- a/indra/llxuixml/llinitparam.cpp +++ b/indra/llxuixml/llinitparam.cpp @@ -127,7 +127,7 @@ namespace LLInitParam bool BaseBlock::submitValue(const Parser::name_stack_t& name_stack, Parser& p, bool silent) { - if (!deserializeBlock(p, boost::make_iterator_range(name_stack.begin(), name_stack.end()))) + if (!deserializeBlock(p, std::make_pair(name_stack.begin(), name_stack.end()))) { if (!silent) { @@ -304,11 +304,11 @@ namespace LLInitParam bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack) { BlockDescriptor& block_data = getBlockDescriptor(); - bool names_left = !name_stack.empty(); + bool names_left = name_stack.first != name_stack.second; if (names_left) { - const std::string& top_name = name_stack.front().first; + const std::string& top_name = name_stack.first->first; ParamDescriptor::deserialize_func_t deserialize_func = NULL; Param* paramp = NULL; @@ -331,10 +331,11 @@ namespace LLInitParam } } - Parser::name_stack_range_t new_name_stack(++name_stack.begin(), name_stack.end()); + Parser::name_stack_range_t new_name_stack(name_stack.first, name_stack.second); + ++new_name_stack.first; if (deserialize_func) { - return deserialize_func(*paramp, p, new_name_stack, name_stack.empty() ? -1 : name_stack.front().second); + return deserialize_func(*paramp, p, new_name_stack, name_stack.first == name_stack.second ? -1 : name_stack.first->second); } } @@ -346,7 +347,7 @@ namespace LLInitParam Param* paramp = getParamFromHandle((*it)->mParamHandle); ParamDescriptor::deserialize_func_t deserialize_func = (*it)->mDeserializeFunc; - if (deserialize_func && deserialize_func(*paramp, p, name_stack, name_stack.empty() ? -1 : name_stack.front().second)) + if (deserialize_func && deserialize_func(*paramp, p, name_stack, name_stack.first == name_stack.second ? -1 : name_stack.first->second)) { mLastChangedParam = (*it)->mParamHandle; return true; @@ -499,33 +500,7 @@ namespace LLInitParam return param_changed; } - - template<> - bool ParamCompare >::equals( - const boost::function &a, - const boost::function &b) - { - return false; - } - - template<> - bool ParamCompare >::equals( - const boost::function &a, - const boost::function &b) - { - return false; - } - - template<> - bool ParamCompare >::equals( - const boost::function &a, - const boost::function &b) - { - return false; - } - - template<> - bool ParamCompare::equals(const LLSD &a, const LLSD &b) + bool ParamCompare::equals(const LLSD &a, const LLSD &b) { return false; } diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 88bc430504..193d8c1f64 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -39,25 +39,31 @@ #include #include #include -#include +#include #include "llregistry.h" #include "llmemory.h" namespace LLInitParam { - template - class ParamCompare { - public: - static bool equals(const T &a, const T &b); + template ::type > + struct ParamCompare + { + static bool equals(const T &a, const T &b) + { + return a == b; + } }; - template - bool ParamCompare::equals(const T &a, const T&b) - { - return a == b; - } - + // boost function types are not comparable + template + struct ParamCompare + { + static bool equals(const T&a, const T &b) + { + return false; + } + }; // default constructor adaptor for InitParam Values // constructs default instances of the given type, returned by const reference @@ -192,7 +198,7 @@ namespace LLInitParam }; typedef std::vector > name_stack_t; - typedef boost::iterator_range name_stack_range_t; + typedef std::pair name_stack_range_t; typedef std::vector possible_values_t; typedef boost::function parser_read_func_t; @@ -535,7 +541,7 @@ namespace LLInitParam { self_t& typed_param = static_cast(param); // no further names in stack, attempt to parse value now - if (name_stack.empty()) + if (name_stack.first == name_stack.second) { if (parser.readValue(typed_param.mData.mValue)) { @@ -886,7 +892,7 @@ namespace LLInitParam self_t& typed_param = static_cast(param); value_t value; // no further names in stack, attempt to parse value now - if (name_stack.empty()) + if (name_stack.first == name_stack.second) { // attempt to read value directly if (parser.readValue(value)) @@ -1541,7 +1547,7 @@ namespace LLInitParam static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack, S32 generation) { - if (name_stack.empty()) + if (name_stack.first == name_stack.second) { //std::string message = llformat("Deprecated value %s ignored", getName().c_str()); //parser.parserWarning(message); @@ -1600,7 +1606,7 @@ namespace LLInitParam { self_t& typed_param = static_cast(param); // type to apply parse direct value T - if (name_stack.empty()) + if (name_stack.first == name_stack.second) { if(parser.readValue(typed_param.mData.mValue)) { @@ -1811,24 +1817,11 @@ namespace LLInitParam } }; - template<> - bool ParamCompare >::equals( - const boost::function &a, - const boost::function &b); - - template<> - bool ParamCompare >::equals( - const boost::function &a, - const boost::function &b); - - template<> - bool ParamCompare >::equals( - const boost::function &a, - const boost::function &b); - - - template<> - bool ParamCompare::equals(const LLSD &a, const LLSD &b); + template<> + struct ParamCompare + { + static bool equals(const LLSD &a, const LLSD &b); + }; } #endif // LL_LLPARAM_H diff --git a/indra/llxuixml/lluicolor.cpp b/indra/llxuixml/lluicolor.cpp index ef0fa5d634..0065edb309 100644 --- a/indra/llxuixml/lluicolor.cpp +++ b/indra/llxuixml/lluicolor.cpp @@ -58,14 +58,9 @@ bool LLUIColor::isReference() const namespace LLInitParam { // used to detect equivalence with default values on export - template<> - class ParamCompare + bool ParamCompare::equals(const LLUIColor &a, const LLUIColor &b) { - public: - static bool equals(const LLUIColor &a, const LLUIColor &b) - { - // do not detect value equivalence, treat pointers to colors as distinct from color values - return (a.mColorPtr == NULL && b.mColorPtr == NULL ? a.mColor == b.mColor : a.mColorPtr == b.mColorPtr); - } - }; + // do not detect value equivalence, treat pointers to colors as distinct from color values + return (a.mColorPtr == NULL && b.mColorPtr == NULL ? a.mColor == b.mColor : a.mColorPtr == b.mColorPtr); + } } diff --git a/indra/llxuixml/lluicolor.h b/indra/llxuixml/lluicolor.h index 365f61003b..aff81a695d 100644 --- a/indra/llxuixml/lluicolor.h +++ b/indra/llxuixml/lluicolor.h @@ -11,11 +11,12 @@ #define LL_LLUICOLOR_H_ #include "v4color.h" +#include // for boost::false_type namespace LLInitParam { - template - class ParamCompare; + template + struct ParamCompare; } class LLUIColor @@ -36,10 +37,19 @@ public: bool isReference() const; private: - friend class LLInitParam::ParamCompare; + friend struct LLInitParam::ParamCompare; const LLColor4* mColorPtr; LLColor4 mColor; }; +namespace LLInitParam +{ + template<> + struct ParamCompare + { + static bool equals(const class LLUIColor& a, const class LLUIColor& b); + }; +} + #endif diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index b728c23bc5..0202323dcf 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -139,6 +139,7 @@ layout="topleft" left="120" top="30" + max_length="511" name="sl_description_edit" width="115" word_wrap="true"> @@ -194,6 +195,7 @@ layout="topleft" left="120" top="195" + max_length="254" name="fl_description_edit" width="115" word_wrap="true"> -- cgit v1.3 From 2ff7f8a772e07335e4ab6788410858667189059e Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Thu, 15 Oct 2009 21:35:30 +0000 Subject: fix for gcc build --- indra/llui/llui.cpp | 2 +- indra/llui/llui.h | 2 +- indra/llui/lluiimage.cpp | 2 +- indra/llui/lluiimage.h | 2 +- indra/llxuixml/llinitparam.cpp | 2 +- indra/llxuixml/llinitparam.h | 6 +++--- indra/llxuixml/lluicolor.cpp | 2 +- indra/llxuixml/lluicolor.h | 6 +++--- 8 files changed, 12 insertions(+), 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index ec9220a984..f253857851 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1918,7 +1918,7 @@ namespace LLInitParam declare("blue", LLColor4::blue); } - bool ParamCompare::equals(const LLFontGL* a, const LLFontGL* b) + bool ParamCompare::equals(const LLFontGL* a, const LLFontGL* b) { return !(a->getFontDesc() < b->getFontDesc()) && !(b->getFontDesc() < a->getFontDesc()); diff --git a/indra/llui/llui.h b/indra/llui/llui.h index db18957a97..6ab78ab3cd 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -437,7 +437,7 @@ namespace LLInitParam }; template<> - struct ParamCompare + struct ParamCompare { static bool equals(const LLFontGL* a, const LLFontGL* b); }; diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index 51828e5731..6c1a32722f 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -152,7 +152,7 @@ namespace LLInitParam } - bool ParamCompare::equals( + bool ParamCompare::equals( LLUIImage* const &a, LLUIImage* const &b) { diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h index 9f505bea79..9d734bcfdf 100644 --- a/indra/llui/lluiimage.h +++ b/indra/llui/lluiimage.h @@ -108,7 +108,7 @@ namespace LLInitParam // Need custom comparison function for our test app, which only loads // LLUIImage* as NULL. template<> - struct ParamCompare + struct ParamCompare { static bool equals(LLUIImage* const &a, LLUIImage* const &b); }; diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp index 1abd411f37..6dd1f93baf 100644 --- a/indra/llxuixml/llinitparam.cpp +++ b/indra/llxuixml/llinitparam.cpp @@ -500,7 +500,7 @@ namespace LLInitParam return param_changed; } - bool ParamCompare::equals(const LLSD &a, const LLSD &b) + bool ParamCompare::equals(const LLSD &a, const LLSD &b) { return false; } diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 193d8c1f64..b280dfdf63 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -46,7 +46,7 @@ namespace LLInitParam { - template ::type > + template ::value > struct ParamCompare { static bool equals(const T &a, const T &b) @@ -57,7 +57,7 @@ namespace LLInitParam // boost function types are not comparable template - struct ParamCompare + struct ParamCompare { static bool equals(const T&a, const T &b) { @@ -1818,7 +1818,7 @@ namespace LLInitParam }; template<> - struct ParamCompare + struct ParamCompare { static bool equals(const LLSD &a, const LLSD &b); }; diff --git a/indra/llxuixml/lluicolor.cpp b/indra/llxuixml/lluicolor.cpp index 0065edb309..856c05cf4a 100644 --- a/indra/llxuixml/lluicolor.cpp +++ b/indra/llxuixml/lluicolor.cpp @@ -58,7 +58,7 @@ bool LLUIColor::isReference() const namespace LLInitParam { // used to detect equivalence with default values on export - bool ParamCompare::equals(const LLUIColor &a, const LLUIColor &b) + bool ParamCompare::equals(const LLUIColor &a, const LLUIColor &b) { // do not detect value equivalence, treat pointers to colors as distinct from color values return (a.mColorPtr == NULL && b.mColorPtr == NULL ? a.mColor == b.mColor : a.mColorPtr == b.mColorPtr); diff --git a/indra/llxuixml/lluicolor.h b/indra/llxuixml/lluicolor.h index aff81a695d..fb9c6b9161 100644 --- a/indra/llxuixml/lluicolor.h +++ b/indra/llxuixml/lluicolor.h @@ -15,7 +15,7 @@ namespace LLInitParam { - template + template struct ParamCompare; } @@ -37,7 +37,7 @@ public: bool isReference() const; private: - friend struct LLInitParam::ParamCompare; + friend struct LLInitParam::ParamCompare; const LLColor4* mColorPtr; LLColor4 mColor; @@ -46,7 +46,7 @@ private: namespace LLInitParam { template<> - struct ParamCompare + struct ParamCompare { static bool equals(const class LLUIColor& a, const class LLUIColor& b); }; -- cgit v1.3