From f304eea6a9964ee4fe6ebbb54047abb33dc6fd0e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 28 Feb 2014 12:21:29 -0800 Subject: MAINT-2059 FIX Corner scaling doesn't highlight distance text fixed case where trying to shrink the object below zero size would mess up grid rulers --- indra/newview/llmanipscale.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index cca8b905f3..81c254c4dc 100755 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -1615,10 +1615,10 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) { LLGLDepthTest gls_depth(GL_FALSE); - F32 dist_grid_axis = (drag_point - mScaleCenter) * mScaleDir; + F32 dist_grid_axis = llmax(0.f, (drag_point - mScaleCenter) * mScaleDir); // find distance to nearest smallest grid unit - F32 grid_multiple1 = llfloor(llmax(0.f, dist_grid_axis) / (mScaleSnapUnit1 / max_subdivisions)); - F32 grid_multiple2 = llfloor(llmax(0.f, dist_grid_axis) / (mScaleSnapUnit2 / max_subdivisions)); + F32 grid_multiple1 = llfloor(dist_grid_axis / (mScaleSnapUnit1 / max_subdivisions)); + F32 grid_multiple2 = llfloor(dist_grid_axis / (mScaleSnapUnit2 / max_subdivisions)); F32 grid_offset1 = fmodf(dist_grid_axis, mScaleSnapUnit1 / max_subdivisions); F32 grid_offset2 = fmodf(dist_grid_axis, mScaleSnapUnit2 / max_subdivisions); @@ -1641,7 +1641,6 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) { // draw snap guide line gGL.begin(LLRender::LINES); - //LLVector3 snap_line_center = mScaleCenter + (mScaleSnappedValue * mScaleDir); LLVector3 snap_line_center = bbox.localToAgent(unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox )); LLVector3 snap_line_start = snap_line_center + (mSnapGuideDir1 * mSnapRegimeOffset); @@ -1768,8 +1767,6 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) { F32 tick_scale = 1.f; F32 alpha = grid_alpha * (1.f - (0.5f * ((F32)llabs(i) / (F32)num_ticks_per_side1))); - F32 distance = (drag_point - mScaleCenter) * mScaleDir; - (void) distance; LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple1 + i) * (mScaleSnapUnit1 / max_subdivisions)); for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) -- cgit v1.2.3 From 07c90b5df393f7e1abf54517f4b75fd16f3cf4d8 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 28 Feb 2014 20:32:45 -0800 Subject: MAINT-2059 FIX Corner scaling doesn't highlight distance text better highlighting of opposite axis when corner scaling --- indra/newview/llmanip.cpp | 55 +++--- indra/newview/llmanip.h | 2 +- indra/newview/llmanipscale.cpp | 389 ++++++++++++++++++------------------- indra/newview/llmanipscale.h | 7 +- indra/newview/llmaniptranslate.cpp | 11 +- 5 files changed, 230 insertions(+), 234 deletions(-) diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index a7d6cb5eac..76008cbec2 100755 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -62,7 +62,7 @@ F32 LLManip::sHelpTextFadeTime = 2.f; S32 LLManip::sNumTimesHelpTextShown = 0; S32 LLManip::sMaxTimesShowHelpText = 5; F32 LLManip::sGridMaxSubdivisionLevel = 32.f; -F32 LLManip::sGridMinSubdivisionLevel = 1.f; +F32 LLManip::sGridMinSubdivisionLevel = 1.f / 32.f; LLVector2 LLManip::sTickLabelSpacing(60.f, 25.f); @@ -176,7 +176,7 @@ BOOL LLManip::getManipAxis(LLViewerObject* object, EManipPart manip, LLVector3 & return TRUE; } -F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing) +F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing, F32 min_subdivisions, F32 max_subdivisions) { //update current snap subdivision level LLVector3 cam_to_reference; @@ -192,7 +192,8 @@ F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVecto F32 projected_translation_axis_length = (translate_axis % cam_to_reference).magVec(); F32 subdivisions = llmax(projected_translation_axis_length * grid_scale / (current_range / LLViewerCamera::getInstance()->getPixelMeterRatio() * min_pixel_spacing), 0.f); - subdivisions = llclamp((F32)pow(2.f, llfloor(log(subdivisions) / log(2.f))), 1.f / 32.f, 32.f); + // figure out nearest power of 2 that subdivides grid_scale with result > min_pixel_spacing + subdivisions = llclamp((F32)pow(2.f, llfloor(log(subdivisions) / log(2.f))), min_subdivisions, max_subdivisions); return subdivisions; } @@ -548,37 +549,31 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string BOOL hud_selection = mObjectSelection->getSelectType() == SELECT_TYPE_HUD; gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - LLVector3 render_pos = pos; - if (hud_selection) { - F32 zoom_amt = gAgentCamera.mHUDCurZoom; - F32 inv_zoom_amt = 1.f / zoom_amt; - // scale text back up to counter-act zoom level - render_pos = pos * zoom_amt; - gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt); - } - - LLColor4 shadow_color = LLColor4::black; - shadow_color.mV[VALPHA] = color.mV[VALPHA] * 0.5f; + LLVector3 render_pos = pos; + if (hud_selection) + { + F32 zoom_amt = gAgentCamera.mHUDCurZoom; + F32 inv_zoom_amt = 1.f / zoom_amt; + // scale text back up to counter-act zoom level + render_pos = pos * zoom_amt; + gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt); + } - if (fractional_portion != 0) - { - fraction_string = llformat("%c%02d%s", LLResMgr::getInstance()->getDecimalPoint(), fractional_portion, suffix.c_str()); + LLColor4 shadow_color = LLColor4::black; + shadow_color.mV[VALPHA] = color.mV[VALPHA] * 0.5f; - gViewerWindow->setup3DViewport(1, -1); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection); - hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 1.f, 3.f, shadow_color, hud_selection); + if (fractional_portion != 0) + { + fraction_string = llformat("%c%02d%s", LLResMgr::getInstance()->getDecimalPoint(), fractional_portion, suffix.c_str()); - gViewerWindow->setup3DViewport(); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); - hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 1.f, 3.f, color, hud_selection); - } - else - { - gViewerWindow->setup3DViewport(1, -1); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection); - gViewerWindow->setup3DViewport(); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); + hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); + hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, 1.f, 3.f, color, hud_selection); + } + else + { + hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); + } } gGL.popMatrix(); } diff --git a/indra/newview/llmanip.h b/indra/newview/llmanip.h index 6263e4244f..1fb05e047a 100755 --- a/indra/newview/llmanip.h +++ b/indra/newview/llmanip.h @@ -137,7 +137,7 @@ protected: LLVector3 getPivotPoint(); void getManipNormal(LLViewerObject* object, EManipPart manip, LLVector3 &normal); BOOL getManipAxis(LLViewerObject* object, EManipPart manip, LLVector3 &axis); - F32 getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing = MIN_DIVISION_PIXEL_WIDTH); + F32 getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing = MIN_DIVISION_PIXEL_WIDTH, F32 min_subdivisions = sGridMinSubdivisionLevel, F32 max_subdivisions = sGridMaxSubdivisionLevel); void renderTickValue(const LLVector3& pos, F32 value, const std::string& suffix, const LLColor4 &color); void renderTickText(const LLVector3& pos, const std::string& suffix, const LLColor4 &color); void updateGridSettings(); diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 81c254c4dc..113a639635 100755 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -185,12 +185,15 @@ LLManipScale::LLManipScale( LLToolComposite* composite ) mLastUpdateFlags( 0 ), mScaleSnapUnit1(1.f), mScaleSnapUnit2(1.f), + mGridScale1(1.f), + mGridScale2(1.f), mSnapRegimeOffset(0.f), mTickPixelSpacing1(0.f), mTickPixelSpacing2(0.f), mSnapGuideLength(0.f), mInSnapRegime(FALSE), - mScaleSnappedValue(0.f) + mScaleSnappedValue1(0.f), + mScaleSnappedValue2(0.f) { for (S32 i = 0; i < NUM_MANIPULATORS; i++) { @@ -291,19 +294,16 @@ void LLManipScale::render() { LLGLEnable poly_offset(GL_POLYGON_OFFSET_FILL); glPolygonOffset( -2.f, -2.f); + { - // JC - Band-aid until edge stretch working similar to side stretch - // in non-uniform. - // renderEdges( bbox ); - - renderCorners( bbox ); - renderFaces( bbox ); + renderCorners( bbox ); + renderFaces( bbox ); - if (mManipPart != LL_NO_PART) - { - renderGuidelinesPart( bbox ); + if (mManipPart != LL_NO_PART) + { + //renderGuidelinesPart( bbox ); + } } - glPolygonOffset( 0.f, 0.f); } } @@ -311,6 +311,7 @@ void LLManipScale::render() if (mManipPart != LL_NO_PART) { + renderGuideline( bbox ); renderSnapGuides(bbox); } gGL.popMatrix(); @@ -348,7 +349,9 @@ BOOL LLManipScale::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); LLVector3 box_center_agent = bbox.getCenterAgent(); - LLVector3 box_corner_agent = bbox.localToAgent( unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox ) ); + LLVector3 unit_vector = partToUnitVector( mManipPart ); + LLVector3 extent_vector = unitVectorToLocalBBoxExtent( unit_vector, bbox ); + LLVector3 box_corner_agent = bbox.localToAgent( extent_vector ); updateSnapGuides(bbox); @@ -876,8 +879,8 @@ void LLManipScale::dragCorner( S32 x, S32 y ) LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); F32 scale_factor = 1.f; - F32 max_scale = partToMaxScale(mManipPart, bbox); - F32 min_scale = partToMinScale(mManipPart, bbox); + //F32 max_scale = partToMaxScale(mManipPart, bbox); + //F32 min_scale = partToMinScale(mManipPart, bbox); BOOL uniform = LLManipScale::getUniform(); // check for snapping @@ -892,54 +895,6 @@ void LLManipScale::dragCorner( S32 x, S32 y ) LLVector3 projected_drag_pos1 = inverse_projected_vec(mScaleDir, orthogonal_component(mouse_on_plane1, mSnapGuideDir1)); LLVector3 projected_drag_pos2 = inverse_projected_vec(mScaleDir, orthogonal_component(mouse_on_plane2, mSnapGuideDir2)); - BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled"); - if (snap_enabled && (mouse_on_plane1 - projected_drag_pos1) * mSnapGuideDir1 > mSnapRegimeOffset) - { - F32 drag_dist = projected_drag_pos1.length(); - - F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + projected_drag_pos1, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); - F32 snap_dist = mScaleSnapUnit1 / (2.f * cur_subdivisions); - F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit1 / cur_subdivisions); - - mScaleSnappedValue = llclamp((drag_dist - (relative_snap_dist - snap_dist)), min_scale, max_scale); - scale_factor = mScaleSnappedValue / dist_vec(drag_start_point_agent, drag_start_center_agent); - mScaleSnappedValue /= mScaleSnapUnit1 * 2.f; - mInSnapRegime = TRUE; - - if (!uniform) - { - scale_factor *= 0.5f; - } - } - else if (snap_enabled && (mouse_on_plane2 - projected_drag_pos2) * mSnapGuideDir2 > mSnapRegimeOffset ) - { - F32 drag_dist = projected_drag_pos2.length(); - - F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + projected_drag_pos2, mScaleDir, mScaleSnapUnit2, mTickPixelSpacing2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); - F32 snap_dist = mScaleSnapUnit2 / (2.f * cur_subdivisions); - F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit2 / cur_subdivisions); - - mScaleSnappedValue = llclamp((drag_dist - (relative_snap_dist - snap_dist)), min_scale, max_scale); - scale_factor = mScaleSnappedValue / dist_vec(drag_start_point_agent, drag_start_center_agent); - mScaleSnappedValue /= mScaleSnapUnit2 * 2.f; - mInSnapRegime = TRUE; - - if (!uniform) - { - scale_factor *= 0.5f; - } - } - else - { - mInSnapRegime = FALSE; - scale_factor = t; - if (!uniform) - { - scale_factor = 0.5f + (scale_factor * 0.5f); - } - } - - F32 max_scale_factor = get_default_max_prim_scale() / MIN_PRIM_SCALE; F32 min_scale_factor = MIN_PRIM_SCALE / get_default_max_prim_scale(); @@ -964,7 +919,65 @@ void LLManipScale::dragCorner( S32 x, S32 y ) } } - scale_factor = llclamp( scale_factor, min_scale_factor, max_scale_factor ); + BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled"); + if (snap_enabled && (mouse_on_plane1 - projected_drag_pos1) * mSnapGuideDir1 > mSnapRegimeOffset) + { + mInSnapRegime = TRUE; + + F32 drag_dist = projected_drag_pos1 * mScaleDir; + + F32 cur_subdivisions = getSubdivisionLevel(mScaleCenter + projected_drag_pos1, + mScaleDir, + mScaleSnapUnit1, + mTickPixelSpacing1, + 1.f, //always snap to at least the base grid unit + LLManip::sGridMaxSubdivisionLevel); + mScaleSnappedValue1 = mGridScale1 / cur_subdivisions * llround(drag_dist * (cur_subdivisions / mScaleSnapUnit1)); + + scale_factor = mScaleSnappedValue1 / ((drag_start_point_agent - drag_start_center_agent) * mSnapDir1); + scale_factor = llclamp( scale_factor, min_scale_factor, max_scale_factor ); + + mScaleSnappedValue2 = scale_factor * ((drag_start_point_agent - drag_start_center_agent) * mSnapDir2); + + scale_factor *= 0.5f; + } + else if (snap_enabled && (mouse_on_plane2 - projected_drag_pos2) * mSnapGuideDir2 > mSnapRegimeOffset ) + { + mInSnapRegime = TRUE; + + F32 drag_dist = projected_drag_pos2 * mScaleDir; + + F32 cur_subdivisions = getSubdivisionLevel(mScaleCenter + projected_drag_pos2, + mScaleDir, + mScaleSnapUnit2, + mTickPixelSpacing2, + 1.f, //always snap to at least the base grid unit + LLManip::sGridMaxSubdivisionLevel); + mScaleSnappedValue2 = mGridScale2 / cur_subdivisions * llround(drag_dist * (cur_subdivisions / mScaleSnapUnit2)); + + scale_factor = mScaleSnappedValue2 / ((drag_start_point_agent - drag_start_center_agent) * mSnapDir2); + scale_factor = llclamp( scale_factor, min_scale_factor, max_scale_factor ); + + mScaleSnappedValue1 = scale_factor * ((drag_start_point_agent - drag_start_center_agent) * mSnapDir1); + + scale_factor *= 0.5f; + } + else + { + mInSnapRegime = FALSE; + scale_factor = llclamp( t, min_scale_factor, max_scale_factor ); + + if (!uniform) + { + scale_factor = 0.5f + (scale_factor * 0.5f); + } + } + + if (LLSelectMgr::getInstance()->getGridMode() != GRID_MODE_WORLD) + { + mScaleSnappedValue1 /= mGridScale1 * 2.f; + mScaleSnappedValue2 /= mGridScale2 * 2.f; + } LLVector3d drag_global = uniform ? mDragStartCenterGlobal : mDragFarHitGlobal; @@ -1112,14 +1125,14 @@ void LLManipScale::dragFace( S32 x, S32 y ) if (dist_along_scale_line > max_drag_dist) { - mScaleSnappedValue = max_drag_dist; + mScaleSnappedValue1 = max_drag_dist; LLVector3 clamp_point = mScaleCenter + max_drag_dist * mScaleDir; drag_delta.setVec(clamp_point - drag_start_point_agent); } else if (dist_along_scale_line < min_drag_dist) { - mScaleSnappedValue = min_drag_dist; + mScaleSnappedValue1 = min_drag_dist; LLVector3 clamp_point = mScaleCenter + min_drag_dist * mScaleDir; drag_delta.setVec(clamp_point - drag_start_point_agent); @@ -1127,7 +1140,7 @@ void LLManipScale::dragFace( S32 x, S32 y ) else { F32 drag_dist = scale_center_to_mouse * mScaleDir; - F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + mScaleDir * drag_dist, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = getSubdivisionLevel(mScaleCenter + mScaleDir * drag_dist, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1, 1.f, LLManip::sGridMaxSubdivisionLevel); F32 snap_dist = mScaleSnapUnit1 / (2.f * cur_subdivisions); F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit1 / cur_subdivisions); relative_snap_dist -= snap_dist; @@ -1141,7 +1154,7 @@ void LLManipScale::dragFace( S32 x, S32 y ) drag_dist - max_drag_dist, drag_dist - min_drag_dist); - mScaleSnappedValue = drag_dist - relative_snap_dist; + mScaleSnappedValue1 = drag_dist - relative_snap_dist; if (llabs(relative_snap_dist) < snap_dist) { @@ -1154,6 +1167,10 @@ void LLManipScale::dragFace( S32 x, S32 y ) drag_delta -= drag_correction; } } + if (uniform) + { + mScaleSnappedValue1 *= 2.f; + } } else { @@ -1312,29 +1329,30 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto } -void LLManipScale::renderGuidelinesPart( const LLBBox& bbox ) +void LLManipScale::renderGuideline( const LLBBox& bbox ) { - LLVector3 guideline_start = bbox.getCenterLocal(); - - LLVector3 guideline_end = unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox ); + F32 max_point_on_scale_line = partToMaxScale(mManipPart, bbox); - if (!getUniform()) + S32 pass; + for (pass = 0; pass < 3; pass++) { - guideline_start = unitVectorToLocalBBoxExtent( -partToUnitVector( mManipPart ), bbox ); - } + LLColor4 tick_color = setupSnapGuideRenderPass(pass); + LLGLDepthTest gls_depth(pass != 1); - guideline_end -= guideline_start; - guideline_end.normVec(); - guideline_end *= LLWorld::getInstance()->getRegionWidthInMeters(); - guideline_end += guideline_start; + glLineWidth(2.5f); - { - LLGLDepthTest gls_depth(GL_TRUE); - gl_stippled_line_3d( guideline_start, guideline_end, LLColor4(1.f, 1.f, 1.f, 0.5f) ); - } - { - LLGLDepthTest gls_depth(GL_FALSE); - gl_stippled_line_3d( guideline_start, guideline_end, LLColor4(1.f, 1.f, 1.f, 0.25f) ); + gGL.begin(LLRender::LINES); + { + LLVector3 line_start = mScaleCenter; + LLVector3 line_end = line_start + (mScaleDir * max_point_on_scale_line); + + gGL.color4fv(tick_color.mV); + gGL.vertex3fv(line_start.mV); + gGL.vertex3fv(line_end.mV); + } + gGL.end(); + + LLRender2D::setLineWidth(1.f); } } @@ -1399,8 +1417,11 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) } LLVector3 scale_snap = grid_scale; - mScaleSnapUnit1 = scale_snap.scaleVec(partToUnitVector( mManipPart )).magVec(); + LLVector3 scale_dir = partToUnitVector( mManipPart ); + mScaleSnapUnit1 = scale_snap.scaleVec(scale_dir).magVec(); mScaleSnapUnit2 = mScaleSnapUnit1; + mGridScale1 = mScaleSnapUnit1; + mGridScale2 = mScaleSnapUnit1; mSnapGuideDir1 *= mSnapGuideDir1 * LLViewerCamera::getInstance()->getUpAxis() > 0.f ? 1.f : -1.f; mSnapGuideDir2 = mSnapGuideDir1 * -1.f; mSnapDir1 = mScaleDir; @@ -1515,30 +1536,30 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) case VX: // x axis face being scaled, use y and z for snap guides mSnapGuideDir1 = LLVector3::y_axis.scaledVec(axis_flip); - mScaleSnapUnit1 = grid_scale.mV[VZ]; + mGridScale1 = grid_scale.mV[VZ]; mSnapGuideDir2 = LLVector3::z_axis.scaledVec(axis_flip); - mScaleSnapUnit2 = grid_scale.mV[VY]; + mGridScale2 = grid_scale.mV[VY]; break; case VY: // y axis facing being scaled, use x and z for snap guides mSnapGuideDir1 = LLVector3::x_axis.scaledVec(axis_flip); - mScaleSnapUnit1 = grid_scale.mV[VZ]; + mGridScale1 = grid_scale.mV[VZ]; mSnapGuideDir2 = LLVector3::z_axis.scaledVec(axis_flip); - mScaleSnapUnit2 = grid_scale.mV[VX]; + mGridScale2 = grid_scale.mV[VX]; break; case VZ: // z axis facing being scaled, use x and y for snap guides mSnapGuideDir1 = LLVector3::x_axis.scaledVec(axis_flip); - mScaleSnapUnit1 = grid_scale.mV[VY]; + mGridScale1 = grid_scale.mV[VY]; mSnapGuideDir2 = LLVector3::y_axis.scaledVec(axis_flip); - mScaleSnapUnit2 = grid_scale.mV[VX]; + mGridScale2 = grid_scale.mV[VX]; break; default: mSnapGuideDir1.zeroVec(); - mScaleSnapUnit1 = 0.f; + mGridScale1 = 0.f; mSnapGuideDir2.zeroVec(); - mScaleSnapUnit2 = 0.f; + mGridScale2 = 0.f; break; } @@ -1554,11 +1575,18 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) mScalePlaneNormal2 = mSnapGuideDir2 % mScaleDir; mScalePlaneNormal2.normVec(); - mScaleSnapUnit1 = mScaleSnapUnit1 / (mSnapDir1 * mScaleDir); - mScaleSnapUnit2 = mScaleSnapUnit2 / (mSnapDir2 * mScaleDir); + mScaleSnapUnit1 = mGridScale1 / (mSnapDir1 * mScaleDir); + mScaleSnapUnit2 = mGridScale2 / (mSnapDir2 * mScaleDir); - mTickPixelSpacing1 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length()); - mTickPixelSpacing2 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length()); + LLVector3 scale_dir_screen = orthogonal_component(mScaleDir, cam_at_axis); + scale_dir_screen.normalize(); + LLVector3 snap_guide_dir_1_screen = orthogonal_component(mSnapGuideDir1, cam_at_axis); + snap_guide_dir_1_screen.normalize(); + LLVector3 snap_guide_dir_2_screen = orthogonal_component(mSnapGuideDir2, cam_at_axis); + snap_guide_dir_2_screen.normalize(); + + mTickPixelSpacing1 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (scale_dir_screen % snap_guide_dir_1_screen).length()); + mTickPixelSpacing2 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (scale_dir_screen % snap_guide_dir_2_screen).length()); if (uniform) { @@ -1574,68 +1602,42 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) return; } - F32 max_subdivisions = sGridMaxSubdivisionLevel; + F32 max_point_on_scale_line = partToMaxScale(mManipPart, bbox); F32 grid_alpha = gSavedSettings.getF32("GridOpacity"); - F32 max_point_on_scale_line = partToMaxScale(mManipPart, bbox); LLVector3 drag_point = gAgent.getPosAgentFromGlobal(mDragPointGlobal); updateGridSettings(); + // render tick ruler baselines S32 pass; for (pass = 0; pass < 3; pass++) { LLColor4 tick_color = setupSnapGuideRenderPass(pass); + LLGLDepthTest gls_depth(pass != 1); gGL.begin(LLRender::LINES); - LLVector3 line_mid = mScaleCenter + (mScaleSnappedValue * mScaleDir) + (mSnapGuideDir1 * mSnapRegimeOffset); - LLVector3 line_start = line_mid - (mScaleDir * (llmin(mScaleSnappedValue, mSnapGuideLength * 0.5f))); - LLVector3 line_end = line_mid + (mScaleDir * llmin(max_point_on_scale_line - mScaleSnappedValue, mSnapGuideLength * 0.5f)); + { + LLVector3 line_start = mScaleCenter + (mSnapGuideDir1 * mSnapRegimeOffset); + LLVector3 line_end = line_start + (mScaleDir * max_point_on_scale_line); - gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * 0.1f); - gGL.vertex3fv(line_start.mV); - gGL.color4fv(tick_color.mV); - gGL.vertex3fv(line_mid.mV); - gGL.vertex3fv(line_mid.mV); - gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * 0.1f); - gGL.vertex3fv(line_end.mV); - - line_mid = mScaleCenter + (mScaleSnappedValue * mScaleDir) + (mSnapGuideDir2 * mSnapRegimeOffset); - line_start = line_mid - (mScaleDir * (llmin(mScaleSnappedValue, mSnapGuideLength * 0.5f))); - line_end = line_mid + (mScaleDir * llmin(max_point_on_scale_line - mScaleSnappedValue, mSnapGuideLength * 0.5f)); - gGL.vertex3fv(line_start.mV); - gGL.color4fv(tick_color.mV); - gGL.vertex3fv(line_mid.mV); - gGL.vertex3fv(line_mid.mV); - gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * 0.1f); - gGL.vertex3fv(line_end.mV); + gGL.color4fv(tick_color.mV); + gGL.vertex3fv(line_start.mV); + gGL.vertex3fv(line_end.mV); + + line_start = mScaleCenter + (mSnapGuideDir2 * mSnapRegimeOffset); + line_end = line_start + (mScaleDir * max_point_on_scale_line); + gGL.vertex3fv(line_start.mV); + gGL.vertex3fv(line_end.mV); + } gGL.end(); } { LLGLDepthTest gls_depth(GL_FALSE); - F32 dist_grid_axis = llmax(0.f, (drag_point - mScaleCenter) * mScaleDir); - // find distance to nearest smallest grid unit - F32 grid_multiple1 = llfloor(dist_grid_axis / (mScaleSnapUnit1 / max_subdivisions)); - F32 grid_multiple2 = llfloor(dist_grid_axis / (mScaleSnapUnit2 / max_subdivisions)); - F32 grid_offset1 = fmodf(dist_grid_axis, mScaleSnapUnit1 / max_subdivisions); - F32 grid_offset2 = fmodf(dist_grid_axis, mScaleSnapUnit2 / max_subdivisions); - - // how many smallest grid units are we away from largest grid scale? - S32 sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / (mScaleSnapUnit1 / max_subdivisions)); - S32 sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / (mScaleSnapUnit2 / max_subdivisions)); - - S32 num_ticks_per_side1 = llmax(1, lltrunc(0.5f * mSnapGuideLength / (mScaleSnapUnit1 / max_subdivisions))); - S32 num_ticks_per_side2 = llmax(1, lltrunc(0.5f * mSnapGuideLength / (mScaleSnapUnit2 / max_subdivisions))); - F32 dist_scale_units_1 = dist_grid_axis / (mScaleSnapUnit1 / max_subdivisions); - F32 dist_scale_units_2 = dist_grid_axis / (mScaleSnapUnit2 / max_subdivisions); - S32 ticks_from_scale_center_1 = lltrunc(dist_scale_units_1); - S32 ticks_from_scale_center_2 = lltrunc(dist_scale_units_2); - S32 max_ticks1 = llceil(max_point_on_scale_line / (mScaleSnapUnit1 / max_subdivisions) - dist_scale_units_1); - S32 max_ticks2 = llceil(max_point_on_scale_line / (mScaleSnapUnit2 / max_subdivisions) - dist_scale_units_2); - S32 start_tick = 0; - S32 stop_tick = 0; + S32 num_ticks_per_side1 = llmax(1, lltrunc(max_point_on_scale_line / (mScaleSnapUnit1 / sGridMaxSubdivisionLevel))); + S32 num_ticks_per_side2 = llmax(1, lltrunc(max_point_on_scale_line / (mScaleSnapUnit2 / sGridMaxSubdivisionLevel))); if (mInSnapRegime) { @@ -1653,6 +1655,17 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) gGL.vertex3fv(snap_line_end.mV); gGL.end(); + F32 arrow_size; + if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) + { + arrow_size = 0.1f; + } + else + { + arrow_size = 0.01f * dist_vec(snap_line_center, LLViewerCamera::getInstance()->getOrigin()); + } + + // draw snap guide arrow gGL.begin(LLRender::TRIANGLES); { @@ -1664,15 +1677,15 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) arrow_dir = snap_line_start - snap_line_center; arrow_dir.normVec(); - gGL.vertex3fv((snap_line_start + arrow_dir * mSnapRegimeOffset * 0.1f).mV); - gGL.vertex3fv((snap_line_start + arrow_span * mSnapRegimeOffset * 0.1f).mV); - gGL.vertex3fv((snap_line_start - arrow_span * mSnapRegimeOffset * 0.1f).mV); + gGL.vertex3fv((snap_line_start + arrow_dir * arrow_size).mV); + gGL.vertex3fv((snap_line_start + arrow_span * arrow_size).mV); + gGL.vertex3fv((snap_line_start - arrow_span * arrow_size).mV); arrow_dir = snap_line_end - snap_line_center; arrow_dir.normVec(); - gGL.vertex3fv((snap_line_end + arrow_dir * mSnapRegimeOffset * 0.1f).mV); - gGL.vertex3fv((snap_line_end + arrow_span * mSnapRegimeOffset * 0.1f).mV); - gGL.vertex3fv((snap_line_end - arrow_span * mSnapRegimeOffset * 0.1f).mV); + gGL.vertex3fv((snap_line_end + arrow_dir * arrow_size).mV); + gGL.vertex3fv((snap_line_end + arrow_span * arrow_size).mV); + gGL.vertex3fv((snap_line_end - arrow_span * arrow_size).mV); } gGL.end(); } @@ -1685,35 +1698,32 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) for (pass = 0; pass < 3; pass++) { LLColor4 tick_color = setupSnapGuideRenderPass(pass); - - start_tick = -(llmin(ticks_from_scale_center_1, num_ticks_per_side1)); - stop_tick = llmin(max_ticks1, num_ticks_per_side1); + LLGLDepthTest gls_depth(pass != 1); gGL.begin(LLRender::LINES); // draw first row of ticks - for (S32 i = start_tick; i <= stop_tick; i++) + for (S32 i = 0; i <= num_ticks_per_side1; i++) { - F32 alpha = (1.f - (1.f * ((F32)llabs(i) / (F32)num_ticks_per_side1))); - LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple1 + i) * (mScaleSnapUnit1 / max_subdivisions)); + LLVector3 tick_pos = mScaleCenter + (mScaleDir * i * (mScaleSnapUnit1 / sGridMaxSubdivisionLevel)); - F32 cur_subdivisions = llclamp(getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1); - if (fmodf((F32)(i + sub_div_offset_1), (max_subdivisions / cur_subdivisions)) != 0.f) + if (i != num_ticks_per_side1 && fmodf((F32)i, (sGridMaxSubdivisionLevel / cur_subdivisions)) != 0.f) { continue; } F32 tick_scale = 1.f; - for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) + for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) { - if (fmodf((F32)(i + sub_div_offset_1), division_level) == 0.f) + if (fmodf((F32)i, division_level) == 0.f) { break; } tick_scale *= 0.7f; } - gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * alpha); + gGL.color4fv(tick_color.mV); LLVector3 tick_start = tick_pos + (mSnapGuideDir1 * mSnapRegimeOffset); LLVector3 tick_end = tick_start + (mSnapGuideDir1 * mSnapRegimeOffset * tick_scale); gGL.vertex3fv(tick_start.mV); @@ -1721,32 +1731,28 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) } // draw opposite row of ticks - start_tick = -(llmin(ticks_from_scale_center_2, num_ticks_per_side2)); - stop_tick = llmin(max_ticks2, num_ticks_per_side2); - - for (S32 i = start_tick; i <= stop_tick; i++) + for (S32 i = 0; i <= num_ticks_per_side2; i++) { - F32 alpha = (1.f - (1.f * ((F32)llabs(i) / (F32)num_ticks_per_side2))); - LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple2 + i) * (mScaleSnapUnit2 / max_subdivisions)); + LLVector3 tick_pos = mScaleCenter + (mScaleDir * i * (mScaleSnapUnit2 / sGridMaxSubdivisionLevel)); - F32 cur_subdivisions = llclamp(getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, mTickPixelSpacing2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, mTickPixelSpacing2); - if (fmodf((F32)(i + sub_div_offset_2), (max_subdivisions / cur_subdivisions)) != 0.f) + if (i != num_ticks_per_side1 && fmodf((F32)i, (sGridMaxSubdivisionLevel / cur_subdivisions)) != 0.f) { continue; } F32 tick_scale = 1.f; - for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) + for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) { - if (fmodf((F32)(i + sub_div_offset_2), division_level) == 0.f) + if (fmodf((F32)i, division_level) == 0.f) { break; } tick_scale *= 0.7f; } - gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * alpha); + gGL.color4fv(tick_color.mV); LLVector3 tick_start = tick_pos + (mSnapGuideDir2 * mSnapRegimeOffset); LLVector3 tick_end = tick_start + (mSnapGuideDir2 * mSnapRegimeOffset * tick_scale); gGL.vertex3fv(tick_start.mV); @@ -1756,29 +1762,23 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) } // render tick labels - start_tick = -(llmin(ticks_from_scale_center_1, num_ticks_per_side1)); - stop_tick = llmin(max_ticks1, num_ticks_per_side1); - F32 grid_resolution = mObjectSelection->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax(gSavedSettings.getF32("GridResolution"), 0.001f); - S32 label_sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / (mScaleSnapUnit1 / max_subdivisions)); - S32 label_sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / (mScaleSnapUnit2 / max_subdivisions)); - for (S32 i = start_tick; i <= stop_tick; i++) + for (S32 i = 0; i <= num_ticks_per_side1; i++) { F32 tick_scale = 1.f; - F32 alpha = grid_alpha * (1.f - (0.5f * ((F32)llabs(i) / (F32)num_ticks_per_side1))); - LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple1 + i) * (mScaleSnapUnit1 / max_subdivisions)); + LLVector3 tick_pos = mScaleCenter + (mScaleDir * i * (mScaleSnapUnit1 / sGridMaxSubdivisionLevel)); - for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) + for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) { - if (fmodf((F32)(i + label_sub_div_offset_1), division_level) == 0.f) + if (fmodf((F32)i, division_level) == 0.f) { break; } tick_scale *= 0.7f; } - if (fmodf((F32)(i + label_sub_div_offset_1), (max_subdivisions / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, tick_label_spacing)))) == 0.f) + if (i == num_ticks_per_side1 || fmodf((F32)i, (sGridMaxSubdivisionLevel / getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, tick_label_spacing))) == 0.f) { LLVector3 text_origin = tick_pos + (mSnapGuideDir1 * mSnapRegimeOffset * (1.f + tick_scale)); @@ -1787,45 +1787,42 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) F32 tick_value; if (grid_mode == GRID_MODE_WORLD) { - tick_value = (grid_multiple1 + i) / (max_subdivisions / grid_resolution); + tick_value = i / (sGridMaxSubdivisionLevel / grid_resolution); } else { - tick_value = (grid_multiple1 + i) / (2.f * max_subdivisions); + tick_value = i / (2.f * sGridMaxSubdivisionLevel); } F32 text_highlight = 0.8f; - if (is_approx_equal(tick_value, mScaleSnappedValue) && mInSnapRegime) + if (is_approx_equal(tick_value, mScaleSnappedValue1) && mInSnapRegime) { text_highlight = 1.f; } - renderTickValue(text_origin, tick_value, grid_mode == GRID_MODE_WORLD ? std::string("m") : std::string("x"), LLColor4(text_highlight, text_highlight, text_highlight, alpha)); + renderTickValue(text_origin, tick_value, grid_mode == GRID_MODE_WORLD ? "m" : "x", LLColor4(text_highlight, text_highlight, text_highlight, grid_alpha)); } } // label ticks on opposite side if (mScaleSnapUnit2 != mScaleSnapUnit1) { - start_tick = -(llmin(ticks_from_scale_center_2, num_ticks_per_side2)); - stop_tick = llmin(max_ticks2, num_ticks_per_side2); - for (S32 i = start_tick; i <= stop_tick; i++) + for (S32 i = 0; i <= num_ticks_per_side2; i++) { F32 tick_scale = 1.f; - F32 alpha = grid_alpha * (1.f - (0.5f * ((F32)llabs(i) / (F32)num_ticks_per_side2))); - LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple2 + i) * (mScaleSnapUnit2 / max_subdivisions)); + LLVector3 tick_pos = mScaleCenter + (mScaleDir * i * (mScaleSnapUnit2 / sGridMaxSubdivisionLevel)); - for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) + for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) { - if (fmodf((F32)(i + label_sub_div_offset_2), division_level) == 0.f) + if (fmodf(i, division_level) == 0.f) { break; } tick_scale *= 0.7f; } - if (fmodf((F32)(i + label_sub_div_offset_2), (max_subdivisions / llmin(max_subdivisions, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, tick_label_spacing)))) == 0.f) + if (i == num_ticks_per_side2 || fmodf((F32)i, (sGridMaxSubdivisionLevel / getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, tick_label_spacing))) == 0.f) { LLVector3 text_origin = tick_pos + (mSnapGuideDir2 * mSnapRegimeOffset * (1.f + tick_scale)); @@ -1834,21 +1831,21 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) F32 tick_value; if (grid_mode == GRID_MODE_WORLD) { - tick_value = (grid_multiple2 + i) / (max_subdivisions / grid_resolution); + tick_value = i / (sGridMaxSubdivisionLevel / grid_resolution); } else { - tick_value = (grid_multiple2 + i) / (2.f * max_subdivisions); + tick_value = i / (2.f * sGridMaxSubdivisionLevel); } F32 text_highlight = 0.8f; - if (is_approx_equal(tick_value, mScaleSnappedValue) && mInSnapRegime) + if (is_approx_equal(tick_value, mScaleSnappedValue2) && mInSnapRegime) { text_highlight = 1.f; } - renderTickValue(text_origin, tick_value, grid_mode == GRID_MODE_WORLD ? std::string("m") : std::string("x"), LLColor4(text_highlight, text_highlight, text_highlight, alpha)); + renderTickValue(text_origin, tick_value, grid_mode == GRID_MODE_WORLD ? "m" : "x", LLColor4(text_highlight, text_highlight, text_highlight, grid_alpha)); } } } diff --git a/indra/newview/llmanipscale.h b/indra/newview/llmanipscale.h index 079fda76ce..916213ea0d 100755 --- a/indra/newview/llmanipscale.h +++ b/indra/newview/llmanipscale.h @@ -92,7 +92,7 @@ private: void renderEdges( const LLBBox& local_bbox ); void renderBoxHandle( F32 x, F32 y, F32 z ); void renderAxisHandle( U32 part, const LLVector3& start, const LLVector3& end ); - void renderGuidelinesPart( const LLBBox& local_bbox ); + void renderGuideline( const LLBBox& local_bbox ); void renderSnapGuides( const LLBBox& local_bbox ); void revert(); @@ -149,6 +149,8 @@ private: LLVector4 mManipulatorVertices[14]; F32 mScaleSnapUnit1; // size of snap multiples for axis 1 F32 mScaleSnapUnit2; // size of snap multiples for axis 2 + F32 mGridScale1; + F32 mGridScale2; LLVector3 mScalePlaneNormal1; // normal of plane in which scale occurs that most faces camera LLVector3 mScalePlaneNormal2; // normal of plane in which scale occurs that most faces camera LLVector3 mSnapGuideDir1; @@ -161,7 +163,8 @@ private: F32 mSnapGuideLength; LLVector3 mScaleCenter; LLVector3 mScaleDir; - F32 mScaleSnappedValue; + F32 mScaleSnappedValue1, + mScaleSnappedValue2; BOOL mInSnapRegime; F32 mManipulatorScales[NUM_MANIPULATORS]; F32 mBoxHandleSize[NUM_MANIPULATORS]; // The size of the handles at the corners of the bounding box diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 4830a4b875..12c8ac4fb4 100755 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -375,7 +375,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) //LLVector3 select_center_agent = gAgent.getPosAgentFromGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal()); // TomY: The above should (?) be identical to the below LLVector3 select_center_agent = getPivotPoint(); - mSubdivisions = llclamp(getSubdivisionLevel(select_center_agent, axis_exists ? axis : LLVector3::z_axis, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + mSubdivisions = getSubdivisionLevel(select_center_agent, axis_exists ? axis : LLVector3::z_axis, getMinGridScale()); // if we clicked on a planar manipulator, recenter mouse cursor if (mManipPart >= LL_YZ_PLANE && mManipPart <= LL_XY_PLANE) @@ -517,7 +517,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) LLSelectMgr::getInstance()->updateSelectionCenter(); LLVector3d current_pos_global = gAgent.getPosGlobalFromAgent(getPivotPoint()); - mSubdivisions = llclamp(getSubdivisionLevel(getPivotPoint(), axis_f, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + mSubdivisions = getSubdivisionLevel(getPivotPoint(), axis_f, getMinGridScale()); // Project the cursor onto that plane LLVector3d relative_move; @@ -607,7 +607,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) max_grid_scale = mGridScale.mV[VZ]; } - F32 num_subdivisions = llclamp(getSubdivisionLevel(getPivotPoint(), camera_projected_dir, max_grid_scale), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 num_subdivisions = getSubdivisionLevel(getPivotPoint(), camera_projected_dir, max_grid_scale); F32 grid_scale_a; F32 grid_scale_b; @@ -1255,6 +1255,7 @@ void LLManipTranslate::renderSnapGuides() for (S32 pass = 0; pass < 3; pass++) { LLColor4 line_color = setupSnapGuideRenderPass(pass); + LLGLDepthTest gls_depth(pass != 1); gGL.begin(LLRender::LINES); { @@ -1286,7 +1287,7 @@ void LLManipTranslate::renderSnapGuides() { tick_start = selection_center + (translate_axis * (smallest_grid_unit_scale * (F32)i - offset_nearest_grid_unit)); - F32 cur_subdivisions = llclamp(getSubdivisionLevel(tick_start, translate_axis, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = getSubdivisionLevel(tick_start, translate_axis, getMinGridScale()); if (fmodf((F32)(i + sub_div_offset), (max_subdivisions / cur_subdivisions)) != 0.f) { @@ -1384,7 +1385,7 @@ void LLManipTranslate::renderSnapGuides() tick_scale *= 0.7f; } - if (fmodf((F32)(i + sub_div_offset), (max_subdivisions / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, translate_axis, getMinGridScale(), tick_label_spacing)))) == 0.f) + if (fmodf((F32)(i + sub_div_offset), (max_subdivisions / getSubdivisionLevel(tick_pos, translate_axis, getMinGridScale(), tick_label_spacing))) == 0.f) { F32 snap_offset_meters; -- cgit v1.2.3 From 0630ac4d87cef2319b94aedb3c5c75b679691427 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 28 Feb 2014 22:35:12 -0800 Subject: MAINT-2059 FIX Corner scaling doesn't highlight distance text code cleanup --- indra/newview/llmanipscale.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 113a639635..cc28f52b0b 100755 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -1658,7 +1658,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) F32 arrow_size; if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { - arrow_size = 0.1f; + arrow_size = 0.02f; } else { -- cgit v1.2.3 From 9670f19cc3fa71d86c72362e7ac1f95dd0387809 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 20 Mar 2014 11:37:20 +0200 Subject: MAINT-1190 FIXED Update visual param list when changing sex. --- indra/newview/llpaneleditwearable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 0621cc8fad..d7cf206775 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -950,7 +950,7 @@ void LLPanelEditWearable::onCommitSexChange() gAgentAvatarp->updateSexDependentLayerSets( FALSE ); gAgentAvatarp->updateVisualParams(); - + showWearable(mWearablePtr, TRUE, TRUE); updateScrollingPanelUI(); } -- cgit v1.2.3 From 4fdf1c34b43f73c576576a6487c16e99e2ed75fc Mon Sep 17 00:00:00 2001 From: andreylproductengine Date: Thu, 13 Mar 2014 01:44:41 +0200 Subject: MAINT-3812 FIXED "Remove from outfit" is unavailable for folders containing only gestures --- indra/newview/llappearancemgr.cpp | 12 ++++++++++++ indra/newview/llinventoryfunctions.cpp | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index da1609297e..415cefb5a9 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1431,6 +1431,18 @@ void LLAppearanceMgr::takeOffOutfit(const LLUUID& cat_id) uuids_to_remove.push_back(item->getUUID()); } removeItemsFromAvatar(uuids_to_remove); + + // now deactivating all gestures in that folder + LLInventoryModel::item_array_t gest_items; + getDescendentsOfAssetType(cat_id, gest_items, LLAssetType::AT_GESTURE, false); + for (S32 i = 0; i < gest_items.count(); ++i) + { + LLViewerInventoryItem *gest_item = gest_items.get(i); + if (LLGestureMgr::instance().isGestureActive(gest_item->getLinkedUUID())) + { + LLGestureMgr::instance().deactivateGesture(gest_item->getLinkedUUID()); + } + } } // Create a copy of src_id + contents as a subfolder of dst_id. diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f1a4889f5a..aa50795eb5 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -877,7 +877,7 @@ bool LLFindWearablesEx::operator()(LLInventoryCategory* cat, LLInventoryItem* it if (!vitem) return false; // Skip non-wearables. - if (!vitem->isWearableType() && vitem->getType() != LLAssetType::AT_OBJECT) + if (!vitem->isWearableType() && vitem->getType() != LLAssetType::AT_OBJECT && vitem->getType() != LLAssetType::AT_GESTURE) { return false; } -- cgit v1.2.3 From 6bbb86811e02f508323460e875eabe836e4fe40c Mon Sep 17 00:00:00 2001 From: andreylproductengine Date: Fri, 21 Mar 2014 04:55:55 +0200 Subject: MAINT-3842 FIXED Using "Close Window" (Ctrl + W) shortcut while in Appearance mode doesn't visually revert any changes... --- indra/newview/llfloatersidepanelcontainer.cpp | 4 ++-- indra/newview/llfloatersidepanelcontainer.h | 2 +- indra/newview/llpaneleditwearable.cpp | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index c5248719e9..aee20ff706 100755 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -57,7 +57,7 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key) getChild(sMainPanelName)->onOpen(key); } -void LLFloaterSidePanelContainer::onClickCloseBtn(bool) +void LLFloaterSidePanelContainer::closeFloater(bool app_quitting) { LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); @@ -75,7 +75,7 @@ void LLFloaterSidePanelContainer::onClickCloseBtn(bool) } } - LLFloater::onClickCloseBtn(); + LLFloater::closeFloater(app_quitting); } LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 65ec8f604e..cb5956e4ef 100755 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -51,7 +51,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClickCloseBtn(bool app_quitting = false); + /*virtual*/ void closeFloater(bool app_quitting = false); LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index d7cf206775..7b50b3c7af 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -859,10 +859,8 @@ void LLPanelEditWearable::draw() void LLPanelEditWearable::onClose() { - if ( isDirty() ) - { - revertChanges(); - } + // any unsaved changes should be reverted at this point + revertChanges(); } void LLPanelEditWearable::setVisible(BOOL visible) -- cgit v1.2.3 From 7698e169f55c41f99b3a35b9a54f55984faf2473 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 24 Mar 2014 11:20:59 +0200 Subject: MAINT-3186 FIXED Disable menu items if group or ad-hoc chat is in multiselection --- indra/newview/llfloaterimcontainer.cpp | 20 ++++++++++++++++++++ .../skins/default/xui/en/menu_conversation.xml | 1 + 2 files changed, 21 insertions(+) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index bb4b9d2d40..5e59460b30 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1271,6 +1271,22 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) uuid_vec_t uuids; getParticipantUUIDs(uuids); + + //If there is group or ad-hoc chat in multiselection, everything needs to be disabled + if(uuids.size() > 1) + { + const std::set selectedItems = mConversationsRoot->getSelectionList(); + LLConversationItem * conversationItem; + for(std::set::const_iterator it = selectedItems.begin(); it != selectedItems.end(); ++it) + { + conversationItem = static_cast((*it)->getViewModelItem()); + if((conversationItem->getType() == LLConversationItem::CONV_SESSION_GROUP) || (conversationItem->getType() == LLConversationItem::CONV_SESSION_AD_HOC)) + { + return false; + } + } + } + if ("conversation_log" == item) { return gSavedPerAccountSettings.getS32("KeepConversationLogTranscripts") > 0; @@ -1375,6 +1391,10 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v else if ("can_call" == item) { return LLAvatarActions::canCall(); + } + else if ("can_open_voice_conversation" == item) + { + return is_single_select && LLAvatarActions::canCall(); } else if ("can_zoom_in" == item) { diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index 31b1d091ee..f5a493c064 100755 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -17,6 +17,7 @@ layout="topleft" name="open_voice_conversation"> + Date: Fri, 21 Mar 2014 22:20:59 +0200 Subject: MAINT-1805 FIXED "Back" button doesn't teleport user to correct location after performing several teleports to a different locations Agent position gets reseted frequently while not all varibles are uptadet, as result it is not reliable for inter-region teleportation. Changed to value from message. --- indra/newview/llviewerparcelmgr.cpp | 12 +++++++++++- indra/newview/llviewerparcelmgr.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index e361fad9de..04f02872f3 100755 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -118,6 +118,7 @@ LLViewerParcelMgr::LLViewerParcelMgr() mHoverRequestResult(0), mHoverWestSouth(), mHoverEastNorth(), + mTeleportInProgressPosition(), mRenderCollision(FALSE), mRenderSelection(TRUE), mCollisionBanned(0), @@ -1586,7 +1587,15 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use if (instance->mTeleportInProgress) { instance->mTeleportInProgress = FALSE; - instance->mTeleportFinishedSignal(gAgent.getPositionGlobal(), false); + if(instance->mTeleportInProgressPosition.isNull()) + { + //initial update + instance->mTeleportFinishedSignal(gAgent.getPositionGlobal(), false); + } + else + { + instance->mTeleportFinishedSignal(instance->mTeleportInProgressPosition, false); + } } } } @@ -2495,6 +2504,7 @@ void LLViewerParcelMgr::onTeleportFinished(bool local, const LLVector3d& new_pos // Non-local teleport (inter-region or between different parcels of the same region). // The agent parcel data has not been updated yet. // Let's wait for the update and then emit the signal. + mTeleportInProgressPosition = new_pos; mTeleportInProgress = TRUE; } } diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 9da49bb3f3..ee8d4778d9 100755 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -336,6 +336,7 @@ private: LLDynamicArray mObservers; BOOL mTeleportInProgress; + LLVector3d mTeleportInProgressPosition; teleport_finished_signal_t mTeleportFinishedSignal; teleport_failed_signal_t mTeleportFailedSignal; -- cgit v1.2.3 From 3d80a0858d97012bf24cfb26e4053369c41b068e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 24 Mar 2014 14:04:40 -0500 Subject: MAINT-3211 Fix for texture animations not working properly on rigged attachments when worn from inventory. --- .../app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl | 2 +- indra/newview/lldrawpoolavatar.cpp | 11 +++++++++++ indra/newview/llface.cpp | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl index a74290bfcd..2487110624 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl @@ -40,7 +40,7 @@ mat4 getObjectSkinnedTransform(); void main() { vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - + mat4 mat = getObjectSkinnedTransform(); mat = modelview_matrix * mat; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 24f467f954..716243b381 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1517,6 +1517,17 @@ void LLDrawPoolAvatar::getRiggedGeometry(LLFace* face, LLPointer face->setPoolType(LLDrawPool::POOL_AVATAR); } + //let getGeometryVolume know if a texture matrix is in play + if (face->mTextureMatrix) + { + face->setState(LLFace::TEXTURE_ANIM); + } + else + { + face->clearState(LLFace::TEXTURE_ANIM); + } + + //llinfos << "Rebuilt face " << face->getTEOffset() << " of " << face->getDrawable() << " at " << gFrameTimeSeconds << llendl; face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index ae62be0ad0..d69c185a2b 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1638,7 +1638,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, do_xform = false; } - if (getVirtualSize() >= MIN_TEX_ANIM_SIZE) + if (getVirtualSize() >= MIN_TEX_ANIM_SIZE || isState(LLFace::RIGGED)) { //don't override texture transform during tc bake tex_mode = 0; } -- cgit v1.2.3 From bb0515db318ee4e528da75160e982b38dd9b4b5f Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 25 Mar 2014 11:37:19 +0200 Subject: MAINT-3852 FIXED Use script name in "Save as" dialog. --- indra/newview/llpreviewscript.cpp | 3 ++- indra/newview/llpreviewscript.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 18bbf110f7..7ea62bb332 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1191,7 +1191,7 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata ) if( self->mSaveCallback ) { LLFilePicker& file_picker = LLFilePicker::instance(); - if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT ) ) + if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT, self->mScriptName ) ) { std::string filename = file_picker.getFirstFile(); std::string scriptText=self->mEditor->getText(); @@ -1978,6 +1978,7 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE); mScriptEd->mEditor->makePristine(); + mScriptEd->setScriptName(getItem()->getName()); } diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 9fb0a4fb63..97187e055a 100755 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -110,6 +110,8 @@ public: virtual bool hasAccelerators() const { return true; } + void setScriptName(const std::string& name){mScriptName = name;}; + private: void onBtnHelp(); void onBtnDynamicHelp(); @@ -132,6 +134,7 @@ protected: private: std::string mSampleText; + std::string mScriptName; LLTextEditor* mEditor; void (*mLoadCallback)(void* userdata); void (*mSaveCallback)(void* userdata, BOOL close_after_save); -- cgit v1.2.3 From ffbf11e4430041d1df17e21e70d40348467a8d9d Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 26 Mar 2014 11:08:36 +0200 Subject: MAINT-2018 FIXED Viewer crashes when copying and pasting an empty outfit folder --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 101b16b027..75a4c22d33 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3241,7 +3241,7 @@ void LLFolderBridge::pasteFromClipboard() { if (move_is_into_current_outfit || move_is_into_outfit) { - if (can_move_to_outfit(item, move_is_into_current_outfit)) + if (item && can_move_to_outfit(item, move_is_into_current_outfit)) { dropToOutfit(item, move_is_into_current_outfit); } -- cgit v1.2.3 From 73ef75498692e7b7cecb4960f4e308061917d86e Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 26 Mar 2014 11:10:26 +0200 Subject: MAINT-2376 FIXED Centre the map on friend's location --- indra/newview/llavataractions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 70cc48f12b..3fa50360cb 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -373,7 +373,7 @@ void LLAvatarActions::showOnMap(const LLUUID& id) } gFloaterWorldMap->trackAvatar(id, av_name.getDisplayName()); - LLFloaterReg::showInstance("world_map"); + LLFloaterReg::showInstance("world_map", "center"); } // static -- cgit v1.2.3 From e0fb4b598266e8aaf6bbc73bae5e5390e361cfb2 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 26 Mar 2014 16:06:16 +0200 Subject: MAINT-1851 FIXED Viewer crashes while attempting to close "Snapshot" dialog after pressing on "Snapshot" icon several times at the left toolbar --- indra/newview/skins/default/xui/en/floater_snapshot.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 853c209bca..c0089a30d8 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -7,6 +7,7 @@ height="500" layout="topleft" name="Snapshot" + single_instance="true" help_topic="snapshot" save_rect="true" save_visibility="false" -- cgit v1.2.3 From 4994d9d97d23afad234950f45a4ce99a276c5b5c Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 28 Mar 2014 18:22:03 +0200 Subject: MAINT-3878 FIXED Don't hide folder if it has descendants. --- indra/newview/llinventoryfilter.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 15463e0d33..b0d0cb217b 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -177,6 +177,7 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent // Pass if this item's type is of the correct filter type if (filterTypes & FILTERTYPE_OBJECT) { + // If it has no type, pass it, unless it's a link. if (object_type == LLInventoryType::IT_NONE) { @@ -244,13 +245,25 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType()); if (is_hidden_if_empty) { - // Force the fetching of those folders so they are hidden iff they really are empty... + // Force the fetching of those folders so they are hidden if they really are empty... gInventory.fetchDescendentsOf(object_id); - return FALSE; + + LLInventoryModel::cat_array_t* cat_array = NULL; + LLInventoryModel::item_array_t* item_array = NULL; + gInventory.getDirectDescendentsOf(object_id,cat_array,item_array); + S32 descendents_actual = 0; + if(cat_array && item_array) + { + descendents_actual = cat_array->count() + item_array->count(); + } + if (descendents_actual == 0) + { + return FALSE; + } } } } - + return TRUE; } -- cgit v1.2.3 From dcb9b7fb05a045ca954e601cb315f58be1bea85b Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 31 Mar 2014 10:54:59 +0300 Subject: MAINT-535 FIXED The teleport SLAPP is changed to UNTRUSTED_THROTTLE. Confirmation dialog for teleporting via slapp is added. --- indra/newview/llurldispatcher.cpp | 43 ++++++++++++++++++++-- .../newview/skins/default/xui/en/notifications.xml | 13 +++++++ 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 0c34db39b5..ca593c80bc 100755 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -34,6 +34,7 @@ #include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterworldmap.h" +#include "llnotifications.h" #include "llpanellogin.h" #include "llregionhandle.h" #include "llslurl.h" @@ -253,13 +254,15 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& //--------------------------------------------------------------------------- // Teleportation links are handled here because they are tightly coupled // to SLURL parsing and sim-fragment parsing + class LLTeleportHandler : public LLCommandHandler { public: // Teleport requests *must* come from a trusted browser // inside the app, otherwise a malicious web page could // cause a constant teleport loop. JC - LLTeleportHandler() : LLCommandHandler("teleport", UNTRUSTED_BLOCK) { } + LLTeleportHandler() : LLCommandHandler("teleport", UNTRUSTED_THROTTLE) { } + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) @@ -276,18 +279,50 @@ public: tokens[3].asReal()); } + LLSD args; + args["LOCATION"] = tokens[0]; + // Region names may be %20 escaped. - std::string region_name = LLURI::unescape(tokens[0]); + LLSD payload; + payload["region_name"] = region_name; + payload["callback_url"] = LLSLURL(region_name, coords).getSLURLString(); + + LLNotificationsUtil::add("TeleportViaSLAPP", args, payload); + return true; + } + + static void teleport_via_slapp(std::string region_name, std::string callback_url) + { + LLWorldMapMessage::getInstance()->sendNamedRegionRequest(region_name, LLURLDispatcherImpl::regionHandleCallback, - LLSLURL(region_name, coords).getSLURLString(), + callback_url, true); // teleport - return true; } + + static bool teleport_via_slapp_callback(const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + std::string region_name = notification["payload"]["region_name"].asString(); + std::string callback_url = notification["payload"]["callback_url"].asString(); + + if (option == 0) + { + teleport_via_slapp(region_name, callback_url); + return true; + } + + return false; + } + }; LLTeleportHandler gTeleportHandler; +static LLNotificationFunctorRegistration open_landmark_callback_reg("TeleportViaSLAPP", LLTeleportHandler::teleport_via_slapp_callback); + + //--------------------------------------------------------------------------- diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index ce34c3f7a1..07531e0d56 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4137,6 +4137,19 @@ Are you sure you want to teleport to <nolink>[LOCATION]</nolink>? notext="Cancel" yestext="Teleport"/> + + +Are you sure you want to teleport to <nolink>[LOCATION]</nolink>? + confirm + + Date: Fri, 28 Mar 2014 19:09:38 +0200 Subject: MAINT-3871 FIXED Recent issues with dragging the World Map. --- indra/newview/llworldmapview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 786e4f2de6..9c1fecefad 100755 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1694,6 +1694,8 @@ BOOL LLWorldMapView::handleHover( S32 x, S32 y, MASK mask ) sPanY += delta_y; sTargetPanX = sPanX; sTargetPanY = sPanY; + + gViewerWindow->moveCursorToCenter(); } // doesn't matter, cursor should be hidden -- cgit v1.2.3 From f7b66fadf65365797025ec56773cad8cf9c8900f Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 28 Mar 2014 17:54:07 +0200 Subject: MAINT-1606 FIXED Warning message 'The object is not for sale' appears while user try to buy the shared object --- indra/newview/lltoolpie.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index a09a2739e8..8a341e2c95 100755 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -438,8 +438,12 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object) break; case CLICK_ACTION_BUY: if ( mClickActionBuyEnabled ) - { - cursor = UI_CURSOR_TOOLBUY; + { + LLSelectNode* node = LLSelectMgr::getInstance()->getHoverNode(); + if (!node || node->mSaleInfo.isForSale()) + { + cursor = UI_CURSOR_TOOLBUY; + } } break; case CLICK_ACTION_OPEN: @@ -543,6 +547,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE); LLViewerObject *parent = NULL; LLViewerObject *object = mHoverPick.getObject(); + LLSelectMgr::getInstance()->setHoverObject(object, mHoverPick.mObjectFace); if (object) { parent = object->getRootEdit(); -- cgit v1.2.3 From 435c1950213be95f359a5d33e23e74cc2e8c76a0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 31 Mar 2014 16:38:31 +0300 Subject: MAINT-1696 FIXED "Owner" name is not clickable in "Place Profile" dialog if region is group owned --- indra/newview/llpanelplaceprofile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 3b8acdca90..b636b76b07 100755 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -488,8 +488,9 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, gCacheName->getGroup(parcel->getGroupID(), boost::bind(&LLPanelPlaceInfo::onNameCache, mRegionGroupText, _2)); - gCacheName->getGroup(parcel->getGroupID(), - boost::bind(&LLPanelPlaceInfo::onNameCache, mParcelOwner, _2)); + std::string owner = + LLSLURL("group", parcel->getGroupID(), "inspect").getSLURLString(); + mParcelOwner->setText(owner); } else { -- cgit v1.2.3 From e96fad30ac06f040099db2148a0f482641d1cbd4 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 1 Apr 2014 19:00:21 +0300 Subject: MAINT-1180 FIXED Cannot delete object description. --- indra/llui/lllineeditor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 5478e85e13..91d2f8f653 100755 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -253,6 +253,7 @@ void LLLineEditor::onCommit() setControlValue(getValue()); LLUICtrl::onCommit(); + resetDirty(); // Selection on commit needs to be turned off when evaluating maths // expressions, to allow indication of the error position -- cgit v1.2.3 From 873543bd88e1461ffadbc95ee215a1654e813261 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 2 Apr 2014 13:06:53 +0300 Subject: MAINT-2536 FIXED Ignore selectTool( gGrabTransientTool ) if mouse down is handled in mouselook and mouse up event is not handled in this mode. --- indra/newview/lltoolgrab.cpp | 18 ++++++++++++++---- indra/newview/lltoolgrab.h | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index 9907da0f0e..ff544f1e84 100755 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -83,6 +83,7 @@ LLToolGrab::LLToolGrab( LLToolComposite* composite ) mLastFace(0), mSpinGrabbing( FALSE ), mSpinRotation(), + mClickedInMouselook( FALSE ), mHideBuildHighlight(FALSE) { } @@ -136,6 +137,7 @@ BOOL LLToolGrab::handleMouseDown(S32 x, S32 y, MASK mask) // can grab transparent objects (how touch event propagates, scripters rely on this) gViewerWindow->pickAsync(x, y, mask, pickCallback, TRUE); } + mClickedInMouselook = gAgentCamera.cameraMouselook(); return TRUE; } @@ -926,13 +928,21 @@ BOOL LLToolGrab::handleMouseUp(S32 x, S32 y, MASK mask) { setMouseCapture( FALSE ); } + mMode = GRAB_INACTIVE; - // HACK: Make some grabs temporary - if (gGrabTransientTool) + if(mClickedInMouselook && !gAgentCamera.cameraMouselook()) { - gBasicToolset->selectTool( gGrabTransientTool ); - gGrabTransientTool = NULL; + mClickedInMouselook = FALSE; + } + else + { + // HACK: Make some grabs temporary + if (gGrabTransientTool) + { + gBasicToolset->selectTool( gGrabTransientTool ); + gGrabTransientTool = NULL; + } } //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject")); diff --git a/indra/newview/lltoolgrab.h b/indra/newview/lltoolgrab.h index 06a3b662c8..5107716aab 100755 --- a/indra/newview/lltoolgrab.h +++ b/indra/newview/lltoolgrab.h @@ -133,6 +133,8 @@ private: LLQuaternion mSpinRotation; BOOL mHideBuildHighlight; + + BOOL mClickedInMouselook; }; extern BOOL gGrabBtnVertical; -- cgit v1.2.3 From 1108a34d1dc063eddf2b0e4991b6391a12686be7 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 8 Apr 2014 12:37:41 +0300 Subject: MAINT-3907 FIXED Handle pressing of Alt/Shift/Control keys without any other key being pressed simultaneously. --- indra/llwindow/llopenglview-objc.mm | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 017ea3769c..f7031341eb 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -398,9 +398,35 @@ attributedStringInfo getSegments(NSAttributedString *str) } } -- (void)flagsChanged:(NSEvent *)theEvent { +- (void)flagsChanged:(NSEvent *)theEvent +{ mModifiers = [theEvent modifierFlags]; callModifier([theEvent modifierFlags]); + + NSInteger mask = 0; + switch([theEvent keyCode]) + { + case 56: + mask = NSShiftKeyMask; + break; + case 58: + mask = NSAlternateKeyMask; + break; + case 59: + mask = NSControlKeyMask; + break; + default: + return; + } + + if (mModifiers & mask) + { + callKeyDown([theEvent keyCode], 0); + } + else + { + callKeyUp([theEvent keyCode], 0); + } } - (BOOL) acceptsFirstResponder -- cgit v1.2.3 From 508487bdee53daf385653561fc14193dd3fc69a3 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 7 Apr 2014 18:36:02 +0300 Subject: MAINT-459 FIXED Cannot delete prim displaying media Fixed interaction with unselected faces while media is selected. --- indra/newview/lltoolselect.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 7c604a04bf..0e69cc51ac 100755 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -35,6 +35,7 @@ #include "llmanip.h" #include "llmenugl.h" #include "llselectmgr.h" +#include "llviewermediafocus.h" #include "lltoolmgr.h" #include "llfloaterscriptdebug.h" #include "llviewercamera.h" @@ -109,6 +110,21 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi { BOOL already_selected = object->isSelected(); + if (already_selected && + object->getNumTEs() > 0 && + !LLSelectMgr::getInstance()->getSelection()->contains(object,SELECT_ALL_TES)) + { + const LLTextureEntry* tep = object->getTE(pick.mObjectFace); + if (tep && !tep->isSelected() && !LLViewerMediaFocus::getInstance()->getFocusedObjectID().isNull()) + { + // we were interacting with media and clicked on non selected face, drop media focus + LLViewerMediaFocus::getInstance()->clearFocus(); + // selection was removed and zoom preserved by clearFocus(), continue with regular selection + already_selected = false; + extend_select = true; + } + } + if ( extend_select ) { if ( already_selected ) -- cgit v1.2.3 From 83bd0625f058e0ca64deb3eaa4ccd87c09c4624f Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 9 Apr 2014 10:50:18 +0300 Subject: MAINT-27 FIXED Prevent pasting non-ascii chars to avoid creating outfits with empty name. --- indra/newview/lltoastalertpanel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 6083210080..c6e4fdf25a 100755 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -267,6 +267,11 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal mLineEditor->setMaxTextChars(edit_text_max_chars); mLineEditor->setText(edit_text_contents); + if("SaveOutfitAs" == mNotification->getName()) + { + mLineEditor->setPrevalidate(&LLTextValidate::validateASCII); + } + // decrease limit of line editor of teleport offer dialog to avoid truncation of // location URL in invitation message, see EXT-6891 if ("OfferTeleport" == mNotification->getName()) -- cgit v1.2.3 From 8683c47615fefb6fe531ceca4bf428a0faf010c2 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 10 Apr 2014 12:36:12 +0300 Subject: MAINT-1695 FIXED Close floater after saving notecard. --- indra/newview/llpreviewnotecard.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 3a9360fd23..61525bd560 100755 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -476,12 +476,17 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) &onSaveComplete, (void*)info, FALSE); + return true; } else // !gAssetStorage { llwarns << "Not connected to an asset storage system." << llendl; return false; } + if(mCloseAfterSave) + { + closeFloater(); + } } } return true; -- cgit v1.2.3 From 75b93c15abc9ad9964fd5ef1e89335e50bdd6647 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 9 Apr 2014 16:21:56 +0300 Subject: MAINT-2245 FIXED Object's content doesn't display inside "Buy" dialog when prim is set for sale --- indra/newview/llviewerobject.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index c789719291..1900112822 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2563,8 +2563,8 @@ void LLViewerObject::dirtyInventory() mInventory->clear(); // will deref and delete entries delete mInventory; mInventory = NULL; - mInventoryDirty = TRUE; } + mInventoryDirty = TRUE; } void LLViewerObject::registerInventoryListener(LLVOInventoryListener* listener, void* user_data) @@ -2601,12 +2601,15 @@ void LLViewerObject::clearInventoryListeners() void LLViewerObject::requestInventory() { - mInventoryDirty = FALSE; + if(mInventoryDirty && mInventory && !mInventoryCallbacks.empty()) + { + mInventory->clear(); // will deref and delete entries + delete mInventory; + mInventory = NULL; + mInventoryDirty = FALSE; //since we are going to request it now + } if(mInventory) { - //mInventory->clear() // will deref and delete it - //delete mInventory; - //mInventory = NULL; doInventoryCallback(); } // throw away duplicate requests -- cgit v1.2.3 From 71c465523531eefe8554208b9fdb6c43d1f449f4 Mon Sep 17 00:00:00 2001 From: Cinder Biscuits Date: Wed, 9 Apr 2014 22:11:59 +0000 Subject: Fix broken header guard --- indra/llaudio/llaudiodecodemgr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llaudio/llaudiodecodemgr.h b/indra/llaudio/llaudiodecodemgr.h index e42fe8a40d..1207638f15 100755 --- a/indra/llaudio/llaudiodecodemgr.h +++ b/indra/llaudio/llaudiodecodemgr.h @@ -24,7 +24,7 @@ */ #ifndef LL_LLAUDIODECODEMGR_H -#define LL_LLAUDIODECODEMG_H +#define LL_LLAUDIODECODEMGR_H #include "stdtypes.h" -- cgit v1.2.3 From 0b0ca7961bfb4fb808c9653a68c46eb2353ba2a8 Mon Sep 17 00:00:00 2001 From: andreylproductengine Date: Thu, 10 Apr 2014 07:05:34 +0300 Subject: MAINT-3846 FIXED I can only invite members to a group to the role of everyone... --- indra/newview/llpanelgroupinvite.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index a9a3c686a6..bb4bfb2f96 100755 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -260,7 +260,7 @@ void LLPanelGroupInvite::impl::addRoleNames(LLGroupMgrGroupData* gdatap) //else if they have the limited add to roles power //we add every role the user is in //else we just add to everyone - bool is_owner = member_data->isInRole(gdatap->mOwnerRole); + bool is_owner = member_data->isOwner(); bool can_assign_any = gAgent.hasPowerInGroup(mGroupID, GP_ROLE_ASSIGN_MEMBER); bool can_assign_limited = gAgent.hasPowerInGroup(mGroupID, @@ -579,7 +579,7 @@ void LLPanelGroupInvite::updateLists() { waiting = true; } - if (gdatap->isRoleDataComplete() && gdatap->isMemberDataComplete()) + if (gdatap->isRoleDataComplete() && gdatap->isMemberDataComplete() && gdatap->isRoleMemberDataComplete()) { if ( mImplementation->mRoleNames ) { @@ -607,6 +607,7 @@ void LLPanelGroupInvite::updateLists() { LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mImplementation->mGroupID); LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mImplementation->mGroupID); + LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mImplementation->mGroupID); LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mImplementation->mGroupID); } mPendingUpdate = TRUE; -- cgit v1.2.3 From 4cf5d945d4e892c1c5383e49910759c24ecbf591 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 14 Apr 2014 11:13:22 +0300 Subject: MAINT-3564 FIXED Replace dot before comparing user name. --- indra/newview/llpanellogin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 911ecaad9d..d6183c5ab3 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -262,6 +262,7 @@ void LLPanelLogin::addFavoritesToStartLocation() // Load favorites into the combo. std::string user_defined_name = getChild("username_combo")->getSimple(); + std::replace(user_defined_name.begin(), user_defined_name.end(), '.', ' '); std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml"); LLSD fav_llsd; llifstream file; -- cgit v1.2.3 From 4eeff34c6514160b3abefce35cee5f0e4e8cf1de Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 15 Apr 2014 10:54:15 +0300 Subject: MAINT-3931 FIXED Don't display any other check marks if Region Settings is selected. --- indra/newview/llviewermenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ab9551ad17..e8759ee4ca 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8242,9 +8242,9 @@ class LLWorldEnableEnvSettings : public view_listener_t bool result = false; std::string tod = userdata.asString(); - if (tod == "region") + if (LLEnvManagerNew::instance().getUseRegionSettings()) { - return LLEnvManagerNew::instance().getUseRegionSettings(); + return (tod == "region"); } if (LLEnvManagerNew::instance().getUseFixedSky()) -- cgit v1.2.3 From fd2a114d4ba0edb3bdfb73fff1e455be3ec079ed Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 14 Apr 2014 18:57:29 +0300 Subject: MAINT-1642 FIXED Viewer crashes on double-click on RegionCapabilityRequestError in Notifications Console --- indra/newview/llfloaternotificationsconsole.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index 4f35c325a8..e33f528c3b 100755 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -41,6 +41,7 @@ class LLNotificationChannelPanel : public LLLayoutPanel { public: LLNotificationChannelPanel(const Params& p); + ~LLNotificationChannelPanel(); BOOL postBuild(); private: @@ -57,6 +58,20 @@ LLNotificationChannelPanel::LLNotificationChannelPanel(const LLNotificationChann buildFromFile( "panel_notifications_channel.xml"); } +LLNotificationChannelPanel::~LLNotificationChannelPanel() +{ + // Userdata for all records is a LLNotification* we need to clean up + std::vector data_list = getChild("notifications_list")->getAllData(); + std::vector::iterator data_itor; + for (data_itor = data_list.begin(); data_itor != data_list.end(); ++data_itor) + { + LLScrollListItem* item = *data_itor; + LLNotification* notification = (LLNotification*)item->getUserdata(); + delete notification; + notification = NULL; + } +} + BOOL LLNotificationChannelPanel::postBuild() { LLButton* header_button = getChild("header"); @@ -124,7 +139,7 @@ bool LLNotificationChannelPanel::update(const LLSD& payload) row["columns"][2]["type"] = "date"; LLScrollListItem* sli = getChild("notifications_list")->addElement(row); - sli->setUserdata(&(*notification)); + sli->setUserdata(new LLNotification(notification->asLLSD())); } return false; -- cgit v1.2.3 From 1a1ac2f9b84553ecd00430a82a8e73e373e9c885 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 22 Apr 2014 13:34:02 +0300 Subject: MAINT-3951 FIXED Exclude avatar's uuid before starting conference. --- indra/newview/llpanelpeoplemenus.cpp | 15 ++++++++++++++- indra/newview/llpanelpeoplemenus.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 6979ae06e0..a5f59dbf4a 100755 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -90,7 +90,7 @@ LLContextMenu* PeopleContextMenu::createMenu() // Set up for multi-selected People // registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, mUUIDs)); // *TODO: unimplemented - registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startConference, mUUIDs, LLUUID::null)); + registrar.add("Avatar.IM", boost::bind(&PeopleContextMenu::startConference, this)); registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startAdhocCall, mUUIDs, LLUUID::null)); registrar.add("Avatar.OfferTeleport", boost::bind(&PeopleContextMenu::offerTeleport, this)); registrar.add("Avatar.RemoveFriend", boost::bind(&LLAvatarActions::removeFriendsDialog, mUUIDs)); @@ -272,6 +272,19 @@ void PeopleContextMenu::offerTeleport() LLAvatarActions::offerTeleport(mUUIDs); } +void PeopleContextMenu::startConference() +{ + uuid_vec_t uuids; + for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it) + { + if(*it != gAgentID) + { + uuids.push_back(*it); + } + } + LLAvatarActions::startConference(uuids); +} + //== NearbyPeopleContextMenu =============================================================== void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index 945382ebc5..9767bab89f 100755 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -47,6 +47,7 @@ private: bool enableContextMenuItem(const LLSD& userdata); bool checkContextMenuItem(const LLSD& userdata); void offerTeleport(); + void startConference(); void requestTeleport(); }; -- cgit v1.2.3 From 0e4e551df513c90afedf03f0cb8054df8e040e0f Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 22 Apr 2014 13:45:25 +0300 Subject: MAINT-3917 FIXED Don't stop updating self avatar even with disabled avatar rendering. --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c47b6d2335..baf396a818 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2058,7 +2058,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) } if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_AVATAR)) - && !(gSavedSettings.getBOOL("DisableAllRenderTypes"))) + && !(gSavedSettings.getBOOL("DisableAllRenderTypes")) && !isSelf()) { return; } -- cgit v1.2.3 From 29e0c3b18fe7dc504a898c7f50a372731a4fa291 Mon Sep 17 00:00:00 2001 From: andreylproductengine Date: Tue, 15 Apr 2014 15:10:06 +0300 Subject: MAINT-3891 FIXED Clearing saved URLs from media URLs list causes mouse cursor to spin constantly until relog. --- indra/newview/llfloaterurlentry.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index e85d849c9a..b8136d4a85 100755 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -205,6 +205,10 @@ void LLFloaterURLEntry::onBtnOK( void* userdata ) LLURLHistory::addURL("parcel", media_url); } + // show progress bar here? + getWindow()->incBusyCount(); + self->getChildView("loading_label")->setVisible( true); + // leading whitespace causes problems with the MIME-type detection so strip it LLStringUtil::trim( media_url ); @@ -234,10 +238,6 @@ void LLFloaterURLEntry::onBtnOK( void* userdata ) self->getChildView("ok_btn")->setEnabled(false); self->getChildView("cancel_btn")->setEnabled(false); self->getChildView("media_entry")->setEnabled(false); - - // show progress bar here? - getWindow()->incBusyCount(); - self->getChildView("loading_label")->setVisible( true); } // static -- cgit v1.2.3 From 331663458fbf0a434701b1bb1dd15901eb1c20fe Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 22 Apr 2014 19:27:25 +0300 Subject: MAINT-1344 FIXED Attempting to move a folder or item, to another folder in a different inventory window found via inventory search, fails. --- indra/newview/llinventorybridge.cpp | 25 +++++++++++++++++++------ indra/newview/llinventoryfilter.cpp | 5 +++++ indra/newview/llinventoryfilter.h | 1 + 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 75a4c22d33..00ae3e6afc 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2263,6 +2263,9 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, && (LLToolDragAndDrop::SOURCE_AGENT == source); BOOL accept = FALSE; + U64 filter_types = filter->getFilterTypes(); + BOOL use_filter = filter_types && (filter_types&LLInventoryFilter::FILTERTYPE_DATE || (filter_types&LLInventoryFilter::FILTERTYPE_OBJECT)==0); + if (is_agent_inventory) { const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false); @@ -2461,7 +2464,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, is_movable = active_folder_view != NULL; } - if (is_movable) + if (is_movable && use_filter) { // Check whether the folder being dragged from active inventory panel // passes the filter of the destination panel. @@ -2635,6 +2638,12 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id, BOOL accept = FALSE; BOOL is_move = FALSE; + BOOL use_filter = FALSE; + if (filter) + { + U64 filter_types = filter->getFilterTypes(); + use_filter = filter_types && (filter_types&LLInventoryFilter::FILTERTYPE_DATE || (filter_types&LLInventoryFilter::FILTERTYPE_OBJECT)==0); + } // coming from a task. Need to figure out if the person can // move/copy this item. @@ -2667,7 +2676,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id, accept = TRUE; } - if (filter && accept) + if (accept && use_filter) { accept = filter->check(item); } @@ -3993,6 +4002,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); BOOL accept = FALSE; + U64 filter_types = filter->getFilterTypes(); + // We shouldn't allow to drop non recent items into recent tab (or some similar transactions) + // while we are allowing to interact with regular filtered inventory + BOOL use_filter = filter_types && (filter_types&LLInventoryFilter::FILTERTYPE_DATE || (filter_types&LLInventoryFilter::FILTERTYPE_OBJECT)==0); LLViewerObject* object = NULL; if(LLToolDragAndDrop::SOURCE_AGENT == source) { @@ -4091,7 +4104,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Check whether the item being dragged from active inventory panel // passes the filter of the destination panel. - if (accept && active_panel) + if (accept && active_panel && use_filter) { LLFolderViewItem* fv_item = active_panel->getItemByID(inv_item->getUUID()); if (!fv_item) return false; @@ -4229,7 +4242,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Check whether the item being dragged from in world // passes the filter of the destination panel. - if (accept) + if (accept && use_filter) { accept = filter->check(inv_item); } @@ -4273,7 +4286,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Check whether the item being dragged from notecard // passes the filter of the destination panel. - if (accept) + if (accept && use_filter) { accept = filter->check(inv_item); } @@ -4313,7 +4326,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Check whether the item being dragged from the library // passes the filter of the destination panel. - if (accept && active_panel) + if (accept && active_panel && use_filter) { LLFolderViewItem* fv_item = active_panel->getItemByID(inv_item->getUUID()); if (!fv_item) return false; diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index c314886f16..b941552f21 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -985,6 +985,11 @@ void LLInventoryFilter::fromParams(const Params& params) setDateRangeLastLogoff(params.since_logoff); } +U64 LLInventoryFilter::getFilterTypes() const +{ + return mFilterOps.mFilterTypes; +} + U64 LLInventoryFilter::getFilterObjectTypes() const { return mFilterOps.mFilterObjectTypes; diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index ce516af0b9..094fda7707 100755 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -151,6 +151,7 @@ public: // +-------------------------------------------------------------------+ // + Parameters // +-------------------------------------------------------------------+ + U64 getFilterTypes() const; U64 getFilterObjectTypes() const; U64 getFilterCategoryTypes() const; U64 getFilterWearableTypes() const; -- cgit v1.2.3 From b1cffda8f3ac9ce95525ae926272c0ecbbc5b24e Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 23 Apr 2014 19:47:19 +0300 Subject: MAINT-2361 FIXED One and the same user shown in Allowed and in Banned Residents lists --- indra/llinventory/llparcel.cpp | 4 ---- indra/newview/llfloaterland.cpp | 24 ++++++++++++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 5eb5fb442d..d6bfec5bec 100755 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -793,8 +793,6 @@ BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) } } - removeFromBanList(agent_id); - LLAccessEntry new_entry; new_entry.mID = agent_id; new_entry.mTime = time; @@ -838,8 +836,6 @@ BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) } } - removeFromAccessList(agent_id); - LLAccessEntry new_entry; new_entry.mID = agent_id; new_entry.mTime = time; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index d79eee6be3..6b549b06de 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2776,10 +2776,16 @@ void LLPanelLandAccess::callbackAvatarCBAccess(const uuid_vec_t& ids) { LLUUID id = ids[0]; LLParcel* parcel = mParcel->getParcel(); - if (parcel) + if (parcel && parcel->addToAccessList(id, 0)) { - parcel->addToAccessList(id, 0); - LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_ACCESS); + U32 lists_to_update = AL_ACCESS; + // agent was successfully added to access list + // but we also need to check ban list to ensure that agent will not be in two lists simultaneously + if(parcel->removeFromBanList(id)) + { + lists_to_update |= AL_BAN; + } + LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(lists_to_update); refresh(); } } @@ -2828,10 +2834,16 @@ void LLPanelLandAccess::callbackAvatarCBBanned(const uuid_vec_t& ids) { LLUUID id = ids[0]; LLParcel* parcel = mParcel->getParcel(); - if (parcel) + if (parcel && parcel->addToBanList(id, 0)) { - parcel->addToBanList(id, 0); - LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_BAN); + U32 lists_to_update = AL_BAN; + // agent was successfully added to ban list + // but we also need to check access list to ensure that agent will not be in two lists simultaneously + if (parcel->removeFromAccessList(id)) + { + lists_to_update |= AL_ACCESS; + } + LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(lists_to_update); refresh(); } } -- cgit v1.2.3 From cd7e7e96030c2dffccc31e1c1e29f5ee608992e5 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 28 Apr 2014 11:48:11 +0300 Subject: MAINT-3957 FIXED Group owner issue --- indra/newview/llpanelgrouproles.cpp | 24 ++++++++++++++---------- indra/newview/llpanelgrouproles.h | 3 +++ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index c30c932c41..160a0ee417 100755 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1768,7 +1768,7 @@ LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() mMemberVisibleCheck(NULL), mDeleteRoleButton(NULL), mCreateRoleButton(NULL), - + mFirstOpen(TRUE), mHasRoleChange(FALSE) { } @@ -1870,6 +1870,7 @@ void LLPanelGroupRolesSubTab::deactivate() lldebugs << "LLPanelGroupRolesSubTab::deactivate()" << llendl; LLPanelGroupSubTab::deactivate(); + mFirstOpen = FALSE; } bool LLPanelGroupRolesSubTab::needsApply(std::string& mesg) @@ -1887,7 +1888,7 @@ bool LLPanelGroupRolesSubTab::apply(std::string& mesg) lldebugs << "LLPanelGroupRolesSubTab::apply()" << llendl; saveRoleChanges(true); - + mFirstOpen = FALSE; LLGroupMgr::getInstance()->sendGroupRoleChanges(mGroupID); notifyObservers(); @@ -2024,14 +2025,17 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) } } - if (!gdatap || !gdatap->isMemberDataComplete()) + if(!mFirstOpen) { - LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID); - } - - if (!gdatap || !gdatap->isRoleMemberDataComplete()) - { - LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID); + if (!gdatap || !gdatap->isMemberDataComplete()) + { + LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID); + } + + if (!gdatap || !gdatap->isRoleMemberDataComplete()) + { + LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID); + } } if ((GC_ROLE_MEMBER_DATA == gc || GC_MEMBER_DATA == gc) @@ -2662,7 +2666,7 @@ void LLPanelGroupRoles::setGroupID(const LLUUID& id) if(mSubTabContainer) mSubTabContainer->selectTab(1); - + group_roles_tab->mFirstOpen = TRUE; activate(); } diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 0cf272f3ee..71b1db5079 100755 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -259,6 +259,9 @@ public: void saveRoleChanges(bool select_saved_role); virtual void setGroupID(const LLUUID& id); + + BOOL mFirstOpen; + protected: void handleActionCheck(LLUICtrl* ctrl, bool force); LLSD createRoleItem(const LLUUID& role_id, std::string name, std::string title, S32 members); -- cgit v1.2.3 From c283a94c0addc47468291c5b01c74d14daf81210 Mon Sep 17 00:00:00 2001 From: andreylproductengine Date: Tue, 29 Apr 2014 06:36:23 +0300 Subject: MAINT-3969 FIXED Animation problems when teleporting while sitting on some objects --- indra/newview/llagent.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 0582916362..1cc9b6a510 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3822,6 +3822,12 @@ bool LLAgent::teleportCore(bool is_local) return false; } + // force stand up and stop a sitting animation (if any), see MAINT-3969 + if (isAgentAvatarValid() && gAgentAvatarp->getParent() && gAgentAvatarp->isSitting()) + { + gAgentAvatarp->getOffObject(); + } + #if 0 // This should not exist. It has been added, removed, added, and now removed again. // This change needs to come from the simulator. Otherwise, the agent ends up out of -- cgit v1.2.3 From 61f126c289f741265ec7a407c946bf26979255b9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 25 Apr 2014 17:26:20 +0300 Subject: MAINT-2884 FIXED Empty menu item is presented in Type drop-down list in Media tab. --- indra/newview/skins/default/xui/en/mime_types.xml | 21 +++++++++++++++++++++ .../skins/default/xui/en/mime_types_linux.xml | 21 +++++++++++++++++++++ .../newview/skins/default/xui/en/mime_types_mac.xml | 21 +++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/indra/newview/skins/default/xui/en/mime_types.xml b/indra/newview/skins/default/xui/en/mime_types.xml index a585069faa..f5f2223330 100755 --- a/indra/newview/skins/default/xui/en/mime_types.xml +++ b/indra/newview/skins/default/xui/en/mime_types.xml @@ -101,6 +101,27 @@ true + + + + none/none + + + icn_media_web.tga + + + No media here + + + + false + + + false + + - + + +Unable to upload texture. +[REASON] + fail + + Date: Wed, 7 May 2014 13:58:05 +0300 Subject: MAINT-3940 FIXED Scrollbar not visible after conversation floater is resized --- indra/newview/skins/default/xui/en/floater_im_session.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 7076de55e3..bc72092f5f 100755 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -210,7 +210,7 @@ default_tab_group="3" tab_group="2" name="right_part_holder" - min_width="230"> + min_width="207"> Date: Tue, 6 May 2014 17:21:18 +0300 Subject: MAINT-3977 FIXED Object does not display newly added contents if it was edited that session and you teleported to another region and back and then added new contents. --- indra/newview/llfloatertools.cpp | 3 +++ indra/newview/llpanelcontents.cpp | 7 +++++++ indra/newview/llpanelcontents.h | 1 + indra/newview/llpanelobjectinventory.cpp | 11 ++++++++--- indra/newview/llpanelobjectinventory.h | 1 + 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 802544089c..bbb95e0cc4 100755 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -888,6 +888,9 @@ void LLFloaterTools::onClose(bool app_quitting) // hide the advanced object weights floater LLFloaterReg::hideInstance("object_weights"); + + // prepare content for next call + mPanelContents->clearContents(); } void click_popup_info(void*) diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 1a427338e5..5be796ea7a 100755 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -141,6 +141,13 @@ void LLPanelContents::refresh() } } +void LLPanelContents::clearContents() +{ + if (mPanelInventoryObject) + { + mPanelInventoryObject->clearInventoryTask(); + } +} // diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h index 62ccb64a4c..cf2c3af2a9 100755 --- a/indra/newview/llpanelcontents.h +++ b/indra/newview/llpanelcontents.h @@ -49,6 +49,7 @@ public: virtual ~LLPanelContents(); void refresh(); + void clearContents(); static void onClickNewScript(void*); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 6c9616511f..95472874ec 100755 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1862,14 +1862,19 @@ void LLPanelObjectInventory::refresh() } if(!has_inventory) { - mTaskUUID = LLUUID::null; - removeVOInventoryListener(); - clearContents(); + clearInventoryTask(); } mInventoryViewModel.setTaskID(mTaskUUID); //llinfos << "LLPanelObjectInventory::refresh() " << mTaskUUID << llendl; } +void LLPanelObjectInventory::clearInventoryTask() +{ + mTaskUUID = LLUUID::null; + removeVOInventoryListener(); + clearContents(); +} + void LLPanelObjectInventory::removeSelectedItem() { if(mFolders) diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h index 9559f7e886..3de49242ac 100755 --- a/indra/newview/llpanelobjectinventory.h +++ b/indra/newview/llpanelobjectinventory.h @@ -62,6 +62,7 @@ public: void refresh(); const LLUUID& getTaskUUID() { return mTaskUUID;} + void clearInventoryTask(); void removeSelectedItem(); void startRenamingSelectedItem(); -- cgit v1.2.3 From 80a134ffcc68b277c10cc79dc9c7ca073148b41e Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 7 May 2014 19:12:41 +0300 Subject: MAINT-3977 fixing line endings in llpanelcontents.cpp --- indra/newview/llpanelcontents.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 5be796ea7a..13ab7d7f27 100755 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -141,12 +141,12 @@ void LLPanelContents::refresh() } } -void LLPanelContents::clearContents() -{ - if (mPanelInventoryObject) - { - mPanelInventoryObject->clearInventoryTask(); - } +void LLPanelContents::clearContents() +{ + if (mPanelInventoryObject) + { + mPanelInventoryObject->clearInventoryTask(); + } } -- cgit v1.2.3 From 794523d81d1ae6d83848dc4e2e4076c51bd66598 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Thu, 8 May 2014 19:20:20 +0300 Subject: MAINT-3981 FIXED [SECURITY] Notecard being passed around that crashes any V3 based viewer when opened --- indra/newview/llviewertexteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 69f9bbdff8..81a1d26e5e 100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -179,7 +179,7 @@ public: /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { - if (num_chars == 0) + if (num_chars == 0 || !mImage) { width = 0; height = 0; -- cgit v1.2.3 From 06f5690100f8cd8aef01383adf0090a17ec4e515 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Fri, 9 May 2014 05:14:02 +0300 Subject: Backed out changeset: d351efc87829 --- indra/newview/llviewertexteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 81a1d26e5e..69f9bbdff8 100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -179,7 +179,7 @@ public: /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { - if (num_chars == 0 || !mImage) + if (num_chars == 0) { width = 0; height = 0; -- cgit v1.2.3 From bcf4e288731f79f2c61aaa958189083c1d89011d Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Fri, 9 May 2014 05:15:54 +0300 Subject: MAINT-3981 FIXED [SECURITY] Notecard being passed around that crashes any V3 based viewer when opened. Correct fix after testing. --- indra/newview/llviewertexteditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 69f9bbdff8..0c4f55d704 100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -542,8 +542,8 @@ LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const case LLAssetType::AT_BODYPART: img_name = "Inv_Skin"; break; case LLAssetType::AT_ANIMATION: img_name = "Inv_Animation"; break; case LLAssetType::AT_GESTURE: img_name = "Inv_Gesture"; break; - case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break; - default: llassert(0); + case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break; + default: img_name = "Inv_Invalid"; break; // use the Inv_Invalid icon for undefined object types (see MAINT-3981) } return LLUI::getUIImage(img_name); -- cgit v1.2.3 From ccb91c6da4078ce5d977203f297b0197983a543e Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 12 May 2014 11:52:39 +0300 Subject: MAINT-3963 FIXED The behavior of speak button in the conversations HUB and toolbar button is consistent now. Use setUserPTTState(false) to switch off the mic. --- indra/newview/llfloaterimcontainer.cpp | 15 ++++++++++++--- indra/newview/llfloaterimcontainer.h | 3 ++- indra/newview/llvoicechannel.cpp | 6 +++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index a0df37b309..a4b91e47bb 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -229,7 +229,9 @@ BOOL LLFloaterIMContainer::postBuild() mStubCollapseBtn = getChild("stub_collapse_btn"); mStubCollapseBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onStubCollapseButtonClicked, this)); mSpeakBtn = getChild("speak_btn"); - mSpeakBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonClicked, this)); + + mSpeakBtn->setMouseDownCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonPressed, this)); + mSpeakBtn->setMouseUpCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonReleased, this)); childSetAction("add_btn", boost::bind(&LLFloaterIMContainer::onAddButtonClicked, this)); @@ -352,11 +354,18 @@ void LLFloaterIMContainer::onStubCollapseButtonClicked() collapseMessagesPane(true); } -void LLFloaterIMContainer::onSpeakButtonClicked() +void LLFloaterIMContainer::onSpeakButtonPressed() +{ + LLVoiceClient::getInstance()->inputUserControlState(true); + updateSpeakBtnState(); +} + +void LLFloaterIMContainer::onSpeakButtonReleased() { - LLAgent::toggleMicrophone("speak"); + LLVoiceClient::getInstance()->inputUserControlState(false); updateSpeakBtnState(); } + void LLFloaterIMContainer::onExpandCollapseButtonClicked() { if (mConversationsPane->isCollapsed() && mMessagesPane->isCollapsed() diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index f6d973b9b3..a3e10dc236 100755 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -135,7 +135,8 @@ private: void onExpandCollapseButtonClicked(); void onStubCollapseButtonClicked(); void processParticipantsStyleUpdate(); - void onSpeakButtonClicked(); + void onSpeakButtonPressed(); + void onSpeakButtonReleased(); /*virtual*/ void onClickCloseBtn(bool app_quitting = false); /*virtual*/ void closeHostedFloater(); diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 312842a70f..48d056b358 100755 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -273,14 +273,14 @@ void LLVoiceChannel::deactivate() if (callStarted()) { setState(STATE_HUNG_UP); - + //Default mic is OFF when leaving voice calls - if (gSavedSettings.getBOOL("AutoDisengageMic") && + if (gSavedSettings.getBOOL("AutoDisengageMic") && sCurrentVoiceChannel == this && LLVoiceClient::getInstance()->getUserPTTState()) { gSavedSettings.setBOOL("PTTCurrentlyEnabled", true); - LLVoiceClient::getInstance()->inputUserControlState(true); + LLVoiceClient::getInstance()->setUserPTTState(false); } } LLVoiceClient::getInstance()->removeObserver(this); -- cgit v1.2.3 From d2efc4ef39b9e1994afa5c3e84a5785969c9e7e8 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 13 May 2014 11:27:06 +0300 Subject: MAINT-4013 FIXED Debug setting which allows leaving Mouselook mode via S or Down Arrow keys was added. By default it's disabled. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llviewerkeyboard.cpp | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4bbd48facf..c2555efbb5 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14246,6 +14246,17 @@ Value 0 + LeaveMouselook + + Comment + Exit Mouselook mode via S or Down Arrow keys while sitting + Persist + 1 + Type + Boolean + Value + 0 + TextureLoggingThreshold Comment diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 160478788c..b0f4802e20 100755 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -162,7 +162,7 @@ void agent_push_backward( EKeystate s ) { camera_move_backward(s); } - else if (!gAgent.backwardGrabbed() && gAgentAvatarp->isSitting()) + else if (!gAgent.backwardGrabbed() && gAgentAvatarp->isSitting() && gSavedSettings.getBOOL("LeaveMouselook")) { gAgentCamera.changeCameraToThirdPerson(); } -- cgit v1.2.3 From 7fb4b417ce2048305eab6f1dbf51276697a94ff1 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 13 May 2014 12:37:26 +0300 Subject: MAINT-3942 FIXED missing entry on statistics floater. --- indra/newview/skins/default/xui/en/floater_stats.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index bee570d5d0..c9a6e1c9c3 100755 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -267,7 +267,9 @@ stat="simsimskippedsilhouettesteps" unit_label="/sec"/> Date: Mon, 12 May 2014 20:01:20 +0300 Subject: MAINT-1734 FIXED Avatar chooser panel is empty the session after an avatar is chosen. --- indra/newview/llfloateravatar.cpp | 8 ++++++++ indra/newview/llmediactrl.cpp | 10 ++++++++++ indra/newview/llmediactrl.h | 1 + 3 files changed, 19 insertions(+) diff --git a/indra/newview/llfloateravatar.cpp b/indra/newview/llfloateravatar.cpp index bdc5b581a9..31adf5b61e 100755 --- a/indra/newview/llfloateravatar.cpp +++ b/indra/newview/llfloateravatar.cpp @@ -34,6 +34,7 @@ #include "llfloateravatar.h" #include "lluictrlfactory.h" +#include "llmediactrl.h" LLFloaterAvatar::LLFloaterAvatar(const LLSD& key) @@ -43,6 +44,13 @@ LLFloaterAvatar::LLFloaterAvatar(const LLSD& key) LLFloaterAvatar::~LLFloaterAvatar() { + LLMediaCtrl* avatar_picker = findChild("avatar_picker_contents"); + if (avatar_picker) + { + avatar_picker->navigateStop(); + avatar_picker->clearCache(); //images are reloading each time already + avatar_picker->unloadMediaSource(); + } } BOOL LLFloaterAvatar::postBuild() diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 323445afa6..5490605c1b 100755 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -502,6 +502,16 @@ void LLMediaCtrl::navigateForward() } } +//////////////////////////////////////////////////////////////////////////////// +// +void LLMediaCtrl::navigateStop() +{ + if (mMediaSource && mMediaSource->hasMedia()) + { + mMediaSource->getMediaPlugin()->browse_stop(); + } +} + //////////////////////////////////////////////////////////////////////////////// // bool LLMediaCtrl::canNavigateBack() diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 5978a7a344..086b384a72 100755 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -99,6 +99,7 @@ public: void navigateBack(); void navigateHome(); void navigateForward(); + void navigateStop(); void navigateToLocalPage( const std::string& subdir, const std::string& filename_in ); bool canNavigateBack(); bool canNavigateForward(); -- cgit v1.2.3 From 8b86130f25a780b7dc623c6f7ff7a9cb6cf22ea1 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 7 May 2014 18:42:24 +0300 Subject: MAINT-3967 FIXED Up arrow key does not move the cursor up in chat field. --- indra/llui/lltextbase.cpp | 29 +++++++++++++++++++---- indra/llui/lltextbase.h | 1 + indra/llui/lltexteditor.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 79 insertions(+), 7 deletions(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 62edbadb07..183d6481c3 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -225,7 +225,8 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mParseHighlights(p.parse_highlights), mBGVisible(p.bg_visible), mScroller(NULL), - mStyleDirty(true) + mStyleDirty(true), + mDrawRightmostCursor(false) { if(p.allow_scroll) { @@ -1510,6 +1511,11 @@ void LLTextBase::reflow() // find and erase line info structs starting at start_index and going to end of document if (!mLineInfoList.empty()) { + if (mDrawRightmostCursor) + { + start_index--; + } + // find first element whose end comes after start_index line_list_t::iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), start_index, line_end_compare()); line_start_index = iter->mDocIndexStart; @@ -1698,6 +1704,11 @@ S32 LLTextBase::getLineNumFromDocIndex( S32 doc_index, bool include_wordwrap) co } else { + if (mDrawRightmostCursor) + { + doc_index--; + } + line_list_t::const_iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), doc_index, line_end_compare()); if (include_wordwrap) { @@ -1726,6 +1737,11 @@ S32 LLTextBase::getLineOffsetFromDocIndex( S32 startpos, bool include_wordwrap) } else { + if (mDrawRightmostCursor) + { + startpos--; + } + line_list_t::const_iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), startpos, line_end_compare()); return startpos - iter->mDocIndexStart; } @@ -2445,7 +2461,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round, } else if (hit_past_end_of_line && segmentp->getEnd() >= line_iter->mDocIndexEnd) { - if (getLineNumFromDocIndex(line_iter->mDocIndexEnd - 1) == line_iter->mLineNum) + if (getLineNumFromDocIndex(line_iter->mDocIndexEnd - 1) == line_iter->mLineNum && !mDrawRightmostCursor) { // if segment wraps to the next line we should step one char back // to compensate for the space char between words @@ -2478,8 +2494,13 @@ LLRect LLTextBase::getDocRectFromDocIndex(S32 pos) const // clamp pos to valid values pos = llclamp(pos, 0, mLineInfoList.back().mDocIndexEnd - 1); - // find line that contains cursor - line_list_t::const_iterator line_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), pos, line_end_compare()); + S32 corrected_pos = pos; + if (mDrawRightmostCursor && pos > 0) + { + corrected_pos--; + } + + line_list_t::const_iterator line_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), corrected_pos, line_end_compare()); doc_rect.mLeft = line_iter->mRect.mLeft; doc_rect.mBottom = line_iter->mRect.mBottom; diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index d1f66b6cfe..51ab81bf29 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -606,6 +606,7 @@ protected: // cursor S32 mCursorPos; // I-beam is just after the mCursorPos-th character. + bool mDrawRightmostCursor; // When cursor is on the rightmost position on the line S32 mDesiredXPixel; // X pixel position where the user wants the cursor to be LLFrameTimer mCursorBlinkTimer; // timer that controls cursor blinking diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index fbd742f615..6bb13516bf 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1135,8 +1135,14 @@ void LLTextEditor::addChar(llwchar wc) setCursorPos(new_cursor_pos); } } -} + if (mCursorPos > 0) + { + LLRect current_cursor_rect = getDocRectFromDocIndex(mCursorPos); + LLRect prev_cursor_rect = getDocRectFromDocIndex(mCursorPos - 1); + mDrawRightmostCursor = current_cursor_rect.mBottom < prev_cursor_rect.mBottom; + } +} void LLTextEditor::addLineBreakChar(BOOL group_together) { @@ -1282,6 +1288,12 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) break; case KEY_HOME: + if(mDrawRightmostCursor && mCursorPos > 0) + { + mCursorPos--; + mDrawRightmostCursor = false; + } + startOfLine(); break; @@ -1296,6 +1308,14 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) case KEY_END: endOfLine(); + if (!mDrawRightmostCursor) + { + mDrawRightmostCursor = true; + if (mCursorPos + 1 < getLength()) + { + setCursorPos(mCursorPos + 1); + } + } break; case KEY_LEFT: @@ -1307,7 +1327,18 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) { if( 0 < mCursorPos ) { - setCursorPos(mCursorPos - 1); + LLRect current_cursor_rect = getDocRectFromDocIndex(mCursorPos); + LLRect next_cursor_rect = getDocRectFromDocIndex(mCursorPos - 1); + + if (current_cursor_rect.mBottom < next_cursor_rect.mBottom) + { + mDrawRightmostCursor = true; + } + else + { + mDrawRightmostCursor = false; + setCursorPos(mCursorPos - 1); + } } else { @@ -1325,7 +1356,26 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) { if( mCursorPos < getLength() ) { - setCursorPos(mCursorPos + 1); + LLRect current_cursor_rect = getDocRectFromDocIndex(mCursorPos); + LLRect next_cursor_rect = getDocRectFromDocIndex(mCursorPos + 1); + + if (current_cursor_rect.mBottom > next_cursor_rect.mBottom) + { + if (mDrawRightmostCursor) + { + mDrawRightmostCursor = false; + } + else + { + mDrawRightmostCursor = true; + setCursorPos(mCursorPos + 1); + } + } + else + { + mDrawRightmostCursor = false; + setCursorPos(mCursorPos + 1); + } } else { -- cgit v1.2.3 From ce27987c872cdaf2ec781644bc2ceb1a336a0a25 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 12 May 2014 16:25:48 -0400 Subject: STORM-2030 Rapidly clicking the refresh button in selected floaters may result in duplicate entries --- .../quicktime/media_plugin_quicktime.cpp | 28 +++++++++++----------- indra/newview/llfloaterland.cpp | 7 +++++- indra/newview/llfloaterregioninfo.cpp | 21 ++++++++++++++++ indra/newview/llfloaterregioninfo.h | 2 ++ indra/newview/llfloatertopobjects.cpp | 20 ++++++++++++++++ indra/newview/llfloatertopobjects.h | 1 + 6 files changed, 64 insertions(+), 15 deletions(-) diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index 93d2a8fa6e..ff1ed8bfbc 100755 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp @@ -28,26 +28,26 @@ #include "linden_common.h" -#if defined(LL_DARWIN) - #include -#elif defined(LL_WINDOWS) - #include "llwin32headers.h" - #include "MacTypes.h" - #include "QTML.h" - #include "Movies.h" - #include "QDoffscreen.h" - #include "FixMath.h" - #include "QTLoadLibraryUtils.h" -#endif - #include "llgl.h" - + #include "llplugininstance.h" #include "llpluginmessage.h" #include "llpluginmessageclasses.h" #include "media_plugin_base.h" - + #if LL_QUICKTIME_ENABLED + +#if defined(LL_DARWIN) +#include +#elif defined(LL_WINDOWS) +#include "llwin32headers.h" +#include "MacTypes.h" +#include "QTML.h" +#include "Movies.h" +#include "QDoffscreen.h" +#include "FixMath.h" +#include "QTLoadLibraryUtils.h" +#endif diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index e30bff1edf..79d8424e1a 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1517,6 +1517,8 @@ void LLPanelLandObjects::onClickRefresh(void* userdata) LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (!region) return; + self->mBtnRefresh->setEnabled(false); + // ready the list for results self->mOwnerList->deleteAllItems(); self->mOwnerList->setCommentText(LLTrans::getString("Searching")); @@ -1576,6 +1578,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo { msg->getU32("DataExtended", "TimeStamp", most_recent_time, i); } + if (owner_id.isNull()) { continue; @@ -1611,10 +1614,10 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo item_params.columns.add().value(LLDate((time_t)most_recent_time)).font(FONT).column("mostrecent").type("date"); self->mOwnerList->addNameItemRow(item_params); - LL_DEBUGS() << "object owner " << owner_id << " (" << (is_group_owned ? "group" : "agent") << ") owns " << object_count << " objects." << LL_ENDL; } + // check for no results if (0 == self->mOwnerList->getItemCount()) { @@ -1624,6 +1627,8 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo { self->mOwnerList->setEnabled(TRUE); } + + self->mBtnRefresh->setEnabled(true); } // static diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 8d1114e056..ab3136d0c3 100755 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -480,6 +480,17 @@ void LLFloaterRegionInfo::refresh() } } +void LLFloaterRegionInfo::enableTopButtons() +{ + getChildView("top_colliders_btn")->setEnabled(true); + getChildView("top_scripts_btn")->setEnabled(true); +} + +void LLFloaterRegionInfo::disableTopButtons() +{ + getChildView("top_colliders_btn")->setEnabled(false); + getChildView("top_scripts_btn")->setEnabled(false); +} ///---------------------------------------------------------------------------- /// Local class implementation @@ -1028,6 +1039,11 @@ void LLPanelRegionDebugInfo::onClickTopColliders(void* data) if(!instance) return; LLFloaterReg::showInstance("top_objects"); instance->clearList(); + instance->disableRefreshBtn(); + + self->getChildView("top_colliders_btn")->setEnabled(false); + self->getChildView("top_scripts_btn")->setEnabled(false); + self->sendEstateOwnerMessage(gMessageSystem, "colliders", invoice, strings); } @@ -1042,6 +1058,11 @@ void LLPanelRegionDebugInfo::onClickTopScripts(void* data) if(!instance) return; LLFloaterReg::showInstance("top_objects"); instance->clearList(); + instance->disableRefreshBtn(); + + self->getChildView("top_colliders_btn")->setEnabled(false); + self->getChildView("top_scripts_btn")->setEnabled(false); + self->sendEstateOwnerMessage(gMessageSystem, "scripts", invoice, strings); } diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index dd961e21b2..58f421f602 100755 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -96,6 +96,8 @@ public: void requestRegionInfo(); void requestMeshRezInfo(); + void enableTopButtons(); + void disableTopButtons(); private: diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index 7530c72dd2..3a167cfc77 100755 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -50,6 +50,7 @@ #include "llviewerregion.h" #include "lluictrlfactory.h" #include "llviewerwindow.h" +#include "llfloaterregioninfo.h" //LLFloaterTopObjects* LLFloaterTopObjects::sInstance = NULL; @@ -268,6 +269,13 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) format.setArg("[COUNT]", llformat("%d", total_count)); getChild("title_text")->setValue(LLSD(format)); } + + LLFloaterRegionInfo* region_info_floater = LLFloaterReg::getTypedInstance("region_info"); + if(region_info_floater) + { + region_info_floater->enableTopButtons(); + } + getChildView("refresh_btn")->setEnabled(true); } void LLFloaterTopObjects::onCommitObjectsList() @@ -453,12 +461,24 @@ void LLFloaterTopObjects::onRefresh() msg->addStringFast(_PREHASH_Filter, filter); msg->addS32Fast(_PREHASH_ParcelLocalID, 0); + LLFloaterRegionInfo* region_info_floater = LLFloaterReg::getTypedInstance("region_info"); + if(region_info_floater) + { + region_info_floater->disableTopButtons(); + } + disableRefreshBtn(); + msg->sendReliable(gAgent.getRegionHost()); mFilter.clear(); mFlags = 0; } +void LLFloaterTopObjects::disableRefreshBtn() +{ + getChildView("refresh_btn")->setEnabled(false); +} + void LLFloaterTopObjects::onGetByObjectName() { mFlags = STAT_FILTER_BY_OBJECT; diff --git a/indra/newview/llfloatertopobjects.h b/indra/newview/llfloatertopobjects.h index 28d2aa58e2..dbbe9ac521 100755 --- a/indra/newview/llfloatertopobjects.h +++ b/indra/newview/llfloatertopobjects.h @@ -66,6 +66,7 @@ public: void onRefresh(); static void setMode(U32 mode); + void disableRefreshBtn(); private: LLFloaterTopObjects(const LLSD& key); -- cgit v1.2.3 From 3b95bffeddc200e42d7f2b31e5df53a88b81b925 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 12 May 2014 16:55:17 -0400 Subject: STORM-2030 Forgot to add entry to contributions.txt --- doc/contributions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index 89390d9977..19b1724e3f 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -691,6 +691,7 @@ Jonathan Yap STORM-1987 STORM-1986 STORM-1981 + STORM-2030 Kadah Coba STORM-1060 STORM-1843 -- cgit v1.2.3 From 4fffc8c8e458ed13993fd0d5bc07ff641cb56005 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 13 May 2014 12:30:29 -0400 Subject: STORM-2031 Display issues with Top colliders/Top scripts floater OPEN-217 Change to media_plugin_quicktime.cpp causes Windows compile to fail --- doc/contributions.txt | 1 + .../quicktime/media_plugin_quicktime.cpp | 28 +++++++++++----------- indra/newview/llfloatertopobjects.cpp | 4 +++- .../skins/default/xui/en/floater_top_objects.xml | 14 ++++++++++- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 89390d9977..37e89cb37a 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -691,6 +691,7 @@ Jonathan Yap STORM-1987 STORM-1986 STORM-1981 + STORM-2031 Kadah Coba STORM-1060 STORM-1843 diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index 93d2a8fa6e..ff1ed8bfbc 100755 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp @@ -28,26 +28,26 @@ #include "linden_common.h" -#if defined(LL_DARWIN) - #include -#elif defined(LL_WINDOWS) - #include "llwin32headers.h" - #include "MacTypes.h" - #include "QTML.h" - #include "Movies.h" - #include "QDoffscreen.h" - #include "FixMath.h" - #include "QTLoadLibraryUtils.h" -#endif - #include "llgl.h" - + #include "llplugininstance.h" #include "llpluginmessage.h" #include "llpluginmessageclasses.h" #include "media_plugin_base.h" - + #if LL_QUICKTIME_ENABLED + +#if defined(LL_DARWIN) +#include +#elif defined(LL_WINDOWS) +#include "llwin32headers.h" +#include "MacTypes.h" +#include "QTML.h" +#include "Movies.h" +#include "QDoffscreen.h" +#include "FixMath.h" +#include "QTLoadLibraryUtils.h" +#endif diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index 7530c72dd2..940fe3733c 100755 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -207,7 +207,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) columns[column_num++]["font"] = "SANSSERIF"; columns[column_num]["column"] = "location"; - columns[column_num]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z); + columns[column_num]["value"] = llformat("<%0.f, %0.f, %0.f>", location_x, location_y, location_z); columns[column_num++]["font"] = "SANSSERIF"; columns[column_num]["column"] = "parcel"; @@ -257,6 +257,8 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) format.setArg("[COUNT]", llformat("%d", total_count)); format.setArg("[TIME]", llformat("%0.3f", mtotalScore)); getChild("title_text")->setValue(LLSD(format)); + list->setColumnLabel("URLs", getString("URLs")); + list->setColumnLabel("memory", getString("memory")); } else { diff --git a/indra/newview/skins/default/xui/en/floater_top_objects.xml b/indra/newview/skins/default/xui/en/floater_top_objects.xml index 0b71177345..36ceddd305 100755 --- a/indra/newview/skins/default/xui/en/floater_top_objects.xml +++ b/indra/newview/skins/default/xui/en/floater_top_objects.xml @@ -38,6 +38,18 @@ name="none_descriptor"> None found. + + URLs + + + Memory (KB) + + + + + Date: Wed, 14 May 2014 13:22:30 +0300 Subject: MAINT-2873 FIXED Newline is added to the end of XUI tool tip. --- indra/newview/llviewerwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 4fae5c8e8e..5f4ad3081f 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3194,6 +3194,8 @@ void LLViewerWindow::updateUI() } append_xui_tooltip(tooltip_view, params); + params.styled_message.add().text("\n"); + screen_sticky_rect.intersectWith(tooltip_view->calcScreenRect()); params.sticky_rect = screen_sticky_rect; -- cgit v1.2.3 From b392a8b659a3cd219918b29b06000d43767a6c7a Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 15 May 2014 12:10:31 +0300 Subject: MAINT-4022 FIXED Use gSnapshotFloaterView to close snapshot floater, and then pass focus on to normal floater view. --- indra/newview/llviewermenufile.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 04697f3472..9880ebf2db 100755 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -476,8 +476,10 @@ class LLFileEnableCloseWindow : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = NULL != gFloaterView->getFrontmostClosableFloater(); - return new_value; + bool frontmost_fl_exists = (NULL != gFloaterView->getFrontmostClosableFloater()); + bool frontmost_snapshot_fl_exists = (NULL != gSnapshotFloaterView->getFrontmostClosableFloater()); + + return frontmost_fl_exists || frontmost_snapshot_fl_exists; } }; @@ -485,7 +487,21 @@ class LLFileCloseWindow : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloater::closeFrontmostFloater(); + bool frontmost_fl_exists = (NULL != gFloaterView->getFrontmostClosableFloater()); + LLFloater* snapshot_floater = gSnapshotFloaterView->getFrontmostClosableFloater(); + + if(snapshot_floater && (!frontmost_fl_exists || snapshot_floater->hasFocus())) + { + snapshot_floater->closeFloater(); + if (gFocusMgr.getKeyboardFocus() == NULL) + { + gFloaterView->focusFrontFloater(); + } + } + else + { + LLFloater::closeFrontmostFloater(); + } return true; } }; -- cgit v1.2.3 From 50a3aa837a1a5a755f49f96bc0d068d382f6d370 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 15 May 2014 16:25:13 +0300 Subject: MAINT-145 FIXED Can not use ctrl+shift+b to close my Grid Option XUI --- indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index ec20c25f14..b1c1b236f0 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1207,7 +1207,7 @@ name="Grid Options" shortcut="control|shift|B"> -- cgit v1.2.3 From 704246c30f79a45535c43893422d990db141f541 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 15 May 2014 16:26:58 -0700 Subject: MAINT-3440 FIX Viewer freezes and not responding after trying to open 5 new media browsers tabs directed to yahoo.com link --- indra/newview/llfloaterwebcontent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index b8ea022810..640954a15f 100755 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -294,7 +294,7 @@ void LLFloaterWebContent::onOpen(const LLSD& key) void LLFloaterWebContent::onClose(bool app_quitting) { // If we close the web browsing window showing the facebook login, we need to signal to this object that the connection will not happen - LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web"); + LLFloater* fbc_web = LLFloaterReg::findInstance("fbc_web"); if (fbc_web == this) { if (!LLFacebookConnect::instance().isConnected()) -- cgit v1.2.3 From 1c82f376c2368f8f91627b3a45b2d6900d938ff4 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Fri, 16 May 2014 19:58:05 +0300 Subject: MAINT-4032 FIXED Sounds played locally play from avatar position, not camera position. --- indra/newview/llpreviewsound.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index 11b81a58fc..105c5e8cbe 100755 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -95,7 +95,6 @@ void LLPreviewSound::auditionSound( void *userdata ) if(item && gAudiop) { - LLVector3d lpos_global = gAgent.getPositionGlobal(); - gAudiop->triggerSound(item->getAssetUUID(), gAgent.getID(), SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_SFX, lpos_global); + gAudiop->triggerSound(item->getAssetUUID(), gAgent.getID(), SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_SFX); } } -- cgit v1.2.3 From 16a5c9346d04f20c536e9034947873f1202eb32e Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 20 May 2014 11:34:24 +0300 Subject: MAINT-3064 FIXED Select next session in the list if selected session is nearby chat and it's not the only one. --- indra/newview/llviewermenu.cpp | 23 ++++++++++++++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 12 ++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1daa85176a..aef8bc21ec 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -64,6 +64,7 @@ #include "llfloaterinventory.h" #include "llfloaterimcontainer.h" #include "llfloaterland.h" +#include "llfloaterimnearbychat.h" #include "llfloaterpathfindingcharacters.h" #include "llfloaterpathfindinglinksets.h" #include "llfloaterpay.h" @@ -5660,6 +5661,25 @@ void toggle_debug_menus(void*) // gExportDialog = LLUploadDialog::modalUploadDialog("Exporting selected objects..."); // } // + +class LLCommunicateNearbyChat : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloaterIMContainer* im_box = LLFloaterIMContainer::getInstance(); + bool nearby_visible = LLFloaterReg::getTypedInstance("nearby_chat")->isInVisibleChain(); + if(nearby_visible && im_box->getSelectedSession() == LLUUID() && im_box->getConversationListItemSize() > 1) + { + im_box->selectNextorPreviousConversation(false); + } + else + { + LLFloaterReg::toggleInstanceOrBringToFront("nearby_chat"); + } + return true; + } +}; + class LLWorldSetHomeLocation : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8577,6 +8597,9 @@ void initialize_menus() // Me > Movement view_listener_t::addMenu(new LLAdvancedAgentFlyingInfo(), "Agent.getFlying"); + //Communicate Nearby chat + view_listener_t::addMenu(new LLCommunicateNearbyChat(), "Communicate.NearbyChat"); + // Communicate > Voice morphing > Subscribe... commit.add("Communicate.VoiceMorphing.Subscribe", boost::bind(&handle_voice_morphing_subscribe)); LLVivoxVoiceClient * voice_clientp = LLVivoxVoiceClient::getInstance(); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index b1c1b236f0..acec017622 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -259,8 +259,7 @@ function="Floater.Visible" parameter="nearby_chat" /> + function="Communicate.NearbyChat"/> - - + - + Date: Tue, 20 May 2014 14:07:23 -0700 Subject: MAINT-3950 FIXED can't open lag meter brought back llfloaterlagmeter from the dead, and ported to lltrace --- indra/newview/CMakeLists.txt | 2 + indra/newview/llfloaterlagmeter.cpp | 378 +++++++++++++++++++++ indra/newview/llfloaterlagmeter.h | 80 +++++ indra/newview/lltextureview.cpp | 2 +- indra/newview/llviewerfloaterreg.cpp | 2 + indra/newview/llviewertexture.cpp | 12 +- indra/newview/llviewertexture.h | 2 +- .../skins/default/xui/da/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/de/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/en/floater_lagmeter.xml | 336 ++++++++++++++++++ .../skins/default/xui/es/floater_lagmeter.xml | 154 +++++++++ .../skins/default/xui/fr/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/it/floater_lagmeter.xml | 154 +++++++++ .../skins/default/xui/ja/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/pl/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/pt/floater_lagmeter.xml | 154 +++++++++ .../skins/default/xui/ru/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/tr/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/zh/floater_lagmeter.xml | 151 ++++++++ 19 files changed, 2476 insertions(+), 8 deletions(-) create mode 100644 indra/newview/llfloaterlagmeter.cpp create mode 100644 indra/newview/llfloaterlagmeter.h create mode 100644 indra/newview/skins/default/xui/da/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/de/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/en/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/es/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/fr/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/it/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/ja/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/pt/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/ru/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/tr/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/zh/floater_lagmeter.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c94969435b..cf584048f9 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -245,6 +245,7 @@ set(viewer_SOURCE_FILES llfloaterinspect.cpp llfloaterinventory.cpp llfloaterjoystick.cpp + llfloaterlagmeter.cpp llfloaterland.cpp llfloaterlandholdings.cpp llfloatermap.cpp @@ -839,6 +840,7 @@ set(viewer_HEADER_FILES llfloaterinspect.h llfloaterinventory.h llfloaterjoystick.h + llfloaterlagmeter.h llfloaterland.h llfloaterlandholdings.h llfloatermap.h diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp new file mode 100644 index 0000000000..f72f2631a1 --- /dev/null +++ b/indra/newview/llfloaterlagmeter.cpp @@ -0,0 +1,378 @@ +/** + * @file llfloaterlagmeter.cpp + * @brief The "Lag-o-Meter" floater used to tell users what is causing lag. + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterlagmeter.h" + +#include "lluictrlfactory.h" +#include "llviewerstats.h" +#include "llviewertexture.h" +#include "llviewercontrol.h" +#include "llappviewer.h" + +#include "lltexturefetch.h" + +#include "llbutton.h" +#include "llfocusmgr.h" +#include "lltextbox.h" + +const std::string LAG_CRITICAL_IMAGE_NAME = "lag_status_critical.tga"; +const std::string LAG_WARNING_IMAGE_NAME = "lag_status_warning.tga"; +const std::string LAG_GOOD_IMAGE_NAME = "lag_status_good.tga"; + +LLFloaterLagMeter::LLFloaterLagMeter(const LLSD& key) + : LLFloater(key) +{ + mCommitCallbackRegistrar.add("LagMeter.ClickShrink", boost::bind(&LLFloaterLagMeter::onClickShrink, this)); +} + +BOOL LLFloaterLagMeter::postBuild() +{ + // Don't let this window take keyboard focus -- it's confusing to + // lose arrow-key driving when testing lag. + setIsChrome(TRUE); + + // were we shrunk last time? + if (isShrunk()) + { + onClickShrink(); + } + + mClientButton = getChild("client_lagmeter"); + mClientText = getChild("client_text"); + mClientCause = getChild("client_lag_cause"); + + mNetworkButton = getChild("network_lagmeter"); + mNetworkText = getChild("network_text"); + mNetworkCause = getChild("network_lag_cause"); + + mServerButton = getChild("server_lagmeter"); + mServerText = getChild("server_text"); + mServerCause = getChild("server_lag_cause"); + + std::string config_string = getString("client_frame_rate_critical_fps", mStringArgs); + mClientFrameTimeCritical = F32Seconds(1.0f / (float)atof( config_string.c_str() )); + config_string = getString("client_frame_rate_warning_fps", mStringArgs); + mClientFrameTimeWarning = F32Seconds(1.0f / (float)atof( config_string.c_str() )); + + config_string = getString("network_packet_loss_critical_pct", mStringArgs); + mNetworkPacketLossCritical = F32Percent((float)atof( config_string.c_str() )); + config_string = getString("network_packet_loss_warning_pct", mStringArgs); + mNetworkPacketLossWarning = F32Percent((float)atof( config_string.c_str() )); + + config_string = getString("network_ping_critical_ms", mStringArgs); + mNetworkPingCritical = F32Milliseconds((float)atof( config_string.c_str() )); + config_string = getString("network_ping_warning_ms", mStringArgs); + mNetworkPingWarning = F32Milliseconds((float)atof( config_string.c_str() )); + config_string = getString("server_frame_rate_critical_fps", mStringArgs); + + mServerFrameTimeCritical = F32Seconds(1.0f / (float)atof( config_string.c_str() )); + config_string = getString("server_frame_rate_warning_fps", mStringArgs); + mServerFrameTimeWarning = F32Seconds(1.0f / (float)atof( config_string.c_str() )); + config_string = getString("server_single_process_max_time_ms", mStringArgs); + mServerSingleProcessMaxTime = F32Seconds((float)atof( config_string.c_str() )); + +// mShrunk = false; + config_string = getString("max_width_px", mStringArgs); + mMaxWidth = atoi( config_string.c_str() ); + config_string = getString("min_width_px", mStringArgs); + mMinWidth = atoi( config_string.c_str() ); + + mStringArgs["[CLIENT_FRAME_RATE_CRITICAL]"] = getString("client_frame_rate_critical_fps"); + mStringArgs["[CLIENT_FRAME_RATE_WARNING]"] = getString("client_frame_rate_warning_fps"); + + mStringArgs["[NETWORK_PACKET_LOSS_CRITICAL]"] = getString("network_packet_loss_critical_pct"); + mStringArgs["[NETWORK_PACKET_LOSS_WARNING]"] = getString("network_packet_loss_warning_pct"); + + mStringArgs["[NETWORK_PING_CRITICAL]"] = getString("network_ping_critical_ms"); + mStringArgs["[NETWORK_PING_WARNING]"] = getString("network_ping_warning_ms"); + + mStringArgs["[SERVER_FRAME_RATE_CRITICAL]"] = getString("server_frame_rate_critical_fps"); + mStringArgs["[SERVER_FRAME_RATE_WARNING]"] = getString("server_frame_rate_warning_fps"); + +// childSetAction("minimize", onClickShrink, this); + updateControls(isShrunk()); // if expanded append colon to the labels (EXT-4079) + + return TRUE; +} +LLFloaterLagMeter::~LLFloaterLagMeter() +{ + // save shrunk status for next time +// gSavedSettings.setBOOL("LagMeterShrunk", mShrunk); + // expand so we save the large window rectangle + if (isShrunk()) + { + onClickShrink(); + } +} + +void LLFloaterLagMeter::draw() +{ + determineClient(); + determineNetwork(); + determineServer(); + + LLFloater::draw(); +} + +void LLFloaterLagMeter::determineClient() +{ + F32Milliseconds client_frame_time = LLTrace::get_frame_recording().getPeriodMean(LLStatViewer::FRAME_STACKTIME); + bool find_cause = false; + + if (!gFocusMgr.getAppHasFocus()) + { + mClientButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME)); + mClientText->setText( getString("client_frame_time_window_bg_msg", mStringArgs) ); + mClientCause->setText( LLStringUtil::null ); + } + else if(client_frame_time >= mClientFrameTimeCritical) + { + mClientButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME)); + mClientText->setText( getString("client_frame_time_critical_msg", mStringArgs) ); + find_cause = true; + } + else if(client_frame_time >= mClientFrameTimeWarning) + { + mClientButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME)); + mClientText->setText( getString("client_frame_time_warning_msg", mStringArgs) ); + find_cause = true; + } + else + { + mClientButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME)); + mClientText->setText( getString("client_frame_time_normal_msg", mStringArgs) ); + mClientCause->setText( LLStringUtil::null ); + } + + if(find_cause) + { + if(gSavedSettings.getF32("RenderFarClip") > 128) + { + mClientCause->setText( getString("client_draw_distance_cause_msg", mStringArgs) ); + } + else if(LLAppViewer::instance()->getTextureFetch()->getNumRequests() > 2) + { + mClientCause->setText( getString("client_texture_loading_cause_msg", mStringArgs) ); + } + else if(LLViewerTexture::sBoundTextureMemory > LLViewerTexture::sMaxBoundTextureMemory) + { + mClientCause->setText( getString("client_texture_memory_cause_msg", mStringArgs) ); + } + else + { + mClientCause->setText( getString("client_complex_objects_cause_msg", mStringArgs) ); + } + } +} + +void LLFloaterLagMeter::determineNetwork() +{ + LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); + F32Percent packet_loss = frame_recording.getPeriodMean(LLStatViewer::PACKETS_LOST_PERCENT); + F32Milliseconds ping_time = frame_recording.getPeriodMean(LLStatViewer::SIM_PING); + bool find_cause_loss = false; + bool find_cause_ping = false; + + // *FIXME: We can't blame a large ping time on anything in + // particular if the frame rate is low, because a low frame + // rate is a sure recipe for bad ping times right now until + // the network handlers are de-synched from the rendering. + F32Milliseconds client_frame_time = frame_recording.getPeriodMean(LLStatViewer::FRAME_STACKTIME); + + if(packet_loss >= mNetworkPacketLossCritical) + { + mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME)); + mNetworkText->setText( getString("network_packet_loss_critical_msg", mStringArgs) ); + find_cause_loss = true; + } + else if(ping_time >= mNetworkPingCritical) + { + mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME)); + if (client_frame_time < mNetworkPingCritical) + { + mNetworkText->setText( getString("network_ping_critical_msg", mStringArgs) ); + find_cause_ping = true; + } + } + else if(packet_loss >= mNetworkPacketLossWarning) + { + mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME)); + mNetworkText->setText( getString("network_packet_loss_warning_msg", mStringArgs) ); + find_cause_loss = true; + } + else if(ping_time >= mNetworkPingWarning) + { + mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME)); + if (client_frame_time < mNetworkPingWarning) + { + mNetworkText->setText( getString("network_ping_warning_msg", mStringArgs) ); + find_cause_ping = true; + } + } + else + { + mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME)); + mNetworkText->setText( getString("network_performance_normal_msg", mStringArgs) ); + } + + if(find_cause_loss) + { + mNetworkCause->setText( getString("network_packet_loss_cause_msg", mStringArgs) ); + } + else if(find_cause_ping) + { + mNetworkCause->setText( getString("network_ping_cause_msg", mStringArgs) ); + } + else + { + mNetworkCause->setText( LLStringUtil::null ); + } +} + +void LLFloaterLagMeter::determineServer() +{ + F32Milliseconds sim_frame_time = LLTrace::get_frame_recording().getLastRecording().getLastValue(LLStatViewer::SIM_FRAME_TIME); + bool find_cause = false; + + if(sim_frame_time >= mServerFrameTimeCritical) + { + mServerButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME)); + mServerText->setText( getString("server_frame_time_critical_msg", mStringArgs) ); + find_cause = true; + } + else if(sim_frame_time >= mServerFrameTimeWarning) + { + mServerButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME)); + mServerText->setText( getString("server_frame_time_warning_msg", mStringArgs) ); + find_cause = true; + } + else + { + mServerButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME)); + mServerText->setText( getString("server_frame_time_normal_msg", mStringArgs) ); + mServerCause->setText( LLStringUtil::null ); + } + + if(find_cause) + { + LLTrace::Recording& last_recording = LLTrace::get_frame_recording().getLastRecording(); + + if(last_recording.getLastValue(LLStatViewer::SIM_PHYSICS_TIME) > mServerSingleProcessMaxTime) + { + mServerCause->setText( getString("server_physics_cause_msg", mStringArgs) ); + } + else if(last_recording.getLastValue(LLStatViewer::SIM_SCRIPTS_TIME) > mServerSingleProcessMaxTime) + { + mServerCause->setText( getString("server_scripts_cause_msg", mStringArgs) ); + } + else if(last_recording.getLastValue(LLStatViewer::SIM_NET_TIME) > mServerSingleProcessMaxTime) + { + mServerCause->setText( getString("server_net_cause_msg", mStringArgs) ); + } + else if(last_recording.getLastValue(LLStatViewer::SIM_AGENTS_TIME) > mServerSingleProcessMaxTime) + { + mServerCause->setText( getString("server_agent_cause_msg", mStringArgs) ); + } + else if(last_recording.getLastValue(LLStatViewer::SIM_IMAGES_TIME) > mServerSingleProcessMaxTime) + { + mServerCause->setText( getString("server_images_cause_msg", mStringArgs) ); + } + else + { + mServerCause->setText( getString("server_generic_cause_msg", mStringArgs) ); + } + } +} + +void LLFloaterLagMeter::updateControls(bool shrink) +{ +// LLFloaterLagMeter * self = (LLFloaterLagMeter*)data; + + LLButton * button = getChild("minimize"); + S32 delta_width = mMaxWidth -mMinWidth; + LLRect r = getRect(); + + if(!shrink) + { + setTitle(getString("max_title_msg", mStringArgs) ); + // make left edge appear to expand + r.translate(-delta_width, 0); + setRect(r); + reshape(mMaxWidth, getRect().getHeight()); + + getChild("client")->setValue(getString("client_text_msg", mStringArgs) + ":"); + getChild("network")->setValue(getString("network_text_msg",mStringArgs) + ":"); + getChild("server")->setValue(getString("server_text_msg", mStringArgs) + ":"); + + // usually "<<" + button->setLabel( getString("smaller_label", mStringArgs) ); + } + else + { + setTitle( getString("min_title_msg", mStringArgs) ); + // make left edge appear to collapse + r.translate(delta_width, 0); + setRect(r); + reshape(mMinWidth, getRect().getHeight()); + + getChild("client")->setValue(getString("client_text_msg", mStringArgs) ); + getChild("network")->setValue(getString("network_text_msg",mStringArgs) ); + getChild("server")->setValue(getString("server_text_msg", mStringArgs) ); + + // usually ">>" + button->setLabel( getString("bigger_label", mStringArgs) ); + } + // Don't put keyboard focus on the button + button->setFocus(FALSE); + +// self->mClientText->setVisible(self->mShrunk); +// self->mClientCause->setVisible(self->mShrunk); +// self->getChildView("client_help")->setVisible( self->mShrunk); + +// self->mNetworkText->setVisible(self->mShrunk); +// self->mNetworkCause->setVisible(self->mShrunk); +// self->getChildView("network_help")->setVisible( self->mShrunk); + +// self->mServerText->setVisible(self->mShrunk); +// self->mServerCause->setVisible(self->mShrunk); +// self->getChildView("server_help")->setVisible( self->mShrunk); + +// self->mShrunk = !self->mShrunk; +} + +BOOL LLFloaterLagMeter::isShrunk() +{ + return gSavedSettings.getBOOL("LagMeterShrunk"); +} + +void LLFloaterLagMeter::onClickShrink() // toggle "LagMeterShrunk" +{ + bool shrunk = isShrunk(); + updateControls(!shrunk); + gSavedSettings.setBOOL("LagMeterShrunk", !shrunk); +} diff --git a/indra/newview/llfloaterlagmeter.h b/indra/newview/llfloaterlagmeter.h new file mode 100644 index 0000000000..929ea40629 --- /dev/null +++ b/indra/newview/llfloaterlagmeter.h @@ -0,0 +1,80 @@ +/** + * @file llfloaterlagmeter.h + * @brief The "Lag-o-Meter" floater used to tell users what is causing lag. + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LLFLOATERLAGMETER_H +#define LLFLOATERLAGMETER_H + +#include "llfloater.h" + +class LLTextBox; + +class LLFloaterLagMeter : public LLFloater +{ + friend class LLFloaterReg; + +public: + /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild(); +private: + + LLFloaterLagMeter(const LLSD& key); + /*virtual*/ ~LLFloaterLagMeter(); + void determineClient(); + void determineNetwork(); + void determineServer(); + void updateControls(bool shrink); + BOOL isShrunk(); + + void onClickShrink(); + + bool mShrunk; + S32 mMaxWidth, mMinWidth; + + F32Milliseconds mClientFrameTimeCritical; + F32Milliseconds mClientFrameTimeWarning; + LLButton* mClientButton; + LLTextBox* mClientText; + LLTextBox* mClientCause; + + F32Percent mNetworkPacketLossCritical; + F32Percent mNetworkPacketLossWarning; + F32Milliseconds mNetworkPingCritical; + F32Milliseconds mNetworkPingWarning; + LLButton* mNetworkButton; + LLTextBox* mNetworkText; + LLTextBox* mNetworkCause; + + F32Milliseconds mServerFrameTimeCritical; + F32Milliseconds mServerFrameTimeWarning; + F32Milliseconds mServerSingleProcessMaxTime; + LLButton* mServerButton; + LLTextBox* mServerText; + LLTextBox* mServerCause; + + LLStringUtil::format_map_t mStringArgs; +}; + +#endif diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 8ee83b5df0..d464b57b4a 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -509,7 +509,7 @@ private: void LLGLTexMemBar::draw() { S32Megabytes bound_mem = LLViewerTexture::sBoundTextureMemory; - S32Megabytes max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; + S32Megabytes max_bound_mem = LLViewerTexture::sMaxBoundTextureMemory; S32Megabytes total_mem = LLViewerTexture::sTotalTextureMemory; S32Megabytes max_total_mem = LLViewerTexture::sMaxTotalTextureMem; F32 discard_bias = LLViewerTexture::sDesiredDiscardBias; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index e427bb1735..55aeed68cc 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -73,6 +73,7 @@ #include "llfloaterinspect.h" #include "llfloaterinventory.h" #include "llfloaterjoystick.h" +#include "llfloaterlagmeter.h" #include "llfloaterland.h" #include "llfloaterlandholdings.h" #include "llfloatermap.h" @@ -233,6 +234,7 @@ void LLViewerFloaterReg::registerFloaters() LLNotificationsUI::registerFloater(); LLFloaterDisplayNameUtil::registerFloater(); + LLFloaterReg::add("lagmeter", "floater_lagmeter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("mem_leaking", "floater_mem_leaking.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 3be82a5531..b83697b2f1 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -88,7 +88,7 @@ F32 LLViewerTexture::sDesiredDiscardBias = 0.f; F32 LLViewerTexture::sDesiredDiscardScale = 1.1f; S32Bytes LLViewerTexture::sBoundTextureMemory; S32Bytes LLViewerTexture::sTotalTextureMemory; -S32Megabytes LLViewerTexture::sMaxBoundTextureMem; +S32Megabytes LLViewerTexture::sMaxBoundTextureMemory; S32Megabytes LLViewerTexture::sMaxTotalTextureMem; S32Bytes LLViewerTexture::sMaxDesiredTextureMem; S8 LLViewerTexture::sCameraMovingDiscardBias = 0; @@ -534,11 +534,11 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sBoundTextureMemory = LLImageGL::sBoundTextureMemory; sTotalTextureMemory = LLImageGL::sGlobalTextureMemory; - sMaxBoundTextureMem = gTextureList.getMaxResidentTexMem(); + sMaxBoundTextureMemory = gTextureList.getMaxResidentTexMem(); sMaxTotalTextureMem = gTextureList.getMaxTotalTextureMem(); sMaxDesiredTextureMem = sMaxTotalTextureMem; //in Bytes, by default and when total used texture memory is small. - if (sBoundTextureMemory >= sMaxBoundTextureMem || + if (sBoundTextureMemory >= sMaxBoundTextureMemory || sTotalTextureMemory >= sMaxTotalTextureMem) { //when texture memory overflows, lower down the threshold to release the textures more aggressively. @@ -558,7 +558,7 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sEvaluationTimer.reset(); } else if (sDesiredDiscardBias > 0.0f && - sBoundTextureMemory < sMaxBoundTextureMem * texmem_lower_bound_scale && + sBoundTextureMemory < sMaxBoundTextureMemory * texmem_lower_bound_scale && sTotalTextureMemory < sMaxTotalTextureMem * texmem_lower_bound_scale) { // If we are using less texture memory than we should, @@ -576,7 +576,7 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sCameraMovingBias = llmax(0.2f * camera_moving_speed, 2.0f * camera_angular_speed - 1); sCameraMovingDiscardBias = (S8)(sCameraMovingBias); - LLViewerTexture::sFreezeImageScalingDown = (sBoundTextureMemory < 0.75f * sMaxBoundTextureMem * texmem_middle_bound_scale) && + LLViewerTexture::sFreezeImageScalingDown = (sBoundTextureMemory < 0.75f * sMaxBoundTextureMemory * texmem_middle_bound_scale) && (sTotalTextureMemory < 0.75f * sMaxTotalTextureMem * texmem_middle_bound_scale); } @@ -2962,7 +2962,7 @@ void LLViewerLODTexture::processTextureStats() scaleDown(); } // Limit the amount of GL memory bound each frame - else if ( sBoundTextureMemory > sMaxBoundTextureMem * texmem_middle_bound_scale && + else if ( sBoundTextureMemory > sMaxBoundTextureMemory * texmem_middle_bound_scale && (!getBoundRecently() || mDesiredDiscardLevel >= mCachedRawDiscardLevel)) { scaleDown(); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b12b988513..302cc8302a 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -207,7 +207,7 @@ public: static F32 sDesiredDiscardScale; static S32Bytes sBoundTextureMemory; static S32Bytes sTotalTextureMemory; - static S32Megabytes sMaxBoundTextureMem; + static S32Megabytes sMaxBoundTextureMemory; static S32Megabytes sMaxTotalTextureMem; static S32Bytes sMaxDesiredTextureMem ; static S8 sCameraMovingDiscardBias; diff --git a/indra/newview/skins/default/xui/da/floater_lagmeter.xml b/indra/newview/skins/default/xui/da/floater_lagmeter.xml new file mode 100644 index 0000000000..149d174c34 --- /dev/null +++ b/indra/newview/skins/default/xui/da/floater_lagmeter.xml @@ -0,0 +1,151 @@ + + + + Lag måler + + + 360 + + + Lag + + + 90 + + + Klient + + + 10 + + + 15 + + + Normal, vindue i baggrund + + + Klients billeder/sek under [CLIENT_FRAME_RATE_CRITICAL] + + + Klients billeder/sek mellem [CLIENT_FRAME_RATE_CRITICAL] og [CLIENT_FRAME_RATE_WARNING] + + + Normal + + + Mulig årsag: 'Vis afstand' sat for højt i grafik indstillinger + + + Mulig årsag: Billeder hentes + + + Mulig årsag: For mange billeder i hukommelse + + + Mulig årsag: For mange komplekse objekter i scenariet + + + Netværk + + + 10 + + + 5 + + + Forbindelsen mister over [NETWORK_PACKET_LOSS_CRITICAL]% pakker + + + Forbindelsen mister [NETWORK_PACKET_LOSS_WARNING]%-[NETWORK_PACKET_LOSS_CRITICAL]% pakker + + + Normal + + + 600 + + + 300 + + + Forbindelsens ping tider er over [NETWORK_PING_CRITICAL] ms + + + Forbindelsens ping tider er [NETWORK_PING_WARNING]-[NETWORK_PING_CRITICAL] ms + + + Muligvis dårlig forbindelse eller 'båndbredde' sat for højt i netværksopsætning. + + + Muligvis dårlig forbindelse eller fil delings program. + + + Server + + + 20 + + + 30 + + + 20 + + + Simulator framerate er under [SERVER_FRAME_RATE_CRITICAL] + + + Simulator framerate er mellem [SERVER_FRAME_RATE_CRITICAL] og [SERVER_FRAME_RATE_WARNING] + + + Normal + + + Mulig årsag: For mange fysiske objekter + + + Mulig årsag: For mange objekter med script + + + Mulig årsag: For meget netværks trafik + + + Mulig årsag: For mange avatarer i bevægelse i regionen + + + Mulig årsag: For mange billed udregninger + + + Mulig årsag: Simulator belastning for stor + + + >> + + + << + + + diff --git a/indra/newview/skins/default/xui/es/floater_lagmeter.xml b/indra/newview/skins/default/xui/es/floater_lagmeter.xml new file mode 100644 index 0000000000..227689a194 --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_lagmeter.xml @@ -0,0 +1,154 @@ + + + + Medidor del lag + + + 360 + + + Lag + + + 90 + + + Cliente + + + 10 + + + 15 + + + Normal, ventana en segundo plano + + + Frames del cliente valorados por debajo de [CLIENT_FRAME_RATE_CRITICAL] + + + Frames del cliente valorados entre [CLIENT_FRAME_RATE_CRITICAL] y [CLIENT_FRAME_RATE_WARNING] + + + Normal + + + Posible causa: distancia de dibujo fijada muy alta + + + Posible causa: imágenes cargándose + + + Posible causa: demasiadas imágenes en la memoria + + + Posible causa: demasiados objetos complejos en la escena + + + Red + + + 10 + + + 5 + + + La conexión deja caer más del [NETWORK_PACKET_LOSS_CRITICAL]% de los paquetes + + + La conexión deja caer [NETWORK_PACKET_LOSS_WARNING]%-[NETWORK_PACKET_LOSS_CRITICAL]% de los paquetes + + + Normal + + + 600 + + + 300 + + + El tiempo de conexión -ping- supera los [NETWORK_PING_CRITICAL] ms + + + El tiempo de conexión -ping- es de [NETWORK_PING_WARNING]-[NETWORK_PING_CRITICAL] ms + + + Quizá una mala conexión o un ancho de banda fijado demasiado alto. + + + Quizá una mala conexión o una aplicación de archivos compartidos. + + + Servidor + + + 20 + + + 30 + + + 20 + + + Frecuencia (framerate) por debajo de [SERVER_FRAME_RATE_CRITICAL] + + + Frecuencia (framerate) entre [SERVER_FRAME_RATE_CRITICAL] y [SERVER_FRAME_RATE_WARNING] + + + Normal + + + Posible causa: demasiados objetos físicos + + + Posible causa: demasiados objetos con script + + + Posible causa: demasiado tráfico en la red + + + Posible causa: demasiada gente moviéndose en la región + + + Posible causa: demasiados cálculos de imáganes + + + Posible causa: carga del simulador muy pesada + + + >> + + + << + + -- cgit v1.2.3 From bc029b770c92f9443a30fee88d3b7a22b971b643 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Tue, 22 Jul 2014 19:38:55 +0300 Subject: MAINT-4036 [CHUIBUG]Long pause on first open of preferences or right-clicking a user in friend list: the changeset 009b02c29a52 has been reverted by request from Oz. --- doc/contributions.txt | 2 - indra/newview/llgiveinventory.cpp | 6 +-- indra/newview/lllogchat.cpp | 108 ++++++++++++++++++-------------------- indra/newview/lllogchat.h | 6 --- 4 files changed, 52 insertions(+), 70 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 240bce5719..7e8ab46b1a 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -185,7 +185,6 @@ Ansariel Hiller BUG-3764 STORM-1984 STORM-1979 - MAINT-4036 Aralara Rajal Arare Chantilly CHUIBUG-191 @@ -758,7 +757,6 @@ Kitty Barnett STORM-1905 VWR-24217 STORM-1804 - MAINT-4036 Kolor Fall Komiko Okamoto Korvel Noh diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index b2fc41526e..813d2081ce 100755 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -328,10 +328,8 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im { // Build a new format username or firstname_lastname for legacy names // to use it for a history log filename. - if (LLLogChat::buildIMP2PLogFilename(to_agent, LLStringUtil::null, full_name)) - { - LLIMModel::instance().logToFile(full_name, LLTrans::getString("SECOND_LIFE"), im_session_id, LLTrans::getString("inventory_item_offered-im")); - } + full_name = LLCacheName::buildUsername(full_name); + LLIMModel::instance().logToFile(full_name, LLTrans::getString("SECOND_LIFE"), im_session_id, LLTrans::getString("inventory_item_offered-im")); } } } diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 743bb8973b..06e517a861 100755 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -261,46 +261,6 @@ std::string LLLogChat::cleanFileName(std::string filename) return filename; } -bool LLLogChat::buildIMP2PLogFilename(const LLUUID& idAgent, const std::string& strName, std::string& strFilename) -{ - static LLCachedControl fLegacyFilenames(gSavedSettings, "UseLegacyIMLogNames", true); - - // If we have the name cached then we can simply return the username - LLAvatarName avName; - if (LLAvatarNameCache::get(idAgent, &avName)) - { - if (!fLegacyFilenames) - { - strFilename = avName.getUserName(); - } - else - { - strFilename = LLCacheName::cleanFullName(avName.getLegacyName()); - } - return true; - } - else - { - // Try and get it from the legacy cache if we can - std::string strLegacyName; - if (gCacheName->getFullName(idAgent, strLegacyName)) - strLegacyName = strName; - - if (!fLegacyFilenames) - { - // If we don't have it cached 'strName' *should* be a legacy name (or a complete name) and we can construct a username from that - strFilename = LLCacheName::buildUsername(strName); - return strName != strFilename; // If the assumption above was wrong then the two will match which signals failure - } - else - { - // Strip any possible mention of a username - strFilename = LLCacheName::buildLegacyName(strName); - return (!strFilename.empty()); // Assume success as long as the filename isn't an empty string - } - } -} - std::string LLLogChat::timestamp(bool withdate) { std::string timeStr; @@ -610,6 +570,13 @@ void LLLogChat::findTranscriptFiles(std::string pattern, std::vectoradd(dirname, filename)); + LLFile::close(filep); + continue; + } char buffer[LOG_RECALL_SIZE]; fseek(filep, 0, SEEK_END); // seek to end of file @@ -782,34 +749,59 @@ void LLLogChat::deleteTranscripts() // static bool LLLogChat::isTranscriptExist(const LLUUID& avatar_id, bool is_group) { - std::string strFileName; - if (!is_group) - buildIMP2PLogFilename(avatar_id, LLStringUtil::null, strFileName); - else - gCacheName->getGroupName(avatar_id, strFileName); + std::vector list_of_transcriptions; + LLLogChat::getListOfTranscriptFiles(list_of_transcriptions); - std::string strFilePath = makeLogFileName(strFileName); - if ( (!strFilePath.empty()) && (LLFile::isfile(strFilePath)) ) + if (list_of_transcriptions.size() > 0) { - return true; + LLAvatarName avatar_name; + LLAvatarNameCache::get(avatar_id, &avatar_name); + std::string avatar_user_name = avatar_name.getAccountName(); + if(!is_group) + { + std::replace(avatar_user_name.begin(), avatar_user_name.end(), '.', '_'); + BOOST_FOREACH(std::string& transcript_file_name, list_of_transcriptions) + { + if (std::string::npos != transcript_file_name.find(avatar_user_name)) + { + return true; + } + } + } + else + { + std::string file_name; + gCacheName->getGroupName(avatar_id, file_name); + file_name = makeLogFileName(file_name); + BOOST_FOREACH(std::string& transcript_file_name, list_of_transcriptions) + { + if (transcript_file_name == file_name) + { + return true; + } + } + } + } - // If a dated file existed it'll return a valid path; otherwise, it returns the undated unverified path so we do need to check it - strFilePath = oldLogFileName(strFileName); - return (!strFilePath.empty()) && (LLFile::isfile(strFilePath)); + return false; } bool LLLogChat::isNearbyTranscriptExist() { - std::string strFilePath = makeLogFileName("chat"); - if ( (!strFilePath.empty()) && (LLFile::isfile(strFilePath)) ) + std::vector list_of_transcriptions; + LLLogChat::getListOfTranscriptFiles(list_of_transcriptions); + + std::string file_name; + file_name = makeLogFileName("chat"); + BOOST_FOREACH(std::string& transcript_file_name, list_of_transcriptions) { - return true; + if (transcript_file_name == file_name) + { + return true; + } } - - // If a dated file existed it'll return a valid path; otherwise, it returns the undated unverified path so we do need to check it - strFilePath = oldLogFileName("chat"); - return (!strFilePath.empty()) && (LLFile::isfile(strFilePath)); + return false; } //*TODO mark object's names in a special way so that they will be distinguishable form avatar name diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index d1dbf2d119..ca597599dd 100755 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -92,12 +92,6 @@ public: static std::string timestamp(bool withdate = false); static std::string makeLogFileName(std::string(filename)); - - /** - * Attempts to build the correct IM P2P log filename for the specified agent UUID and agent name - */ - static bool buildIMP2PLogFilename(const LLUUID& idAgent, const std::string& strName, std::string& strFilename); - /** *Add functions to get old and non date stamped file names when needed */ -- cgit v1.2.3 From f69b11691d9911264d42a9c53d407a808591ee7c Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 23 Jul 2014 18:29:18 +0300 Subject: MAINT-4283 FIXED [BEAR] Viewer always crashes when opening "Scene Loading Monitor" if you closed it previously with the X --- indra/newview/llscenemonitor.cpp | 5 +++++ indra/newview/llscenemonitor.h | 1 + 2 files changed, 6 insertions(+) diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index 5b37fdf41b..179a73413e 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -709,6 +709,11 @@ void LLSceneMonitorView::onClose(bool app_quitting) setVisible(false); } +void LLSceneMonitorView::onClickCloseBtn(bool app_quitting) +{ + setVisible(false); +} + void LLSceneMonitorView::onVisibilityChange(BOOL visible) { if (!LLGLSLShader::sNoFixedFunction && visible) diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h index e9ceb2aa2a..5bde3b5aab 100644 --- a/indra/newview/llscenemonitor.h +++ b/indra/newview/llscenemonitor.h @@ -116,6 +116,7 @@ public: protected: virtual void onClose(bool app_quitting=false); + virtual void onClickCloseBtn(bool app_quitting=false); }; extern LLSceneMonitorView* gSceneMonitorView; -- cgit v1.2.3 From 03361678a6ca109e4ef479c148d36f6d157e8e5a Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 25 Jul 2014 08:08:20 +0200 Subject: Changed: Facebook floater layout. Changed: Facebook floater size. Changed: Aligned all widgets to an unified layout, keep 10 pixels left/right and so on. Removed: Account tab and moved it into Status tab. --- .../skins/default/xui/en/floater_facebook.xml | 39 +++---- .../default/xui/en/panel_facebook_account.xml | 77 ------------- .../default/xui/en/panel_facebook_friends.xml | 21 ++-- .../skins/default/xui/en/panel_facebook_photo.xml | 116 ++++++++++---------- .../skins/default/xui/en/panel_facebook_place.xml | 120 +++++++++------------ .../skins/default/xui/en/panel_facebook_status.xml | 114 +++++++++++++++----- 6 files changed, 221 insertions(+), 266 deletions(-) delete mode 100644 indra/newview/skins/default/xui/en/panel_facebook_account.xml diff --git a/indra/newview/skins/default/xui/en/floater_facebook.xml b/indra/newview/skins/default/xui/en/floater_facebook.xml index 4535b9084e..2ea34fb751 100644 --- a/indra/newview/skins/default/xui/en/floater_facebook.xml +++ b/indra/newview/skins/default/xui/en/floater_facebook.xml @@ -2,7 +2,6 @@ - + height="462" + width="272"> - + name="panel_facebook_account"/>--> - Loading... - - diff --git a/indra/newview/skins/default/xui/en/panel_facebook_account.xml b/indra/newview/skins/default/xui/en/panel_facebook_account.xml deleted file mode 100644 index 122cbfb717..0000000000 --- a/indra/newview/skins/default/xui/en/panel_facebook_account.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Not connected to Facebook. - - - - - - - - [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Learn about posting to Facebook] - - - diff --git a/indra/newview/skins/default/xui/en/panel_facebook_friends.xml b/indra/newview/skins/default/xui/en/panel_facebook_friends.xml index 9d21a3a293..6ec85eb247 100644 --- a/indra/newview/skins/default/xui/en/panel_facebook_friends.xml +++ b/indra/newview/skins/default/xui/en/panel_facebook_friends.xml @@ -1,6 +1,6 @@ @@ -11,15 +11,15 @@ name="facebook_friends_no_connected" value="You're currently not connected to Facebook. Please go to the Account tab to connect and enable this feature." /> + width="272" /> + width="272" /> Not connected to Facebook. diff --git a/indra/newview/skins/default/xui/en/panel_facebook_photo.xml b/indra/newview/skins/default/xui/en/panel_facebook_photo.xml index b5b6dee004..22e6598352 100644 --- a/indra/newview/skins/default/xui/en/panel_facebook_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_facebook_photo.xml @@ -1,29 +1,19 @@ - - + width="124"> + width="124"> + top_pad="5" + follows="left|top|rith" + right="-10" + left="10"> - - + width="251"> Refreshing... + + - - + diff --git a/indra/newview/skins/default/xui/en/panel_facebook_place.xml b/indra/newview/skins/default/xui/en/panel_facebook_place.xml index 84c87df523..6a4b5e2b8a 100644 --- a/indra/newview/skins/default/xui/en/panel_facebook_place.xml +++ b/indra/newview/skins/default/xui/en/panel_facebook_place.xml @@ -1,115 +1,96 @@ - - Say something about where you are: - - + - - - - Include overhead view of location - - - + layout="topleft" + height="24" + width="24" + name="map_loading_indicator2" + top_delta="116" + left="126" + visible="true"/> - - diff --git a/indra/newview/skins/default/xui/en/panel_facebook_status.xml b/indra/newview/skins/default/xui/en/panel_facebook_status.xml index 480abec558..fe0f3c9279 100644 --- a/indra/newview/skins/default/xui/en/panel_facebook_status.xml +++ b/indra/newview/skins/default/xui/en/panel_facebook_status.xml @@ -1,50 +1,113 @@ - + + + Not connected to Facebook. + + + + + + + - + length="1" + follows="top|left|right" + left="10" + right="-10" + height="16" + name="account_learn_more_label" + top_pad="5" + type="string"> + [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Learn about posting to Facebook] + + + What's on your mind? - - - - -- cgit v1.2.3 From c885547056e40f80b1f26074782b478b5e10cc93 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 25 Jul 2014 08:09:24 +0200 Subject: Changed: Flickr floater layout. Changed: Flickr floater size. Changed: Aligned all widgets to an unified layout, keep 10 pixels left/right and so on. --- .../skins/default/xui/en/floater_flickr.xml | 23 ++-- .../skins/default/xui/en/panel_flickr_account.xml | 22 ++-- .../skins/default/xui/en/panel_flickr_photo.xml | 145 +++++++++++---------- 3 files changed, 104 insertions(+), 86 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_flickr.xml b/indra/newview/skins/default/xui/en/floater_flickr.xml index 1a9ffd0489..24de3ddd8d 100644 --- a/indra/newview/skins/default/xui/en/floater_flickr.xml +++ b/indra/newview/skins/default/xui/en/floater_flickr.xml @@ -10,11 +10,11 @@ single_instance="true" reuse_instance="true" title="UPLOAD TO FLICKR" - height="622" - width="304"> + height="590" + width="272"> Not connected to Flickr. @@ -28,7 +28,7 @@ follows="top|left" font="SansSerif" height="16" - left="9" + left="10" name="account_name_label" parse_urls="true" type="string"/> @@ -36,12 +36,14 @@ layout="topleft" name="panel_buttons" height="345" - left="9"> + left="0"> - + width="251"> Refreshing... + + - - + -- cgit v1.2.3 From acee1894023aa971aeca92316d01a68553f32904 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 25 Jul 2014 08:09:54 +0200 Subject: Changed: Twitter floater layout. Changed: Twitter floater size. Changed: Aligned all widgets to an unified layout, keep 10 pixels left/right and so on. --- .../skins/default/xui/en/floater_twitter.xml | 34 ++---- .../skins/default/xui/en/panel_twitter_account.xml | 24 ++-- .../skins/default/xui/en/panel_twitter_photo.xml | 124 +++++++++++---------- 3 files changed, 88 insertions(+), 94 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_twitter.xml b/indra/newview/skins/default/xui/en/floater_twitter.xml index aa5bfce2e9..3e1a91e58d 100644 --- a/indra/newview/skins/default/xui/en/floater_twitter.xml +++ b/indra/newview/skins/default/xui/en/floater_twitter.xml @@ -10,21 +10,13 @@ single_instance="true" reuse_instance="true" title="TWITTER" - height="502" - width="304"> - + height="462" + width="272"> - Loading... - - diff --git a/indra/newview/skins/default/xui/en/panel_twitter_account.xml b/indra/newview/skins/default/xui/en/panel_twitter_account.xml index ee4f6396e1..b9049a0bba 100644 --- a/indra/newview/skins/default/xui/en/panel_twitter_account.xml +++ b/indra/newview/skins/default/xui/en/panel_twitter_account.xml @@ -1,6 +1,6 @@ Not connected to Twitter. @@ -28,19 +28,23 @@ follows="top|left" font="SansSerif" height="16" - left="9" + left="10" name="account_name_label" parse_urls="true" type="string"/> + top_pad="3" + left="0"> - + width="251"> Refreshing... + + - - - - -- cgit v1.2.3 From c7de2ac4395e44618094d69e0c5d83482d300838 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 25 Jul 2014 09:06:46 +0200 Subject: Changed: Reflected changes made to the Facebook floater XMLs in code. Fixed: Deprecated llerrs/llwarns/lldebugs/llinfos on the way. --- indra/newview/llfloaterfacebook.cpp | 320 ++++++++++++++++-------------------- indra/newview/llfloaterfacebook.h | 44 ++--- 2 files changed, 160 insertions(+), 204 deletions(-) diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index 9e3f917eae..516cf5c15c 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -58,7 +58,6 @@ static LLPanelInjector t_panel_status("llfacebookstatuspa static LLPanelInjector t_panel_photo("llfacebookphotopanel"); static LLPanelInjector t_panel_checkin("llfacebookcheckinpanel"); static LLPanelInjector t_panel_friends("llfacebookfriendspanel"); -static LLPanelInjector t_panel_account("llfacebookaccountpanel"); const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; @@ -99,13 +98,29 @@ S32 compute_jpeg_quality(S32 width, S32 height) LLFacebookStatusPanel::LLFacebookStatusPanel() : mMessageTextEditor(NULL), mPostButton(NULL), - mCancelButton(NULL) + mCancelButton(NULL), + mAccountCaptionLabel(NULL), + mAccountNameLabel(NULL), + mPanelButtons(NULL), + mConnectButton(NULL), + mDisconnectButton(NULL) { + mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this)); + mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this)); + + setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2)); + mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLFacebookStatusPanel::onSend, this)); } BOOL LLFacebookStatusPanel::postBuild() { + mAccountCaptionLabel = getChild("account_caption_label"); + mAccountNameLabel = getChild("account_name_label"); + mPanelButtons = getChild("panel_buttons"); + mConnectButton = getChild("connect_btn"); + mDisconnectButton = getChild("disconnect_btn"); + mMessageTextEditor = getChild("status_message"); mPostButton = getChild("post_status_btn"); mCancelButton = getChild("cancel_status_btn"); @@ -115,6 +130,16 @@ BOOL LLFacebookStatusPanel::postBuild() void LLFacebookStatusPanel::draw() { + LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); + + //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress + bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; + mDisconnectButton->setEnabled(!disconnecting); + + //Disable the 'connect' button when a connection is in progress + bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; + mConnectButton->setEnabled(!connecting); + if (mMessageTextEditor && mPostButton && mCancelButton) { bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); @@ -145,6 +170,19 @@ void LLFacebookStatusPanel::onSend() bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data) { + if(LLFacebookConnect::instance().isConnected()) + { + //In process of disconnecting so leave the layout as is + if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) + { + showConnectedLayout(); + } + } + else + { + showDisconnectedLayout(); + } + switch (data.get("enum").asInteger()) { case LLFacebookConnect::FB_CONNECTED: @@ -169,6 +207,103 @@ void LLFacebookStatusPanel::sendStatus() } } +void LLFacebookStatusPanel::onVisibilityChange(BOOL visible) +{ + if(visible) + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); + + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this)); + + //Connected + if(LLFacebookConnect::instance().isConnected()) + { + showConnectedLayout(); + } + //Check if connected (show disconnected layout in meantime) + else + { + showDisconnectedLayout(); + } + if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || + (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) + { + LLFacebookConnect::instance().checkConnectionToFacebook(); + } + } + else + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); + } +} + +bool LLFacebookStatusPanel::onFacebookConnectInfoChange() +{ + LLSD info = LLFacebookConnect::instance().getInfo(); + std::string clickable_name; + + //Strings of format [http://www.somewebsite.com Click Me] become clickable text + if(info.has("link") && info.has("name")) + { + clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; + } + + mAccountNameLabel->setText(clickable_name); + + return false; +} + +void LLFacebookStatusPanel::showConnectButton() +{ + if(!mConnectButton->getVisible()) + { + mConnectButton->setVisible(TRUE); + mDisconnectButton->setVisible(FALSE); + } +} + +void LLFacebookStatusPanel::hideConnectButton() +{ + if(mConnectButton->getVisible()) + { + mConnectButton->setVisible(FALSE); + mDisconnectButton->setVisible(TRUE); + } +} + +void LLFacebookStatusPanel::showDisconnectedLayout() +{ + mAccountCaptionLabel->setText(getString("facebook_disconnected")); + mAccountNameLabel->setText(std::string("")); + showConnectButton(); +} + +void LLFacebookStatusPanel::showConnectedLayout() +{ + LLFacebookConnect::instance().loadFacebookInfo(); + + mAccountCaptionLabel->setText(getString("facebook_connected")); + hideConnectButton(); +} + +void LLFacebookStatusPanel::onConnect() +{ + LLFacebookConnect::instance().checkConnectionToFacebook(true); + + //Clear only the facebook browser cookies so that the facebook login screen appears + LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); +} + +void LLFacebookStatusPanel::onDisconnect() +{ + LLFacebookConnect::instance().disconnectFromFacebook(); + + LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); +} + void LLFacebookStatusPanel::clearAndClose() { mMessageTextEditor->setValue(""); @@ -185,7 +320,6 @@ void LLFacebookStatusPanel::clearAndClose() /////////////////////////// LLFacebookPhotoPanel::LLFacebookPhotoPanel() : -mSnapshotPanel(NULL), mResolutionComboBox(NULL), mRefreshBtn(NULL), mBtnPreview(NULL), @@ -213,7 +347,6 @@ BOOL LLFacebookPhotoPanel::postBuild() { setVisibleCallback(boost::bind(&LLFacebookPhotoPanel::onVisibilityChange, this, _2)); - mSnapshotPanel = getChild("snapshot_panel"); mResolutionComboBox = getChild("resolution_combobox"); mResolutionComboBox->setValue("[i1200,i630]"); // hardcoded defaults ftw! mResolutionComboBox->setCommitCallback(boost::bind(&LLFacebookPhotoPanel::updateResolution, this, TRUE)); @@ -300,16 +433,9 @@ void LLFacebookPhotoPanel::draw() // calc preview offset within the preview rect const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ; const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ; + S32 offset_x = thumbnail_rect.mLeft + local_offset_x; + S32 offset_y = thumbnail_rect.mBottom + local_offset_y; - // calc preview offset within the floater rect - // Hack : To get the full offset, we need to take into account each and every offset of each widgets up to the floater. - // This is almost as arbitrary as using a fixed offset so that's what we do here for the sake of simplicity. - // *TODO : Get the offset looking through the hierarchy of widgets, should be done in postBuild() so to avoid traversing the hierarchy each time. - S32 offset_x = thumbnail_rect.mLeft + local_offset_x - 1; - S32 offset_y = thumbnail_rect.mBottom + local_offset_y - 39; - - mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType()); - gGL.matrixMode(LLRender::MM_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); @@ -344,7 +470,7 @@ void LLFacebookPhotoPanel::onVisibilityChange(BOOL visible) LLSnapshotLivePreview* preview = getPreviewView(); if(preview) { - lldebugs << "opened, updating snapshot" << llendl; + LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL; preview->updateSnapshot(TRUE); } } @@ -477,7 +603,7 @@ void LLFacebookPhotoPanel::updateControls() BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); // *TODO: Separate maximum size for Web images from postcards - lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; + LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL; updateResolution(FALSE); } @@ -507,13 +633,13 @@ void LLFacebookPhotoPanel::updateResolution(BOOL do_update) if (width == 0 || height == 0) { // take resolution from current window size - lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; + LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL; previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); } else { // use the resolution from the selected pre-canned drop-down choice - lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; + LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL; previewp->setSize(width, height); } @@ -887,164 +1013,6 @@ bool LLFacebookFriendsPanel::onConnectedToFacebook(const LLSD& data) return false; } -/////////////////////////// -//LLFacebookAccountPanel////// -/////////////////////////// - -LLFacebookAccountPanel::LLFacebookAccountPanel() : -mAccountCaptionLabel(NULL), -mAccountNameLabel(NULL), -mPanelButtons(NULL), -mConnectButton(NULL), -mDisconnectButton(NULL) -{ - mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookAccountPanel::onConnect, this)); - mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookAccountPanel::onDisconnect, this)); - - setVisibleCallback(boost::bind(&LLFacebookAccountPanel::onVisibilityChange, this, _2)); -} - -BOOL LLFacebookAccountPanel::postBuild() -{ - mAccountCaptionLabel = getChild("account_caption_label"); - mAccountNameLabel = getChild("account_name_label"); - mPanelButtons = getChild("panel_buttons"); - mConnectButton = getChild("connect_btn"); - mDisconnectButton = getChild("disconnect_btn"); - - return LLPanel::postBuild(); -} - -void LLFacebookAccountPanel::draw() -{ - LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); - - //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress - bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; - mDisconnectButton->setEnabled(!disconnecting); - - //Disable the 'connect' button when a connection is in progress - bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; - mConnectButton->setEnabled(!connecting); - - LLPanel::draw(); -} - -void LLFacebookAccountPanel::onVisibilityChange(BOOL visible) -{ - if(visible) - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookAccountPanel::onFacebookConnectStateChange, this, _1)); - - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookAccountPanel::onFacebookConnectInfoChange, this)); - - //Connected - if(LLFacebookConnect::instance().isConnected()) - { - showConnectedLayout(); - } - //Check if connected (show disconnected layout in meantime) - else - { - showDisconnectedLayout(); - } - if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || - (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) - { - LLFacebookConnect::instance().checkConnectionToFacebook(); - } - } - else - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); - } -} - -bool LLFacebookAccountPanel::onFacebookConnectStateChange(const LLSD& data) -{ - if(LLFacebookConnect::instance().isConnected()) - { - //In process of disconnecting so leave the layout as is - if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) - { - showConnectedLayout(); - } - } - else - { - showDisconnectedLayout(); - } - - return false; -} - -bool LLFacebookAccountPanel::onFacebookConnectInfoChange() -{ - LLSD info = LLFacebookConnect::instance().getInfo(); - std::string clickable_name; - - //Strings of format [http://www.somewebsite.com Click Me] become clickable text - if(info.has("link") && info.has("name")) - { - clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; - } - - mAccountNameLabel->setText(clickable_name); - - return false; -} - -void LLFacebookAccountPanel::showConnectButton() -{ - if(!mConnectButton->getVisible()) - { - mConnectButton->setVisible(TRUE); - mDisconnectButton->setVisible(FALSE); - } -} - -void LLFacebookAccountPanel::hideConnectButton() -{ - if(mConnectButton->getVisible()) - { - mConnectButton->setVisible(FALSE); - mDisconnectButton->setVisible(TRUE); - } -} - -void LLFacebookAccountPanel::showDisconnectedLayout() -{ - mAccountCaptionLabel->setText(getString("facebook_disconnected")); - mAccountNameLabel->setText(std::string("")); - showConnectButton(); -} - -void LLFacebookAccountPanel::showConnectedLayout() -{ - LLFacebookConnect::instance().loadFacebookInfo(); - - mAccountCaptionLabel->setText(getString("facebook_connected")); - hideConnectButton(); -} - -void LLFacebookAccountPanel::onConnect() -{ - LLFacebookConnect::instance().checkConnectionToFacebook(true); - - //Clear only the facebook browser cookies so that the facebook login screen appears - LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); -} - -void LLFacebookAccountPanel::onDisconnect() -{ - LLFacebookConnect::instance().disconnectFromFacebook(); - - LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); -} - //////////////////////// //LLFloaterFacebook/////// //////////////////////// @@ -1094,7 +1062,7 @@ void LLFloaterFacebook::showPhotoPanel() LLTabContainer* parent = dynamic_cast(mFacebookPhotoPanel->getParent()); if (!parent) { - llwarns << "Cannot find panel container" << llendl; + LL_WARNS() << "Cannot find panel container" << LL_ENDL; return; } diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h index 34356412d6..86e3a148b9 100644 --- a/indra/newview/llfloaterfacebook.h +++ b/indra/newview/llfloaterfacebook.h @@ -51,6 +51,22 @@ public: void clearAndClose(); private: + void onVisibilityChange(BOOL new_visibility); + bool onFacebookConnectInfoChange(); + void onConnect(); + void onUseAnotherAccount(); + void onDisconnect(); + + void showConnectButton(); + void hideConnectButton(); + void showDisconnectedLayout(); + void showConnectedLayout(); + + LLTextBox * mAccountCaptionLabel; + LLTextBox * mAccountNameLabel; + LLUICtrl * mPanelButtons; + LLUICtrl * mConnectButton; + LLUICtrl * mDisconnectButton; LLUICtrl* mMessageTextEditor; LLUICtrl* mPostButton; LLUICtrl* mCancelButton; @@ -87,7 +103,6 @@ private: LLHandle mPreviewHandle; - LLUICtrl * mSnapshotPanel; LLUICtrl * mResolutionComboBox; LLUICtrl * mFilterComboBox; LLUICtrl * mRefreshBtn; @@ -147,33 +162,6 @@ private: LLAvatarList* mSuggestedFriends; }; -class LLFacebookAccountPanel : public LLPanel -{ -public: - LLFacebookAccountPanel(); - BOOL postBuild(); - void draw(); - -private: - void onVisibilityChange(BOOL new_visibility); - bool onFacebookConnectStateChange(const LLSD& data); - bool onFacebookConnectInfoChange(); - void onConnect(); - void onUseAnotherAccount(); - void onDisconnect(); - - void showConnectButton(); - void hideConnectButton(); - void showDisconnectedLayout(); - void showConnectedLayout(); - - LLTextBox * mAccountCaptionLabel; - LLTextBox * mAccountNameLabel; - LLUICtrl * mPanelButtons; - LLUICtrl * mConnectButton; - LLUICtrl * mDisconnectButton; -}; - class LLFloaterFacebook : public LLFloater { public: -- cgit v1.2.3 From a34188354d7d54fa3548e8ee0bebcaeaaa2bcbd9 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 25 Jul 2014 09:07:08 +0200 Subject: Changed: Reflected changes made to the Flickr floater XMLs in code. Fixed: Deprecated llerrs/llwarns/lldebugs/llinfos on the way. --- indra/newview/llfloaterflickr.cpp | 23 +++++++---------------- indra/newview/llfloaterflickr.h | 1 - 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp index 4e6d98ecfa..36afab86b7 100644 --- a/indra/newview/llfloaterflickr.cpp +++ b/indra/newview/llfloaterflickr.cpp @@ -65,7 +65,6 @@ const std::string FLICKR_MACHINE_TAGS_NAMESPACE = "secondlife"; /////////////////////////// LLFlickrPhotoPanel::LLFlickrPhotoPanel() : -mSnapshotPanel(NULL), mResolutionComboBox(NULL), mRefreshBtn(NULL), mBtnPreview(NULL), @@ -96,7 +95,6 @@ BOOL LLFlickrPhotoPanel::postBuild() { setVisibleCallback(boost::bind(&LLFlickrPhotoPanel::onVisibilityChange, this, _2)); - mSnapshotPanel = getChild("snapshot_panel"); mResolutionComboBox = getChild("resolution_combobox"); mResolutionComboBox->setCommitCallback(boost::bind(&LLFlickrPhotoPanel::updateResolution, this, TRUE)); mFilterComboBox = getChild("filters_combobox"); @@ -191,16 +189,9 @@ void LLFlickrPhotoPanel::draw() // calc preview offset within the preview rect const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ; const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ; + S32 offset_x = thumbnail_rect.mLeft + local_offset_x; + S32 offset_y = thumbnail_rect.mBottom + local_offset_y; - // calc preview offset within the floater rect - // Hack : To get the full offset, we need to take into account each and every offset of each widgets up to the floater. - // This is almost as arbitrary as using a fixed offset so that's what we do here for the sake of simplicity. - // *TODO : Get the offset looking through the hierarchy of widgets, should be done in postBuild() so to avoid traversing the hierarchy each time. - S32 offset_x = thumbnail_rect.mLeft + local_offset_x - 1; - S32 offset_y = thumbnail_rect.mBottom + local_offset_y - 39; - - mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType()); - gGL.matrixMode(LLRender::MM_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); @@ -235,7 +226,7 @@ void LLFlickrPhotoPanel::onVisibilityChange(BOOL visible) LLSnapshotLivePreview* preview = getPreviewView(); if(preview) { - lldebugs << "opened, updating snapshot" << llendl; + LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL; preview->updateSnapshot(TRUE); } } @@ -427,7 +418,7 @@ void LLFlickrPhotoPanel::updateControls() BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); // *TODO: Separate maximum size for Web images from postcards - lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; + LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL; updateResolution(FALSE); } @@ -457,13 +448,13 @@ void LLFlickrPhotoPanel::updateResolution(BOOL do_update) if (width == 0 || height == 0) { // take resolution from current window size - lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; + LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL; previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); } else { // use the resolution from the selected pre-canned drop-down choice - lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; + LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL; previewp->setSize(width, height); } @@ -726,7 +717,7 @@ void LLFloaterFlickr::showPhotoPanel() LLTabContainer* parent = dynamic_cast(mFlickrPhotoPanel->getParent()); if (!parent) { - llwarns << "Cannot find panel container" << llendl; + LL_WARNS() << "Cannot find panel container" << LL_ENDL; return; } diff --git a/indra/newview/llfloaterflickr.h b/indra/newview/llfloaterflickr.h index ba27c9a3d8..74da3bcea9 100644 --- a/indra/newview/llfloaterflickr.h +++ b/indra/newview/llfloaterflickr.h @@ -67,7 +67,6 @@ private: LLHandle mPreviewHandle; - LLUICtrl * mSnapshotPanel; LLUICtrl * mResolutionComboBox; LLUICtrl * mFilterComboBox; LLUICtrl * mRefreshBtn; -- cgit v1.2.3 From 9f9fb34742b80f89d9c8e058d6177947c8f55d06 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 25 Jul 2014 09:10:52 +0200 Subject: Changed: Reflected changes made to the Twitter floater XMLs in code. Fixed: Deprecated llerrs/llwarns/lldebugs/llinfos on the way. --- indra/newview/llfloatertwitter.cpp | 23 +++++++---------------- indra/newview/llfloatertwitter.h | 1 - 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index 78e9259919..868d623d57 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -64,7 +64,6 @@ const std::string DEFAULT_STATUS_TEXT = " #SecondLife"; /////////////////////////// LLTwitterPhotoPanel::LLTwitterPhotoPanel() : -mSnapshotPanel(NULL), mResolutionComboBox(NULL), mRefreshBtn(NULL), mBtnPreview(NULL), @@ -94,7 +93,6 @@ BOOL LLTwitterPhotoPanel::postBuild() { setVisibleCallback(boost::bind(&LLTwitterPhotoPanel::onVisibilityChange, this, _2)); - mSnapshotPanel = getChild("snapshot_panel"); mResolutionComboBox = getChild("resolution_combobox"); mResolutionComboBox->setValue("[i800,i600]"); // hardcoded defaults ftw! mResolutionComboBox->setCommitCallback(boost::bind(&LLTwitterPhotoPanel::updateResolution, this, TRUE)); @@ -194,15 +192,8 @@ void LLTwitterPhotoPanel::draw() // calc preview offset within the preview rect const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ; const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ; - - // calc preview offset within the floater rect - // Hack : To get the full offset, we need to take into account each and every offset of each widgets up to the floater. - // This is almost as arbitrary as using a fixed offset so that's what we do here for the sake of simplicity. - // *TODO : Get the offset looking through the hierarchy of widgets, should be done in postBuild() so to avoid traversing the hierarchy each time. - S32 offset_x = thumbnail_rect.mLeft + local_offset_x - 1; - S32 offset_y = thumbnail_rect.mBottom + local_offset_y - 39; - - mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType()); + S32 offset_x = thumbnail_rect.mLeft + local_offset_x; + S32 offset_y = thumbnail_rect.mBottom + local_offset_y; gGL.matrixMode(LLRender::MM_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. @@ -238,7 +229,7 @@ void LLTwitterPhotoPanel::onVisibilityChange(BOOL visible) LLSnapshotLivePreview* preview = getPreviewView(); if(preview) { - lldebugs << "opened, updating snapshot" << llendl; + LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL; preview->updateSnapshot(TRUE); } } @@ -455,7 +446,7 @@ void LLTwitterPhotoPanel::updateControls() BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); // *TODO: Separate maximum size for Web images from postcards - lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; + LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL; updateResolution(FALSE); } @@ -485,13 +476,13 @@ void LLTwitterPhotoPanel::updateResolution(BOOL do_update) if (width == 0 || height == 0) { // take resolution from current window size - lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; + LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL; previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); } else { // use the resolution from the selected pre-canned drop-down choice - lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; + LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL; previewp->setSize(width, height); } @@ -755,7 +746,7 @@ void LLFloaterTwitter::showPhotoPanel() LLTabContainer* parent = dynamic_cast(mTwitterPhotoPanel->getParent()); if (!parent) { - llwarns << "Cannot find panel container" << llendl; + LL_WARNS() << "Cannot find panel container" << LL_ENDL; return; } diff --git a/indra/newview/llfloatertwitter.h b/indra/newview/llfloatertwitter.h index f07ec2ca2f..d586799d18 100644 --- a/indra/newview/llfloatertwitter.h +++ b/indra/newview/llfloatertwitter.h @@ -70,7 +70,6 @@ private: LLHandle mPreviewHandle; - LLUICtrl * mSnapshotPanel; LLUICtrl * mResolutionComboBox; LLUICtrl * mFilterComboBox; LLUICtrl * mRefreshBtn; -- cgit v1.2.3 From dca057c6656d98ee05c2fc98dd912d4fd5d35505 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 25 Jul 2014 10:16:38 +0200 Subject: Changed: Snapshot floater layout. Changed: Snapshots to disk default to 'Custom' (Window Resolution) Added: Big Auto-scaling integrated image Preview. Can be toggled. Added: Fixed german translations for the new floater layout. Removed: Need to have SnapshotFiltersEnabled to see the filter dropdown. Removed: SnapshotFiltersEnabled debug. --- indra/newview/app_settings/settings.xml | 11 - indra/newview/llfloatersnapshot.cpp | 136 +++---- .../skins/default/xui/de/floater_snapshot.xml | 13 +- .../default/xui/de/panel_snapshot_inventory.xml | 2 +- .../skins/default/xui/de/panel_snapshot_local.xml | 2 +- .../default/xui/de/panel_snapshot_options.xml | 11 +- .../default/xui/de/panel_snapshot_postcard.xml | 2 - .../default/xui/de/panel_snapshot_profile.xml | 2 +- .../skins/default/xui/en/floater_snapshot.xml | 450 +++++++++++---------- .../default/xui/en/panel_postcard_message.xml | 30 +- .../default/xui/en/panel_postcard_settings.xml | 74 ++-- .../default/xui/en/panel_snapshot_inventory.xml | 77 ++-- .../skins/default/xui/en/panel_snapshot_local.xml | 240 +++++------ .../default/xui/en/panel_snapshot_options.xml | 162 ++++---- .../default/xui/en/panel_snapshot_postcard.xml | 32 +- .../default/xui/en/panel_snapshot_profile.xml | 202 ++++----- 16 files changed, 671 insertions(+), 775 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 03b953b6cc..7ebda3eea6 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11452,17 +11452,6 @@ Value 0 - SnapshotFiltersEnabled - - Comment - Enable filters in the Snapshot Advanced panel (experimental). - Persist - 1 - Type - Boolean - Value - 0 - SnapshotFormat Comment diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 960d3f35dd..c4b00c8342 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1,4 +1,4 @@ -/** +/** * @file llfloatersnapshot.cpp * @brief Snapshot preview window, allowing saving, e-mailing, etc. * @@ -62,7 +62,6 @@ const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512 static LLDefaultChildRegistry::Register r("snapshot_floater_view"); - ///---------------------------------------------------------------------------- /// Class LLFloaterSnapshot::Impl ///---------------------------------------------------------------------------- @@ -96,7 +95,7 @@ public: static void onClickAutoSnap(LLUICtrl *ctrl, void* data); static void onClickFilter(LLUICtrl *ctrl, void* data); //static void onClickAdvanceSnap(LLUICtrl *ctrl, void* data); - static void onClickMore(void* data) ; + static void onClickPreview(void* data) ; static void onClickUICheck(LLUICtrl *ctrl, void* data); static void onClickHUDCheck(LLUICtrl *ctrl, void* data); static void applyKeepAspectCheck(LLFloaterSnapshot* view, BOOL checked); @@ -264,31 +263,33 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) BOOL advanced = gSavedSettings.getBOOL("AdvanceSnapshot"); - // Show/hide advanced options. - LLPanel* advanced_options_panel = floaterp->getChild("advanced_options_panel"); - floaterp->getChild("advanced_options_btn")->setImageOverlay(advanced ? "TabIcon_Open_Off" : "TabIcon_Close_Off"); - if (advanced != advanced_options_panel->getVisible()) + //BD - Automatically calculate the size of our snapshot window to enlarge + // the snapshot preview to its maximum size, this is especially helpfull + // for pretty much every aspect ratio other than 1:1. + F32 panel_width = 400.f * gViewerWindow->getWorldViewAspectRatio(); + + //BD - Make sure we clamp at 700 here because 700 would be for 16:9 which we + // consider the maximum. Everything bigger will be clamped and will have + // a slightly smaller preview window which most likely won't fill up the + // whole snapshot floater as it should. + if(panel_width > 700.f) { - S32 panel_width = advanced_options_panel->getRect().getWidth(); - floaterp->getChild("advanced_options_panel")->setVisible(advanced); - S32 floater_width = floaterp->getRect().getWidth(); - floater_width += (advanced ? panel_width : -panel_width); - floaterp->reshape(floater_width, floaterp->getRect().getHeight()); + panel_width = 700.f; } - if(!advanced) //set to original window resolution + S32 floater_width = 224.f; + if(advanced) { - previewp->mKeepAspectRatio = TRUE; - - floaterp->getChild("profile_size_combo")->setCurrentByIndex(0); - floaterp->getChild("postcard_size_combo")->setCurrentByIndex(0); - floaterp->getChild("texture_size_combo")->setCurrentByIndex(0); - floaterp->getChild("local_size_combo")->setCurrentByIndex(0); - - LLSnapshotLivePreview* previewp = getPreviewView(floaterp); - previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); + floater_width = floater_width + panel_width; } + LLUICtrl* thumbnail_placeholder = floaterp->getChild("thumbnail_placeholder"); + thumbnail_placeholder->setVisible(advanced); + thumbnail_placeholder->reshape(panel_width, thumbnail_placeholder->getRect().getHeight()); + floaterp->getChild("image_res_text")->setVisible(advanced); + floaterp->getChild("file_size_label")->setVisible(advanced); + floaterp->reshape(floater_width, floaterp->getRect().getHeight()); + bool use_freeze_frame = floaterp->getChild("freeze_frame_check")->getValue().asBoolean(); if (use_freeze_frame) @@ -388,7 +389,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) height_ctrl->setValue(h); } - // Сlamp snapshot resolution to window size when showing UI or HUD in snapshot. + // Clamp snapshot resolution to window size when showing UI or HUD in snapshot. if (gSavedSettings.getBOOL("RenderUIInSnapshot") || gSavedSettings.getBOOL("RenderHUDInSnapshot")) { S32 width = gViewerWindow->getWindowWidthRaw(); @@ -581,20 +582,6 @@ void LLFloaterSnapshot::Impl::onClickFilter(LLUICtrl *ctrl, void* data) } } -void LLFloaterSnapshot::Impl::onClickMore(void* data) -{ - BOOL visible = gSavedSettings.getBOOL("AdvanceSnapshot"); - - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; - if (view) - { - view->impl.setStatus(Impl::STATUS_READY); - gSavedSettings.setBOOL("AdvanceSnapshot", !visible); - updateControls(view) ; - updateLayout(view) ; - } -} - // static void LLFloaterSnapshot::Impl::onClickUICheck(LLUICtrl *ctrl, void* data) { @@ -701,6 +688,20 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde } } +void LLFloaterSnapshot::Impl::onClickPreview(void* data) +{ + BOOL visible = gSavedSettings.getBOOL("AdvanceSnapshot"); + + LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; + if (view) + { + view->impl.setStatus(Impl::STATUS_READY); + gSavedSettings.setBOOL("AdvanceSnapshot", !visible); + updateControls(view) ; + updateLayout(view) ; + } +} + // Show/hide upload progress indicators. // static void LLFloaterSnapshot::Impl::setWorking(LLFloaterSnapshot* floater, bool working) @@ -1055,7 +1056,7 @@ BOOL LLFloaterSnapshot::postBuild() mSucceessLblPanel = getChild("succeeded_panel"); mFailureLblPanel = getChild("failed_panel"); - childSetAction("advanced_options_btn", Impl::onClickMore, this); + childSetAction("preview_btn", Impl::onClickPreview, this); childSetCommitCallback("ui_check", Impl::onClickUICheck, this); getChild("ui_check")->setValue(gSavedSettings.getBOOL("RenderUIInSnapshot")); @@ -1075,24 +1076,15 @@ BOOL LLFloaterSnapshot::postBuild() getChild("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot")); childSetCommitCallback("auto_snapshot_check", Impl::onClickAutoSnap, this); + // Filters LLComboBox* filterbox = getChild("filters_combobox"); - if (gSavedSettings.getBOOL("SnapshotFiltersEnabled")) - { - // Update filter list if setting is on (experimental) - std::vector filter_list = LLImageFiltersManager::getInstance()->getFiltersList(); - for (U32 i = 0; i < filter_list.size(); i++) - { - filterbox->add(filter_list[i]); - } - childSetCommitCallback("filters_combobox", Impl::onClickFilter, this); - } - else + std::vector filter_list = LLImageFiltersManager::getInstance()->getFiltersList(); + for (U32 i = 0; i < filter_list.size(); i++) { - // Hide Filter UI if setting is off (default) - getChild("filter_list_label")->setVisible(FALSE); - filterbox->setVisible(FALSE); + filterbox->add(filter_list[i]); } + childSetCommitCallback("filters_combobox", Impl::onClickFilter, this); LLWebProfile::setImageUploadResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, _1)); LLPostCard::setPostResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSendingPostcardFinished, _1)); @@ -1119,7 +1111,7 @@ BOOL LLFloaterSnapshot::postBuild() getChild("profile_size_combo")->selectNthItem(0); getChild("postcard_size_combo")->selectNthItem(0); getChild("texture_size_combo")->selectNthItem(0); - getChild("local_size_combo")->selectNthItem(0); + getChild("local_size_combo")->selectNthItem(8); getChild("local_format_combo")->selectNthItem(0); impl.mPreviewHandle = previewp->getHandle(); @@ -1145,7 +1137,7 @@ void LLFloaterSnapshot::draw() LLFloater::draw(); - if (previewp && !isMinimized()) + if (previewp && !isMinimized() && sThumbnailPlaceholder->getVisible()) { if(previewp->getThumbnailImage()) { @@ -1172,44 +1164,13 @@ void LLFloaterSnapshot::draw() previewp->drawPreviewRect(offset_x, offset_y) ; - // Draw some controls on top of the preview thumbnail. - static const S32 PADDING = 5; - static const S32 REFRESH_LBL_BG_HEIGHT = 32; - - // Reshape and position the posting result message panels at the top of the thumbnail. - // Do this regardless of current posting status (finished or not) to avoid flicker - // when the result message is displayed for the first time. - // if (impl.getStatus() == Impl::STATUS_FINISHED) - { - LLRect result_lbl_rect = mSucceessLblPanel->getRect(); - const S32 result_lbl_h = result_lbl_rect.getHeight(); - result_lbl_rect.setLeftTopAndSize(local_offset_x, local_offset_y + thumbnail_h, thumbnail_w - 1, result_lbl_h); - mSucceessLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h); - mSucceessLblPanel->setRect(result_lbl_rect); - mFailureLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h); - mFailureLblPanel->setRect(result_lbl_rect); - } - - // Position the refresh button in the bottom left corner of the thumbnail. - mRefreshBtn->setOrigin(local_offset_x + PADDING, local_offset_y + PADDING); - - if (impl.mNeedRefresh) - { - // Place the refresh hint text to the right of the refresh button. - const LLRect& refresh_btn_rect = mRefreshBtn->getRect(); - mRefreshLabel->setOrigin(refresh_btn_rect.mLeft + refresh_btn_rect.getWidth() + PADDING, refresh_btn_rect.mBottom); - - // Draw the refresh hint background. - LLRect refresh_label_bg_rect(offset_x, offset_y + REFRESH_LBL_BG_HEIGHT, offset_x + thumbnail_w - 1, offset_y); - gl_rect_2d(refresh_label_bg_rect, LLColor4::white % 0.9f, TRUE); - } - gGL.pushUIMatrix(); LLUI::translate((F32) thumbnail_rect.mLeft, (F32) thumbnail_rect.mBottom); sThumbnailPlaceholder->draw(); gGL.popUIMatrix(); } } + impl.updateLayout(this); } void LLFloaterSnapshot::onOpen(const LLSD& key) @@ -1225,6 +1186,9 @@ void LLFloaterSnapshot::onOpen(const LLSD& key) gSnapshotFloaterView->setVisible(TRUE); gSnapshotFloaterView->adjustToFitScreen(this, FALSE); + impl.updateControls(this); + impl.updateLayout(this); + // Initialize default tab. getChild("panel_container")->getCurrentPanel()->onOpen(LLSD()); } diff --git a/indra/newview/skins/default/xui/de/floater_snapshot.xml b/indra/newview/skins/default/xui/de/floater_snapshot.xml index 798461c007..b98ee78685 100755 --- a/indra/newview/skins/default/xui/de/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/de/floater_snapshot.xml @@ -41,23 +41,24 @@ diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml index 3f67a48b14..22f19ca99a 100755 --- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml +++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml @@ -11,8 +11,8 @@ layout="topleft" left="10" name="postcard_size_combo" - right="-10" - top_pad="10"> + right="-5" + top_pad="5"> + top_pad="0" + right="-1"> + top_pad="3" + width="132" /> + width="54" /> - - ([QLVL]) - + decimal_digits="0" + follows="left|top" + height="15" + increment="1" + initial_value="75" + label="Quality:" + label_width="45" + layout="topleft" + left="10" + max_val="100" + name="image_quality_slider" + top_pad="6" + width="195" /> diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml index 71d808fa4b..3a42b9a2f8 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml @@ -12,12 +12,12 @@ left="12" mouse_opaque="true" name="title_icon" - top="5" + top="6" width="18" /> - Save to My Inventory + top_delta="3"> + Inventory - - Saving an image to your inventory costs L$[UPLOAD_COST]. To save your image as a texture select one of the square formats. - + right="-5" + top_pad="5"> + top_pad="7" + width="134" /> + width="54" /> + + Saving an image to your inventory costs L$[UPLOAD_COST]. To save your image as a texture select one of the square formats. + - + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml index 781ab17403..430010f7e4 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml @@ -12,12 +12,12 @@ left="12" mouse_opaque="true" name="title_icon" - top="5" + top="7" width="18" /> - Save to My Computer + top_delta="2"> + Disk + right="-5" + top_pad="5"/> + right="-5" + top_pad="5"> - - - - - - - - - - - - - - - ([QLVL]) - - - + + + + + Format: + + + + + + + + width="95"> - + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml index eff60f8228..0bb2ccba5e 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml @@ -4,117 +4,127 @@ height="240" layout="topleft" name="panel_snapshot_options" - width="490"> + width="198"> + + + - - Send to: [secondlife:/// Facebook] - - - [secondlife:/// Twitter] - - - [secondlife:/// Flickr] - - + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml index ebba292a93..5be93c44c1 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml @@ -24,12 +24,12 @@ left="12" mouse_opaque="true" name="title_icon" - top="5" + top="8" width="18" /> - Email + top_delta="2"> + E-mail @@ -57,12 +58,13 @@ follows="right|top" height="23" is_toggle="true" - label="Settings" + label="" + image_overlay="Command_Preferences_Icon" layout="topleft" name="settings_btn" top_delta="0" - right="-10" - width="70"> + left_pad="5" + width="25"> @@ -73,8 +75,8 @@ left="10" layout="topleft" name="hr" - right="-10" - top_pad="5" + right="-5" + top_pad="2" /> - + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml index 0dd357aa1a..bb63bc5347 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml @@ -17,7 +17,7 @@ - Post to My Profile Feed + Profile + top_pad="5" + width="180"> - + + + + Caption: + + + + - - - - - - - - Caption: - - - - - - + height="18" + name="add_location_cb" + top_pad="3" /> - + \ No newline at end of file -- cgit v1.2.3 From 009a3028efa728dc70769fd773f6619cbf49a2b3 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 25 Jul 2014 10:17:01 +0200 Subject: Added: NiranV Dean to contribution list. --- doc/contributions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index 7e8ab46b1a..d9d4e6a600 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -990,6 +990,7 @@ Nicky Perian STORM-1090 STORM-1828 Nicoladie Gymnast +NiranV Dean Nounouch Hapmouche VWR-238 Ollie Kubrick -- cgit v1.2.3 From 21aca031d7c6e34249dfb5ba5c19f04ee64f8a03 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 25 Jul 2014 11:36:57 +0300 Subject: MAINT-4287 FIXED Check that gMenuHolder is not NULL --- indra/newview/lltoolpie.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index eec9760d2d..e4353aafaa 100755 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1315,7 +1315,7 @@ void LLToolPie::handleDeselect() // Menu may be still up during transfer to different tool. // toolfocus and toolgrab should retain menu, they will clear it if needed MASK override_mask = gKeyboard ? gKeyboard->currentMask(TRUE) : 0; - if (!gMenuHolder->getVisible() || (override_mask & (MASK_ALT | MASK_CONTROL)) == 0) + if (gMenuHolder && (!gMenuHolder->getVisible() || (override_mask & (MASK_ALT | MASK_CONTROL)) == 0)) { // in most cases menu is useless without correct selection, so either keep both or discard both gMenuHolder->hideMenus(); -- cgit v1.2.3 From 47241b5d54b84fd2e655f8db0e7841b069f2cbb2 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 25 Jul 2014 10:39:29 +0200 Subject: Changed: Very tiny visual alignment finetunings. Everything has to be perfect. --- indra/newview/skins/default/xui/en/floater_snapshot.xml | 8 ++++---- indra/newview/skins/default/xui/en/panel_snapshot_options.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 410594f1c6..e85a7d81ea 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -106,7 +106,7 @@ bevel_style="in" follows="left|top|right" height="1" - left="6" + left="10" layout="topleft" name="advanced_options_hr" right="-1" @@ -204,11 +204,11 @@ bevel_style="in" follows="left|top|right" height="1" - left="6" + left="10" layout="topleft" name="advanced_options_hr" right="-1" - top_pad="10" + top_pad="7" /> Date: Fri, 25 Jul 2014 10:48:22 +0200 Subject: Changed: More tiny alignment inconsestencies between Black Dragon and Linden Release. --- indra/newview/skins/default/xui/en/floater_snapshot.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index e85a7d81ea..85963756d5 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -260,7 +260,7 @@ left="10" layout="topleft" name="status_hr" - width="192" + width="189" top_pad="-16"/> Date: Sat, 26 Jul 2014 11:46:17 +0200 Subject: STORM-2040: Fixed: German Translation for several snapshot panels. --- .../default/xui/de/panel_postcard_message.xml | 2 +- .../default/xui/de/panel_postcard_settings.xml | 19 +++++--------- .../skins/default/xui/de/panel_snapshot_local.xml | 29 ++++++++-------------- .../default/xui/de/panel_snapshot_profile.xml | 29 ++++++++-------------- 4 files changed, 29 insertions(+), 50 deletions(-) diff --git a/indra/newview/skins/default/xui/de/panel_postcard_message.xml b/indra/newview/skins/default/xui/de/panel_postcard_message.xml index 6eeef8af71..609569bd6f 100755 --- a/indra/newview/skins/default/xui/de/panel_postcard_message.xml +++ b/indra/newview/skins/default/xui/de/panel_postcard_message.xml @@ -9,7 +9,7 @@ Betreff: - + Nachricht: diff --git a/indra/newview/skins/default/xui/de/panel_postcard_settings.xml b/indra/newview/skins/default/xui/de/panel_postcard_settings.xml index c1a1c0cc46..e6d3b7de66 100755 --- a/indra/newview/skins/default/xui/de/panel_postcard_settings.xml +++ b/indra/newview/skins/default/xui/de/panel_postcard_settings.xml @@ -7,17 +7,10 @@ - - - - - - - - - - ([QLVL]) - - - + + + + + ([QLVL]) + diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_local.xml b/indra/newview/skins/default/xui/de/panel_snapshot_local.xml index 935e8d2356..53e78ba290 100755 --- a/indra/newview/skins/default/xui/de/panel_snapshot_local.xml +++ b/indra/newview/skins/default/xui/de/panel_snapshot_local.xml @@ -13,24 +13,17 @@ - - - - - - - - - - - - - - - ([QLVL]) - - - + + + + + + + + + + ([QLVL]) + - diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml index f6397fe7a2..907751280f 100755 --- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml +++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml @@ -9,9 +9,9 @@ height="23" label="Resolution" layout="topleft" - left="10" + left="5" name="postcard_size_combo" - right="-5" + right="-3" top_pad="5"> + width="190" /> diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml index 2622ccb4c4..01265523ea 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml @@ -24,7 +24,7 @@ left="12" mouse_opaque="true" name="title_icon" - top="8" + top="7" width="18" /> E-mail - - - + halign="center" + use_highlighting_on_hover="true"> - + + + \ No newline at end of file -- cgit v1.2.3 From fff5593010aa10eb3921bba475736a5daf1d2968 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 1 Aug 2014 18:50:38 +0200 Subject: STORM-2040: Changed: Slight alignment adjustations. --- indra/newview/skins/default/xui/en/panel_snapshot_local.xml | 2 +- indra/newview/skins/default/xui/en/panel_snapshot_options.xml | 2 +- indra/newview/skins/default/xui/en/panel_snapshot_profile.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml index ab1e1e290e..4cc20a8b5a 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml @@ -32,7 +32,7 @@ bevel_style="in" follows="left|top|right" height="1" - left="10" + left="9" layout="topleft" name="hr" right="-5" diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml index 2f8efd9b13..2b26ee19c1 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml @@ -16,7 +16,7 @@ imgoverlay_label_space="10" label="Save to Disk" layout="topleft" - left="10" + left="9" name="save_to_computer_btn" top_pad="9"> Date: Fri, 1 Aug 2014 19:23:59 +0200 Subject: STORM-2051: Moved: Missing german button translation. --- indra/newview/skins/default/xui/de/panel_postcard_message.xml | 2 -- indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/de/panel_postcard_message.xml b/indra/newview/skins/default/xui/de/panel_postcard_message.xml index 609569bd6f..b34dc776de 100755 --- a/indra/newview/skins/default/xui/de/panel_postcard_message.xml +++ b/indra/newview/skins/default/xui/de/panel_postcard_message.xml @@ -16,6 +16,4 @@ Nachricht hier eingeben. - @@ -140,7 +140,7 @@ left="10" name="save_btn" top_delta="0" - width="95"> + width="97"> diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml index 4cc20a8b5a..188c9f8707 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml @@ -86,14 +86,14 @@ height="20" increment="32" label="Width x Height" - label_width="80" + label_width="90" layout="topleft" left="10" max_val="6016" min_val="32" name="local_snapshot_width" top_pad="7" - width="134" /> + width="144" /> + width="203" /> @@ -186,7 +186,7 @@ name="save_btn" tool_tip="Save image to a file" top_delta="0" - width="95"> + width="97"> + width="208"> @@ -96,7 +96,7 @@ left="10" name="send_btn" top_delta="0" - width="95"> + width="97"> diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml index 1b718e6826..d86cb92981 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml @@ -76,14 +76,14 @@ height="20" increment="32" label="Width x Height" - label_width="80" + label_width="90" layout="topleft" left="10" max_val="6016" min_val="32" name="profile_snapshot_width" top_pad="7" - width="134" /> + width="144" /> + width="97"> @@ -160,7 +160,7 @@ left="10" name="post_btn" top_delta="0" - width="95"> + width="97"> -- cgit v1.2.3 From b746d4067875cbf4880046fabe9de127b00e8cd3 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 1 Aug 2014 20:17:05 +0200 Subject: Changed: Updated contributions file. --- doc/contributions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index ed60e48443..faaac602a5 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1002,6 +1002,7 @@ NiranV Dean STORM-2049 STORM-2050 STORM-2051 + STORM-2052 BUG-372 BUG-1179 Nounouch Hapmouche -- cgit v1.2.3 From 45e98414eaeba225a3aa26657789f9d3b80cba22 Mon Sep 17 00:00:00 2001 From: NiranV Date: Sat, 2 Aug 2014 05:25:06 +0200 Subject: STORM-2052: Changed: Swapped button icons. --- indra/newview/skins/default/xui/en/floater_snapshot.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index bc4bf8fd8f..4b8f4c8fed 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -105,7 +105,7 @@ image_hover_unselected="Toolbar_Middle_Over" image_selected="Toolbar_Middle_Off" image_unselected="Toolbar_Middle_Off" - image_overlay="Conv_toolbar_collapse" + image_overlay="Conv_toolbar_expand" name="retract_btn" left_pad="1" top_delta="0" @@ -117,7 +117,7 @@ height="25" is_toggle="true" layout="topleft" - image_overlay="Conv_toolbar_expand" + image_overlay="Conv_toolbar_collapse" image_hover_unselected="Toolbar_Middle_Over" image_selected="Toolbar_Middle_Off" image_unselected="Toolbar_Middle_Off" -- cgit v1.2.3 From 6dc90470275a6d1b1625a05432e63fa54b889ae6 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 4 Aug 2014 12:39:47 +0300 Subject: MAINT-4293 FIXED [BEAR] Very slow inventory fetch on Bear compared to current release) --- indra/newview/llviewerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d042bd847e..9dcd0b81e0 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1969,7 +1969,7 @@ void LLViewerWindow::initWorldUI() // Force gFloaterTools to initialize LLFloaterReg::getInstance("build"); - LLFloaterReg::hideInstance("build"); + // Status bar LLPanel* status_bar_container = getRootView()->getChild("status_bar_container"); -- cgit v1.2.3 From e5f6c2faa040c2a7c161d60226854c23ff831eb5 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 4 Aug 2014 14:44:35 -0400 Subject: add some debug logging --- indra/newview/lltexturefetch.cpp | 3 +++ indra/newview/llviewerregion.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 9ea46cab68..62b2f5f976 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1336,17 +1336,20 @@ bool LLTextureFetchWorker::doWork(S32 param) LL_WARNS() << "trying to seek a non-default texture on the sim. Bad!" << LL_ENDL; } setUrl(http_url + "/?texture_id=" + mID.asString().c_str()); + LL_DEBUGS("Texture") << "Texture URL " << mUrl << LL_ENDL; mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id. } else { mCanUseHTTP = false ; + LL_DEBUGS("Texture") << "Texture not available via HTTP: no URL " << mUrl << LL_ENDL; } } else { // This will happen if not logged in or if a region deoes not have HTTP Texture enabled //LL_WARNS() << "Region not found for host: " << mHost << LL_ENDL; + LL_DEBUGS("Texture") << "Texture not available via HTTP: no region " << mUrl << LL_ENDL; mCanUseHTTP = false; } } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 673913c4f2..b22d37b710 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -285,8 +285,8 @@ private: { regionp->setCapability(iter->first, iter->second); - LL_DEBUGS("AppInit", "Capabilities") << "got capability for " - << iter->first << LL_ENDL; + LL_DEBUGS("AppInit", "Capabilities") + << "Capability '" << iter->first << "' is '" << iter->second << "'" << LL_ENDL; /* HACK we're waiting for the ServerReleaseNotes */ if (iter->first == "ServerReleaseNotes" && regionp->getReleaseNotesRequested()) -- cgit v1.2.3 From c03e22e420a17e47b597c90978eb2f4d206f2ffe Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 6 Aug 2014 17:50:40 +0300 Subject: MAINT-4325 FIXED [BEAR] Fix to "Reset Filters" causes empty folders to appear in Recent tab of Inventory --- indra/newview/llpanelmaininventory.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 2378e09979..ddf1a63c6e 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -151,7 +151,9 @@ BOOL LLPanelMainInventory::postBuild() recent_items_panel->setSinceLogoff(TRUE); recent_items_panel->setSortOrder(LLInventoryFilter::SO_DATE); recent_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - recent_items_panel->getFilter().markDefault(); + LLInventoryFilter& recent_filter = recent_items_panel->getFilter(); + recent_filter.setFilterObjectTypes(recent_filter.getFilterObjectTypes() & ~(0x1 << LLInventoryType::IT_CATEGORY)); + recent_filter.markDefault(); recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2)); } @@ -183,13 +185,6 @@ BOOL LLPanelMainInventory::postBuild() } - if (recent_items_panel) - { - U64 types = recent_items_panel->getFilter().getFilterObjectTypes(); - types &= ~(0x1 << LLInventoryType::IT_CATEGORY); - recent_items_panel->getFilter().setFilterObjectTypes(types); - } - mFilterEditor = getChild("inventory search editor"); if (mFilterEditor) { -- cgit v1.2.3 From 3dbbc49b4f535ee409c3a7c15b617c2997e80d8c Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 6 Aug 2014 15:33:41 -0400 Subject: fix dos line endings --- indra/newview/llfloaterfacebook.cpp | 258 ++++++++++++++++++------------------ indra/newview/llfloaterfacebook.h | 30 ++--- 2 files changed, 144 insertions(+), 144 deletions(-) diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index 516cf5c15c..d4f727e1df 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -98,27 +98,27 @@ S32 compute_jpeg_quality(S32 width, S32 height) LLFacebookStatusPanel::LLFacebookStatusPanel() : mMessageTextEditor(NULL), mPostButton(NULL), - mCancelButton(NULL), - mAccountCaptionLabel(NULL), - mAccountNameLabel(NULL), - mPanelButtons(NULL), - mConnectButton(NULL), + mCancelButton(NULL), + mAccountCaptionLabel(NULL), + mAccountNameLabel(NULL), + mPanelButtons(NULL), + mConnectButton(NULL), mDisconnectButton(NULL) { - mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this)); - mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this)); - - setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2)); + mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this)); + mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this)); + + setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2)); mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLFacebookStatusPanel::onSend, this)); } BOOL LLFacebookStatusPanel::postBuild() { - mAccountCaptionLabel = getChild("account_caption_label"); - mAccountNameLabel = getChild("account_name_label"); - mPanelButtons = getChild("panel_buttons"); - mConnectButton = getChild("connect_btn"); + mAccountCaptionLabel = getChild("account_caption_label"); + mAccountNameLabel = getChild("account_name_label"); + mPanelButtons = getChild("panel_buttons"); + mConnectButton = getChild("connect_btn"); mDisconnectButton = getChild("disconnect_btn"); mMessageTextEditor = getChild("status_message"); @@ -130,15 +130,15 @@ BOOL LLFacebookStatusPanel::postBuild() void LLFacebookStatusPanel::draw() { - LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); - - //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress - bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; - mDisconnectButton->setEnabled(!disconnecting); - - //Disable the 'connect' button when a connection is in progress - bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; - mConnectButton->setEnabled(!connecting); + LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); + + //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress + bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; + mDisconnectButton->setEnabled(!disconnecting); + + //Disable the 'connect' button when a connection is in progress + bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; + mConnectButton->setEnabled(!connecting); if (mMessageTextEditor && mPostButton && mCancelButton) { @@ -170,18 +170,18 @@ void LLFacebookStatusPanel::onSend() bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data) { - if(LLFacebookConnect::instance().isConnected()) - { - //In process of disconnecting so leave the layout as is - if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) - { - showConnectedLayout(); - } - } - else - { - showDisconnectedLayout(); - } + if(LLFacebookConnect::instance().isConnected()) + { + //In process of disconnecting so leave the layout as is + if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) + { + showConnectedLayout(); + } + } + else + { + showDisconnectedLayout(); + } switch (data.get("enum").asInteger()) { @@ -207,101 +207,101 @@ void LLFacebookStatusPanel::sendStatus() } } -void LLFacebookStatusPanel::onVisibilityChange(BOOL visible) -{ - if(visible) - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); - - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this)); - - //Connected - if(LLFacebookConnect::instance().isConnected()) - { - showConnectedLayout(); - } - //Check if connected (show disconnected layout in meantime) - else - { - showDisconnectedLayout(); - } - if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || - (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) - { - LLFacebookConnect::instance().checkConnectionToFacebook(); - } - } - else - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); - } -} - -bool LLFacebookStatusPanel::onFacebookConnectInfoChange() -{ - LLSD info = LLFacebookConnect::instance().getInfo(); - std::string clickable_name; - - //Strings of format [http://www.somewebsite.com Click Me] become clickable text - if(info.has("link") && info.has("name")) - { - clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; - } - - mAccountNameLabel->setText(clickable_name); - - return false; -} - -void LLFacebookStatusPanel::showConnectButton() -{ - if(!mConnectButton->getVisible()) - { - mConnectButton->setVisible(TRUE); - mDisconnectButton->setVisible(FALSE); - } -} - -void LLFacebookStatusPanel::hideConnectButton() -{ - if(mConnectButton->getVisible()) - { - mConnectButton->setVisible(FALSE); - mDisconnectButton->setVisible(TRUE); - } -} - -void LLFacebookStatusPanel::showDisconnectedLayout() -{ - mAccountCaptionLabel->setText(getString("facebook_disconnected")); - mAccountNameLabel->setText(std::string("")); - showConnectButton(); -} - -void LLFacebookStatusPanel::showConnectedLayout() -{ - LLFacebookConnect::instance().loadFacebookInfo(); - - mAccountCaptionLabel->setText(getString("facebook_connected")); - hideConnectButton(); -} - -void LLFacebookStatusPanel::onConnect() -{ - LLFacebookConnect::instance().checkConnectionToFacebook(true); - - //Clear only the facebook browser cookies so that the facebook login screen appears - LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); -} - -void LLFacebookStatusPanel::onDisconnect() -{ - LLFacebookConnect::instance().disconnectFromFacebook(); - - LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); +void LLFacebookStatusPanel::onVisibilityChange(BOOL visible) +{ + if(visible) + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); + + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this)); + + //Connected + if(LLFacebookConnect::instance().isConnected()) + { + showConnectedLayout(); + } + //Check if connected (show disconnected layout in meantime) + else + { + showDisconnectedLayout(); + } + if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || + (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) + { + LLFacebookConnect::instance().checkConnectionToFacebook(); + } + } + else + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); + } +} + +bool LLFacebookStatusPanel::onFacebookConnectInfoChange() +{ + LLSD info = LLFacebookConnect::instance().getInfo(); + std::string clickable_name; + + //Strings of format [http://www.somewebsite.com Click Me] become clickable text + if(info.has("link") && info.has("name")) + { + clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; + } + + mAccountNameLabel->setText(clickable_name); + + return false; +} + +void LLFacebookStatusPanel::showConnectButton() +{ + if(!mConnectButton->getVisible()) + { + mConnectButton->setVisible(TRUE); + mDisconnectButton->setVisible(FALSE); + } +} + +void LLFacebookStatusPanel::hideConnectButton() +{ + if(mConnectButton->getVisible()) + { + mConnectButton->setVisible(FALSE); + mDisconnectButton->setVisible(TRUE); + } +} + +void LLFacebookStatusPanel::showDisconnectedLayout() +{ + mAccountCaptionLabel->setText(getString("facebook_disconnected")); + mAccountNameLabel->setText(std::string("")); + showConnectButton(); +} + +void LLFacebookStatusPanel::showConnectedLayout() +{ + LLFacebookConnect::instance().loadFacebookInfo(); + + mAccountCaptionLabel->setText(getString("facebook_connected")); + hideConnectButton(); +} + +void LLFacebookStatusPanel::onConnect() +{ + LLFacebookConnect::instance().checkConnectionToFacebook(true); + + //Clear only the facebook browser cookies so that the facebook login screen appears + LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); +} + +void LLFacebookStatusPanel::onDisconnect() +{ + LLFacebookConnect::instance().disconnectFromFacebook(); + + LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); } void LLFacebookStatusPanel::clearAndClose() diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h index 86e3a148b9..f5a27dd5e7 100644 --- a/indra/newview/llfloaterfacebook.h +++ b/indra/newview/llfloaterfacebook.h @@ -51,21 +51,21 @@ public: void clearAndClose(); private: - void onVisibilityChange(BOOL new_visibility); - bool onFacebookConnectInfoChange(); - void onConnect(); - void onUseAnotherAccount(); - void onDisconnect(); - - void showConnectButton(); - void hideConnectButton(); - void showDisconnectedLayout(); - void showConnectedLayout(); - - LLTextBox * mAccountCaptionLabel; - LLTextBox * mAccountNameLabel; - LLUICtrl * mPanelButtons; - LLUICtrl * mConnectButton; + void onVisibilityChange(BOOL new_visibility); + bool onFacebookConnectInfoChange(); + void onConnect(); + void onUseAnotherAccount(); + void onDisconnect(); + + void showConnectButton(); + void hideConnectButton(); + void showDisconnectedLayout(); + void showConnectedLayout(); + + LLTextBox * mAccountCaptionLabel; + LLTextBox * mAccountNameLabel; + LLUICtrl * mPanelButtons; + LLUICtrl * mConnectButton; LLUICtrl * mDisconnectButton; LLUICtrl* mMessageTextEditor; LLUICtrl* mPostButton; -- cgit v1.2.3 From 210ff45bd62fe6aec299a16daa555ad791370df5 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 6 Aug 2014 17:42:29 -0400 Subject: corrected contributions.txt for OPEN-217 --- doc/contributions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index 2e9c1da9a6..12bcb87231 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1202,6 +1202,7 @@ Sovereign Engineer OPEN-189 STORM-1972 OPEN-195 + OPEN-217 SpacedOut Frye VWR-34 VWR-45 -- cgit v1.2.3 From cf159e169573c18b259fdab3ace64c946a0620a1 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 7 Aug 2014 17:32:25 +0300 Subject: MAINT-4325 FIXED [BEAR] Fix to "Reset Filters" causes empty folders to appear in Recent tab of Inventory Clean up - reverted fragment from MAINT-1192, it is no longer needed. --- indra/newview/llinventorypanel.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 4491ec8488..32e5675f5e 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1492,8 +1492,6 @@ public: getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX)); } - /*virtual*/ void onVisibilityChange(BOOL new_visibility); - protected: LLInventoryRecentItemsPanel (const Params&); friend class LLUICtrlFactory; @@ -1506,13 +1504,6 @@ LLInventoryRecentItemsPanel::LLInventoryRecentItemsPanel( const Params& params) mInvFVBridgeBuilder = &RECENT_ITEMS_BUILDER; } -void LLInventoryRecentItemsPanel::onVisibilityChange(BOOL new_visibility) -{ - if(new_visibility) - { - getFilter().setModified(); - } -} namespace LLInitParam { void TypeValues::declareValues() -- cgit v1.2.3 From c43574dbb731f8a73c37f339c21bcffb1341b9a4 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 8 Aug 2014 19:07:21 +0200 Subject: STORM-2059: Removed: Useless 'Current Window' entry in resolution dropdown. We can go up to 512 only anyway. --- indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml index 5782ba7d04..ea579c6dae 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml @@ -47,10 +47,6 @@ name="texture_size_combo" right="-5" top_pad="5"> - Date: Fri, 8 Aug 2014 19:09:08 +0200 Subject: STORM-2057/2058/2061: Changed: Always update snapshot and thumbnail on every change. Making everything only show up the "need to refresh" message seems impossible with the current onIdle system of the preview other than making incredibly hacky stuff. --- indra/newview/llfloatersnapshot.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 2011afc124..97dcae8591 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -576,7 +576,7 @@ void LLFloaterSnapshot::Impl::onClickFilter(LLUICtrl *ctrl, void* data) LLComboBox* filterbox = static_cast(view->getChild("filters_combobox")); std::string filter_name = (filterbox->getCurrentIndex() ? filterbox->getSimple() : ""); previewp->setFilter(filter_name); - previewp->updateSnapshot(FALSE, TRUE); + previewp->updateSnapshot(TRUE); } } } @@ -825,12 +825,11 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL // hide old preview as the aspect ratio could be wrong checkAutoSnapshot(previewp, FALSE); LL_DEBUGS() << "updating thumbnail" << LL_ENDL; - getPreviewView(view)->updateSnapshot(FALSE, TRUE); + getPreviewView(view)->updateSnapshot(TRUE); if(do_update) { LL_DEBUGS() << "Will update controls" << LL_ENDL; updateControls(view); - setNeedRefresh(view, true); } } } @@ -873,7 +872,6 @@ void LLFloaterSnapshot::Impl::onImageFormatChange(LLFloaterSnapshot* view) LL_DEBUGS() << "image format changed, updating snapshot" << LL_ENDL; getPreviewView(view)->updateSnapshot(TRUE); updateControls(view); - setNeedRefresh(view, false); // we're refreshing } } @@ -951,8 +949,6 @@ void LLFloaterSnapshot::Impl::updateSpinners(LLFloaterSnapshot* view, LLSnapshot // static void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32 w, S32 h) { - bool need_refresh = false; - LL_DEBUGS() << "applyCustomResolution(" << w << ", " << h << ")" << LL_ENDL; if (!view) return; @@ -970,20 +966,15 @@ void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32 previewp->setSize(w,h); checkAutoSnapshot(previewp, FALSE); LL_DEBUGS() << "applied custom resolution, updating thumbnail" << LL_ENDL; - previewp->updateSnapshot(FALSE, TRUE); + previewp->updateSnapshot(TRUE); comboSetCustom(view, "profile_size_combo"); comboSetCustom(view, "postcard_size_combo"); comboSetCustom(view, "texture_size_combo"); comboSetCustom(view, "local_size_combo"); - need_refresh = true; } } updateControls(view); - if (need_refresh) - { - setNeedRefresh(view, true); // need to do this after updateControls() - } } // static @@ -1238,8 +1229,6 @@ S32 LLFloaterSnapshot::notify(const LLSD& info) { // Disable the send/post/save buttons until snapshot is ready. impl.updateControls(this); - // Force hiding the "Refresh to save" hint because we know we've just started refresh. - impl.setNeedRefresh(this, false); return 1; } -- cgit v1.2.3 From edc1a4efd379d64b2cfda0401800b9ebd0cbb54e Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 8 Aug 2014 20:54:01 +0200 Subject: STORM-2060: Fixed: Width/Height spinners resetting every time type a custom value while 'custom' is not set in the resolution dropdown. --- indra/newview/llfloatersnapshot.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 97dcae8591..beb06c4162 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -965,16 +965,14 @@ void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32 previewp->setSize(w,h); checkAutoSnapshot(previewp, FALSE); - LL_DEBUGS() << "applied custom resolution, updating thumbnail" << LL_ENDL; - previewp->updateSnapshot(TRUE); comboSetCustom(view, "profile_size_combo"); comboSetCustom(view, "postcard_size_combo"); comboSetCustom(view, "texture_size_combo"); comboSetCustom(view, "local_size_combo"); + LL_DEBUGS() << "applied custom resolution, updating thumbnail" << LL_ENDL; + previewp->updateSnapshot(TRUE); } } - - updateControls(view); } // static -- cgit v1.2.3 From 06b605b8666f2336e77126f8ff47765115c08a27 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 8 Aug 2014 15:20:28 -0400 Subject: MAINT-4257 WIP - already fixed by MAINT-4286, added some warnings --- indra/newview/llaisapi.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 623458cb08..96de15bf75 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -385,6 +385,10 @@ void AISUpdate::parseMeta(const LLSD& update) mCatDescendentDeltas[cat->getParentUUID()]--; mObjectsDeletedIds.insert(*it); } + else + { + LL_WARNS("Inventory") << "removed category not found " << *it << LL_ENDL; + } } // parse _categories_items_removed -> mObjectsDeletedIds @@ -400,6 +404,10 @@ void AISUpdate::parseMeta(const LLSD& update) mCatDescendentDeltas[item->getParentUUID()]--; mObjectsDeletedIds.insert(*it); } + else + { + LL_WARNS("Inventory") << "removed item not found " << *it << LL_ENDL; + } } // parse _broken_links_removed -> mObjectsDeletedIds @@ -414,6 +422,10 @@ void AISUpdate::parseMeta(const LLSD& update) mCatDescendentDeltas[item->getParentUUID()]--; mObjectsDeletedIds.insert(*it); } + else + { + LL_WARNS("Inventory") << "broken link not found " << *it << LL_ENDL; + } } // parse _created_items @@ -804,7 +816,7 @@ void AISUpdate::doUpdate() // Since this is a copy of the category *before* the accounting update, above, // we need to transfer back the updated version/descendent count. LLViewerInventoryCategory* curr_cat = gInventory.getCategory(new_category->getUUID()); - if (NULL == curr_cat) + if (!curr_cat) { LL_WARNS("Inventory") << "Failed to update unknown category " << new_category->getUUID() << LL_ENDL; } -- cgit v1.2.3 From aaf4428fad7796417934dbc9c6ccf2b01ab285d3 Mon Sep 17 00:00:00 2001 From: NiranV Date: Sat, 9 Aug 2014 02:14:01 +0200 Subject: STORM-2066: Fixed: Selecting a resolution dropdown bigger than the maximum window resolution with toggled "Show UI in Snapshot" freezes the Viewer. --- indra/newview/llfloatersnapshot.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index beb06c4162..f927b50092 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -758,6 +758,12 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL S32 original_width = 0 , original_height = 0 ; previewp->getSize(original_width, original_height) ; + if (gSavedSettings.getBOOL("RenderUIInSnapshot") || gSavedSettings.getBOOL("RenderHUDInSnapshot")) + { //clamp snapshot resolution to window size when showing UI or HUD in snapshot + width = llmin(width, gViewerWindow->getWindowWidthRaw()); + height = llmin(height, gViewerWindow->getWindowHeightRaw()); + } + if (width == 0 || height == 0) { // take resolution from current window size @@ -803,12 +809,6 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL checkAspectRatio(view, width) ; previewp->getSize(width, height); - - if (gSavedSettings.getBOOL("RenderUIInSnapshot") || gSavedSettings.getBOOL("RenderHUDInSnapshot")) - { //clamp snapshot resolution to window size when showing UI or HUD in snapshot - width = llmin(width, gViewerWindow->getWindowWidthRaw()); - height = llmin(height, gViewerWindow->getWindowHeightRaw()); - } updateSpinners(view, previewp, width, height, TRUE); // may change width and height -- cgit v1.2.3 From beb471287eb0dfad55866209bc294f628b58d658 Mon Sep 17 00:00:00 2001 From: NiranV Date: Sat, 9 Aug 2014 02:21:17 +0200 Subject: STORM-2065: Added: 'Scanlines' filter, we now got a 'Video' one for that poorly recorded bright video style and one that looks like only scanlines were added. --- indra/newview/app_settings/filters/Scanlines.xml | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 indra/newview/app_settings/filters/Scanlines.xml diff --git a/indra/newview/app_settings/filters/Scanlines.xml b/indra/newview/app_settings/filters/Scanlines.xml new file mode 100644 index 0000000000..9f0c3ac318 --- /dev/null +++ b/indra/newview/app_settings/filters/Scanlines.xml @@ -0,0 +1,41 @@ + + + + linearize + 0.0 + 1.0 + 1.0 + 1.0 + + + saturate + 2.0 + + + stencil + uniform + blend + 0.0 + 0.5 + + + screen + line + 0.02 + 0.02 + + + gamma + 1.75 + 1.0 + 1.0 + 1.0 + + + blur + + + blur + + + -- cgit v1.2.3 From acf278cea1b3f71a2c548798b106e1959b7c485d Mon Sep 17 00:00:00 2001 From: NiranV Date: Sat, 9 Aug 2014 02:29:23 +0200 Subject: STORM-2063: Fixed: Resolution text appearing for a brief moment when updating the controls while the preview is hidden. --- indra/newview/skins/default/xui/en/floater_snapshot.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 4b8f4c8fed..8451814c47 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -420,10 +420,11 @@ type="string" font="SansSerifSmall" length="1" - follows="left|top" + follows="left|top|right" height="14" layout="topleft" - left_delta="5" + left="220" + right="-20" halign="left" name="image_res_text" top_delta="5" -- cgit v1.2.3 From 0762c71bbe006d48de767a119c9b238f552b11b4 Mon Sep 17 00:00:00 2001 From: NiranV Date: Sat, 9 Aug 2014 02:31:47 +0200 Subject: STORM-2064: Changed: Made background of status text invisible. --- indra/newview/skins/default/xui/en/floater_snapshot.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 8451814c47..c0907d6031 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -326,8 +326,7 @@ Date: Sun, 10 Aug 2014 21:14:16 +0200 Subject: STORM-2064: Changed: 'Scanlines' filter to a original picture like look with scanlines. --- indra/newview/app_settings/filters/Scanlines.xml | 25 +++++++----------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/indra/newview/app_settings/filters/Scanlines.xml b/indra/newview/app_settings/filters/Scanlines.xml index 9f0c3ac318..e9ba2889fa 100644 --- a/indra/newview/app_settings/filters/Scanlines.xml +++ b/indra/newview/app_settings/filters/Scanlines.xml @@ -7,26 +7,18 @@ 1.0 1.0 - - saturate - 2.0 - stencil - uniform - blend + scanlines + add-back 0.0 - 0.5 - - - screen - line - 0.02 - 0.02 + 1.0 + 0.015 + 0 gamma - 1.75 + 0.5 1.0 1.0 1.0 @@ -34,8 +26,5 @@ blur - - blur - - + \ No newline at end of file -- cgit v1.2.3 From 8b51aa1f646658669857638eb4050518f95b2fc2 Mon Sep 17 00:00:00 2001 From: NiranV Date: Sun, 10 Aug 2014 21:16:22 +0200 Subject: Changed: 'Black and White' filter to proper b&w only. No corrections, just plain greyscale. --- indra/newview/app_settings/filters/BlackAndWhite.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/indra/newview/app_settings/filters/BlackAndWhite.xml b/indra/newview/app_settings/filters/BlackAndWhite.xml index 101ed8233a..7894628d29 100644 --- a/indra/newview/app_settings/filters/BlackAndWhite.xml +++ b/indra/newview/app_settings/filters/BlackAndWhite.xml @@ -1,19 +1,5 @@ - - linearize - 0.01 - 1.0 - 1.0 - 1.0 - - - contrast - 0.8 - 1.0 - 1.0 - 1.0 - grayscale -- cgit v1.2.3 From 31519b6fed053174a96413c5cfc763e55b059a9b Mon Sep 17 00:00:00 2001 From: NiranV Date: Sun, 10 Aug 2014 21:16:44 +0200 Subject: Changed: 'Sepia' filter to proper sepia only. No corrections, just plain sepia colors. --- indra/newview/app_settings/filters/Sepia.xml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/indra/newview/app_settings/filters/Sepia.xml b/indra/newview/app_settings/filters/Sepia.xml index 3d577b2998..81d7caf0eb 100644 --- a/indra/newview/app_settings/filters/Sepia.xml +++ b/indra/newview/app_settings/filters/Sepia.xml @@ -1,30 +1,5 @@ - - linearize - 0.01 - 1.0 - 1.0 - 1.0 - - - contrast - 0.8 - 1.0 - 1.0 - 1.0 - - - stencil - vignette - fade - 0.5 - 1.0 - 0.0 - 0.0 - 1.0 - 4.0 - sepia -- cgit v1.2.3 From ea96b9cc3286d346108c73498b4ed18e43d50098 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 12 Aug 2014 15:36:17 -0400 Subject: Remove now-unused mac_updater subtree from viewer source. --- indra/mac_updater/mac_updater.cpp | 1266 ------------------------------------- 1 file changed, 1266 deletions(-) delete mode 100644 indra/mac_updater/mac_updater.cpp diff --git a/indra/mac_updater/mac_updater.cpp b/indra/mac_updater/mac_updater.cpp deleted file mode 100644 index f533d47b18..0000000000 --- a/indra/mac_updater/mac_updater.cpp +++ /dev/null @@ -1,1266 +0,0 @@ -/** - * @file mac_updater.cpp - * @brief - * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "linden_common.h" - -#include - -#include -#include -#include -#include - -#include -#include - -#include "llerror.h" -#include "lltimer.h" -#include "lldir.h" -#include "llfile.h" - -#include "llstring.h" - -#include - -#include "llerrorcontrol.h" - -#if LL_DARWIN -// FSPathMakeRef, FSObjectCopy, deprecations... -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -enum -{ - kEventClassCustom = 'Cust', - kEventCustomProgress = 'Prog', - kEventParamCustomCurValue = 'Cur ', - kEventParamCustomMaxValue = 'Max ', - kEventParamCustomText = 'Text', - kEventCustomDone = 'Done', -}; - -WindowRef gWindow = NULL; -EventHandlerRef gEventHandler = NULL; -OSStatus gFailure = noErr; -Boolean gCancelled = false; - -const char *gUpdateURL; -const char *gProductName; -const char *gBundleID; -const char *gDmgFile; -const char *gMarkerPath; - -void *updatethreadproc(void*); - -pthread_t updatethread; - -OSStatus setProgress(int cur, int max) -{ - OSStatus err; - ControlRef progressBar = NULL; - ControlID id; - - id.signature = 'prog'; - id.id = 0; - - err = GetControlByID(gWindow, &id, &progressBar); - if(err == noErr) - { - Boolean indeterminate; - - if(max == 0) - { - indeterminate = true; - err = SetControlData(progressBar, kControlEntireControl, kControlProgressBarIndeterminateTag, sizeof(Boolean), (Ptr)&indeterminate); - } - else - { - double percentage = (double)cur / (double)max; - SetControlMinimum(progressBar, 0); - SetControlMaximum(progressBar, 100); - SetControlValue(progressBar, (SInt16)(percentage * 100)); - - indeterminate = false; - err = SetControlData(progressBar, kControlEntireControl, kControlProgressBarIndeterminateTag, sizeof(Boolean), (Ptr)&indeterminate); - - Draw1Control(progressBar); - } - } - - return(err); -} - -OSStatus setProgressText(CFStringRef text) -{ - OSStatus err; - ControlRef progressText = NULL; - ControlID id; - - id.signature = 'what'; - id.id = 0; - - err = GetControlByID(gWindow, &id, &progressText); - if(err == noErr) - { - err = SetControlData(progressText, kControlEntireControl, kControlStaticTextCFStringTag, sizeof(CFStringRef), (Ptr)&text); - Draw1Control(progressText); - } - - return(err); -} - -OSStatus sendProgress(long cur, long max, CFStringRef text = NULL) -{ - OSStatus result; - EventRef evt; - - result = CreateEvent( - NULL, - kEventClassCustom, - kEventCustomProgress, - 0, - kEventAttributeNone, - &evt); - - // This event needs to be targeted at the window so it goes to the window's handler. - if(result == noErr) - { - EventTargetRef target = GetWindowEventTarget(gWindow); - result = SetEventParameter ( - evt, - kEventParamPostTarget, - typeEventTargetRef, - sizeof(target), - &target); - } - - if(result == noErr) - { - result = SetEventParameter ( - evt, - kEventParamCustomCurValue, - typeLongInteger, - sizeof(cur), - &cur); - } - - if(result == noErr) - { - result = SetEventParameter ( - evt, - kEventParamCustomMaxValue, - typeLongInteger, - sizeof(max), - &max); - } - - if(result == noErr) - { - if(text != NULL) - { - result = SetEventParameter ( - evt, - kEventParamCustomText, - typeCFStringRef, - sizeof(text), - &text); - } - } - - if(result == noErr) - { - // Send the event - PostEventToQueue( - GetMainEventQueue(), - evt, - kEventPriorityStandard); - - } - - return(result); -} - -OSStatus sendDone(void) -{ - OSStatus result; - EventRef evt; - - result = CreateEvent( - NULL, - kEventClassCustom, - kEventCustomDone, - 0, - kEventAttributeNone, - &evt); - - // This event needs to be targeted at the window so it goes to the window's handler. - if(result == noErr) - { - EventTargetRef target = GetWindowEventTarget(gWindow); - result = SetEventParameter ( - evt, - kEventParamPostTarget, - typeEventTargetRef, - sizeof(target), - &target); - } - - if(result == noErr) - { - // Send the event - PostEventToQueue( - GetMainEventQueue(), - evt, - kEventPriorityStandard); - - } - - return(result); -} - -OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata) -{ - OSStatus result = eventNotHandledErr; - OSStatus err; - UInt32 evtClass = GetEventClass(event); - UInt32 evtKind = GetEventKind(event); - - if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) - { - HICommand cmd; - err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); - - if(err == noErr) - { - switch(cmd.commandID) - { - case kHICommandCancel: - gCancelled = true; -// QuitAppModalLoopForWindow(gWindow); - result = noErr; - break; - } - } - } - else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomProgress)) - { - // Request to update the progress dialog - long cur = 0; - long max = 0; - CFStringRef text = NULL; - (void) GetEventParameter(event, kEventParamCustomCurValue, typeLongInteger, NULL, sizeof(cur), NULL, &cur); - (void) GetEventParameter(event, kEventParamCustomMaxValue, typeLongInteger, NULL, sizeof(max), NULL, &max); - (void) GetEventParameter(event, kEventParamCustomText, typeCFStringRef, NULL, sizeof(text), NULL, &text); - - err = setProgress(cur, max); - if(err == noErr) - { - if(text != NULL) - { - setProgressText(text); - } - } - - result = noErr; - } - else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomDone)) - { - // We're done. Exit the modal loop. - QuitAppModalLoopForWindow(gWindow); - result = noErr; - } - - return(result); -} - -#if 0 -size_t curl_download_callback(void *data, size_t size, size_t nmemb, - void *user_data) -{ - S32 bytes = size * nmemb; - char *cdata = (char *) data; - for (int i =0; i < bytes; i += 1) - { - gServerResponse.append(cdata[i]); - } - return bytes; -} -#endif - -int curl_progress_callback_func(void *clientp, - double dltotal, - double dlnow, - double ultotal, - double ulnow) -{ - int max = (int)(dltotal / 1024.0); - int cur = (int)(dlnow / 1024.0); - sendProgress(cur, max); - - if(gCancelled) - return(1); - - return(0); -} - -int parse_args(int argc, char **argv) -{ - int j; - - for (j = 1; j < argc; j++) - { - if ((!strcmp(argv[j], "-url")) && (++j < argc)) - { - gUpdateURL = argv[j]; - } - else if ((!strcmp(argv[j], "-name")) && (++j < argc)) - { - gProductName = argv[j]; - } - else if ((!strcmp(argv[j], "-bundleid")) && (++j < argc)) - { - gBundleID = argv[j]; - } - else if ((!strcmp(argv[j], "-dmg")) && (++j < argc)) - { - gDmgFile = argv[j]; - } - else if ((!strcmp(argv[j], "-marker")) && (++j < argc)) - { - gMarkerPath = argv[j];; - } - } - - return 0; -} - -int main(int argc, char **argv) -{ - // We assume that all the logs we're looking for reside on the current drive - gDirUtilp->initAppDirs("SecondLife"); - - LLError::initForApplication( gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); - - // Rename current log file to ".old" - std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log.old"); - std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log"); - LLFile::rename(log_file.c_str(), old_log_file.c_str()); - - // Set the log file to updater.log - LLError::logToFile(log_file); - - ///////////////////////////////////////// - // - // Process command line arguments - // - gUpdateURL = NULL; - gProductName = NULL; - gBundleID = NULL; - gDmgFile = NULL; - gMarkerPath = NULL; - parse_args(argc, argv); - if ((gUpdateURL == NULL) && (gDmgFile == NULL)) - { - llinfos << "Usage: mac_updater -url | -dmg [-name ] [-program ]" << llendl; - exit(1); - } - else - { - llinfos << "Update url is: " << gUpdateURL << llendl; - if (gProductName) - { - llinfos << "Product name is: " << gProductName << llendl; - } - else - { - gProductName = "Second Life"; - } - if (gBundleID) - { - llinfos << "Bundle ID is: " << gBundleID << llendl; - } - else - { - gBundleID = "com.secondlife.indra.viewer"; - } - } - - llinfos << "Starting " << gProductName << " Updater" << llendl; - - // Real UI... - OSStatus err; - IBNibRef nib = NULL; - - err = CreateNibReference(CFSTR("AutoUpdater"), &nib); - - char windowTitle[MAX_PATH]; /* Flawfinder: ignore */ - snprintf(windowTitle, sizeof(windowTitle), "%s Updater", gProductName); - CFStringRef windowTitleRef = NULL; - windowTitleRef = CFStringCreateWithCString(NULL, windowTitle, kCFStringEncodingUTF8); - - if(err == noErr) - { - err = CreateWindowFromNib(nib, CFSTR("Updater"), &gWindow); - } - - if (err == noErr) - { - err = SetWindowTitleWithCFString(gWindow, windowTitleRef); - } - CFRelease(windowTitleRef); - - if(err == noErr) - { - // Set up an event handler for the window. - EventTypeSpec handlerEvents[] = - { - { kEventClassCommand, kEventCommandProcess }, - { kEventClassCustom, kEventCustomProgress }, - { kEventClassCustom, kEventCustomDone } - }; - InstallStandardEventHandler(GetWindowEventTarget(gWindow)); - InstallWindowEventHandler( - gWindow, - NewEventHandlerUPP(dialogHandler), - GetEventTypeCount (handlerEvents), - handlerEvents, - 0, - &gEventHandler); - } - - if(err == noErr) - { - ShowWindow(gWindow); - SelectWindow(gWindow); - } - - if(err == noErr) - { - pthread_create(&updatethread, - NULL, - &updatethreadproc, - NULL); - - } - - if(err == noErr) - { - RunAppModalLoopForWindow(gWindow); - } - - void *threadresult; - - pthread_join(updatethread, &threadresult); - - if(!gCancelled && (gFailure != noErr)) - { - // Something went wrong. Since we always just tell the user to download a new version, we don't really care what. - AlertStdCFStringAlertParamRec params; - SInt16 retval_mac = 1; - DialogRef alert = NULL; - OSStatus err; - - params.version = kStdCFStringAlertVersionOne; - params.movable = false; - params.helpButton = false; - params.defaultText = (CFStringRef)kAlertDefaultOKText; - params.cancelText = 0; - params.otherText = 0; - params.defaultButton = 1; - params.cancelButton = 0; - params.position = kWindowDefaultPosition; - params.flags = 0; - - err = CreateStandardAlert( - kAlertStopAlert, - CFSTR("Error"), - CFSTR("An error occurred while updating Second Life. Please download the latest version from www.secondlife.com."), - ¶ms, - &alert); - - if(err == noErr) - { - err = RunStandardAlert( - alert, - NULL, - &retval_mac); - } - - if(gMarkerPath != 0) - { - // Create a install fail marker that can be used by the viewer to - // detect install problems. - std::ofstream stream(gMarkerPath); - if(stream) stream << -1; - } - exit(-1); - } else { - exit(0); - } - - if(gWindow != NULL) - { - DisposeWindow(gWindow); - } - - if(nib != NULL) - { - DisposeNibReference(nib); - } - - return 0; -} - -bool isDirWritable(FSRef &dir) -{ - bool result = false; - - // Test for a writable directory by creating a directory, then deleting it again. - // This is kinda lame, but will pretty much always give the right answer. - - OSStatus err = noErr; - char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ - - err = FSRefMakePath(&dir, (UInt8*)temp, sizeof(temp)); - - if(err == noErr) - { - strncat(temp, "/.test_XXXXXX", (sizeof(temp) - strlen(temp)) - 1); - - if(mkdtemp(temp) != NULL) - { - // We were able to make the directory. This means the directory is writable. - result = true; - - // Clean up. - rmdir(temp); - } - } - -#if 0 - // This seemed like a good idea, but won't tell us if we're on a volume mounted read-only. - UInt8 perm; - err = FSGetUserPrivilegesPermissions(&targetParentRef, &perm, NULL); - if(err == noErr) - { - if(perm & kioACUserNoMakeChangesMask) - { - // Parent directory isn't writable. - llinfos << "Target parent directory not writable." << llendl; - err = -1; - replacingTarget = false; - } - } -#endif - - return result; -} - -static std::string HFSUniStr255_to_utf8str(const HFSUniStr255* src) -{ - llutf16string string16((U16*)&(src->unicode), src->length); - std::string result = utf16str_to_utf8str(string16); - return result; -} - -int restoreObject(const char* aside, const char* target, const char* path, const char* object) -{ - char source[PATH_MAX] = ""; /* Flawfinder: ignore */ - char dest[PATH_MAX] = ""; /* Flawfinder: ignore */ - snprintf(source, sizeof(source), "%s/%s/%s", aside, path, object); - snprintf(dest, sizeof(dest), "%s/%s", target, path); - FSRef sourceRef; - FSRef destRef; - OSStatus err; - err = FSPathMakeRef((UInt8 *)source, &sourceRef, NULL); - if(err != noErr) return false; - err = FSPathMakeRef((UInt8 *)dest, &destRef, NULL); - if(err != noErr) return false; - - llinfos << "Copying " << source << " to " << dest << llendl; - - err = FSCopyObjectSync( - &sourceRef, - &destRef, - NULL, - NULL, - kFSFileOperationOverwrite); - - if(err != noErr) return false; - return true; -} - -// Replace any mention of "Second Life" with the product name. -void filterFile(const char* filename) -{ - char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ - // First copy the target's version, so we can run it through sed. - snprintf(temp, sizeof(temp), "cp '%s' '%s.tmp'", filename, filename); - system(temp); /* Flawfinder: ignore */ - - // Now run it through sed. - snprintf(temp, sizeof(temp), - "sed 's/Second Life/%s/g' '%s.tmp' > '%s'", gProductName, filename, filename); - system(temp); /* Flawfinder: ignore */ -} - -static bool isFSRefViewerBundle(FSRef *targetRef) -{ - bool result = false; - CFURLRef targetURL = NULL; - CFBundleRef targetBundle = NULL; - CFStringRef targetBundleID = NULL; - CFStringRef sourceBundleID = NULL; - - targetURL = CFURLCreateFromFSRef(NULL, targetRef); - - if(targetURL == NULL) - { - llinfos << "Error creating target URL." << llendl; - } - else - { - targetBundle = CFBundleCreate(NULL, targetURL); - } - - if(targetBundle == NULL) - { - llinfos << "Failed to create target bundle." << llendl; - } - else - { - targetBundleID = CFBundleGetIdentifier(targetBundle); - } - - if(targetBundleID == NULL) - { - llinfos << "Couldn't retrieve target bundle ID." << llendl; - } - else - { - sourceBundleID = CFStringCreateWithCString(NULL, gBundleID, kCFStringEncodingUTF8); - if(CFStringCompare(sourceBundleID, targetBundleID, 0) == kCFCompareEqualTo) - { - // This is the bundle we're looking for. - result = true; - } - else - { - llinfos << "Target bundle ID mismatch." << llendl; - } - } - - // Don't release targetBundleID -- since we don't retain it, it's released when targetBundle is released. - if(targetURL != NULL) - CFRelease(targetURL); - if(targetBundle != NULL) - CFRelease(targetBundle); - - return result; -} - -// Search through the directory specified by 'parent' for an item that appears to be a Second Life viewer. -static OSErr findAppBundleOnDiskImage(FSRef *parent, FSRef *app) -{ - FSIterator iterator; - bool found = false; - - OSErr err = FSOpenIterator( parent, kFSIterateFlat, &iterator ); - if(!err) - { - do - { - ItemCount actualObjects = 0; - Boolean containerChanged = false; - FSCatalogInfo info; - FSRef ref; - HFSUniStr255 unicodeName; - err = FSGetCatalogInfoBulk( - iterator, - 1, - &actualObjects, - &containerChanged, - kFSCatInfoNodeFlags, - &info, - &ref, - NULL, - &unicodeName ); - - if(actualObjects == 0) - break; - - if(!err) - { - // Call succeeded and not done with the iteration. - std::string name = HFSUniStr255_to_utf8str(&unicodeName); - - llinfos << "Considering \"" << name << "\"" << llendl; - - if(info.nodeFlags & kFSNodeIsDirectoryMask) - { - // This is a directory. See if it's a .app - if(name.find(".app") != std::string::npos) - { - // Looks promising. Check to see if it has the right bundle identifier. - if(isFSRefViewerBundle(&ref)) - { - llinfos << name << " is the one" << llendl; - // This is the one. Return it. - *app = ref; - found = true; - break; - } else { - llinfos << name << " is not the bundle we are looking for; move along" << llendl; - } - - } - } - } - } - while(!err); - - llinfos << "closing the iterator" << llendl; - - FSCloseIterator(iterator); - - llinfos << "closed" << llendl; - } - - if(!err && !found) - err = fnfErr; - - return err; -} - -void *updatethreadproc(void*) -{ - char tempDir[PATH_MAX] = ""; /* Flawfinder: ignore */ - FSRef tempDirRef; - char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ - // *NOTE: This buffer length is used in a scanf() below. - char deviceNode[1024] = ""; /* Flawfinder: ignore */ - LLFILE *downloadFile = NULL; - OSStatus err; - ProcessSerialNumber psn; - char target[PATH_MAX] = ""; /* Flawfinder: ignore */ - FSRef targetRef; - FSRef targetParentRef; - FSVolumeRefNum targetVol; - FSRef trashFolderRef; - Boolean replacingTarget = false; - - memset(&tempDirRef, 0, sizeof(tempDirRef)); - memset(&targetRef, 0, sizeof(targetRef)); - memset(&targetParentRef, 0, sizeof(targetParentRef)); - - try - { - // Attempt to get a reference to the Second Life application bundle containing this updater. - // Any failures during this process will cause us to default to updating /Applications/Second Life.app - { - FSRef myBundle; - - err = GetCurrentProcess(&psn); - if(err == noErr) - { - err = GetProcessBundleLocation(&psn, &myBundle); - } - - if(err == noErr) - { - // Sanity check: Make sure the name of the item referenced by targetRef is "Second Life.app". - FSRefMakePath(&myBundle, (UInt8*)target, sizeof(target)); - - llinfos << "Updater bundle location: " << target << llendl; - } - - // Our bundle should be in Second Life.app/Contents/Resources/AutoUpdater.app - // so we need to go up 3 levels to get the path to the main application bundle. - if(err == noErr) - { - err = FSGetCatalogInfo(&myBundle, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); - } - if(err == noErr) - { - err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); - } - if(err == noErr) - { - err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); - } - - // And once more to get the parent of the target - if(err == noErr) - { - err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetParentRef); - } - - if(err == noErr) - { - FSRefMakePath(&targetRef, (UInt8*)target, sizeof(target)); - llinfos << "Path to target: " << target << llendl; - } - - // Sanity check: make sure the target is a bundle with the right identifier - if(err == noErr) - { - // Assume the worst... - err = -1; - - if(isFSRefViewerBundle(&targetRef)) - { - // This is the bundle we're looking for. - err = noErr; - replacingTarget = true; - } - } - - // Make sure the target's parent directory is writable. - if(err == noErr) - { - if(!isDirWritable(targetParentRef)) - { - // Parent directory isn't writable. - llinfos << "Target parent directory not writable." << llendl; - err = -1; - replacingTarget = false; - } - } - - if(err != noErr) - { - Boolean isDirectory; - llinfos << "Target search failed, defaulting to /Applications/" << gProductName << ".app." << llendl; - - // Set up the parent directory - err = FSPathMakeRef((UInt8*)"/Applications", &targetParentRef, &isDirectory); - if((err != noErr) || (!isDirectory)) - { - // We're so hosed. - llinfos << "Applications directory not found, giving up." << llendl; - throw 0; - } - - snprintf(target, sizeof(target), "/Applications/%s.app", gProductName); - - memset(&targetRef, 0, sizeof(targetRef)); - err = FSPathMakeRef((UInt8*)target, &targetRef, NULL); - if(err == fnfErr) - { - // This is fine, just means we're not replacing anything. - err = noErr; - replacingTarget = false; - } - else - { - replacingTarget = true; - } - - // Make sure the target's parent directory is writable. - if(err == noErr) - { - if(!isDirWritable(targetParentRef)) - { - // Parent directory isn't writable. - llinfos << "Target parent directory not writable." << llendl; - err = -1; - replacingTarget = false; - } - } - - } - - // If we haven't fixed all problems by this point, just bail. - if(err != noErr) - { - llinfos << "Unable to pick a target, giving up." << llendl; - throw 0; - } - } - - // Find the volID of the volume the target resides on - { - FSCatalogInfo info; - err = FSGetCatalogInfo( - &targetParentRef, - kFSCatInfoVolume, - &info, - NULL, - NULL, - NULL); - - if(err != noErr) - throw 0; - - targetVol = info.volume; - } - - // Find the temporary items and trash folders on that volume. - err = FSFindFolder( - targetVol, - kTrashFolderType, - true, - &trashFolderRef); - - if(err != noErr) - throw 0; - -#if 0 // *HACK for DEV-11935 see below for details. - - FSRef tempFolderRef; - - err = FSFindFolder( - targetVol, - kTemporaryFolderType, - true, - &tempFolderRef); - - if(err != noErr) - throw 0; - - err = FSRefMakePath(&tempFolderRef, (UInt8*)temp, sizeof(temp)); - - if(err != noErr) - throw 0; - -#else - - // *HACK for DEV-11935 the above kTemporaryFolderType query was giving - // back results with path names that seem to be too long to be used as - // mount points. I suspect this incompatibility was introduced in the - // Leopard 10.5.2 update, but I have not verified this. - char const HARDCODED_TMP[] = "/tmp"; - strncpy(temp, HARDCODED_TMP, sizeof(HARDCODED_TMP)); - -#endif // 0 *HACK for DEV-11935 - - // Skip downloading the file if the dmg was passed on the command line. - std::string dmgName; - if(gDmgFile != NULL) { - dmgName = basename((char *)gDmgFile); - char * dmgDir = dirname((char *)gDmgFile); - strncpy(tempDir, dmgDir, sizeof(tempDir)); - err = FSPathMakeRef((UInt8*)tempDir, &tempDirRef, NULL); - if(err != noErr) throw 0; - chdir(tempDir); - goto begin_install; - } else { - // Continue on to download file. - dmgName = "SecondLife.dmg"; - } - - - strncat(temp, "/SecondLifeUpdate_XXXXXX", (sizeof(temp) - strlen(temp)) - 1); - if(mkdtemp(temp) == NULL) - { - throw 0; - } - - strncpy(tempDir, temp, sizeof(tempDir)); - temp[sizeof(tempDir) - 1] = '\0'; - - llinfos << "tempDir is " << tempDir << llendl; - - err = FSPathMakeRef((UInt8*)tempDir, &tempDirRef, NULL); - - if(err != noErr) - throw 0; - - chdir(tempDir); - - snprintf(temp, sizeof(temp), "SecondLife.dmg"); - - downloadFile = LLFile::fopen(temp, "wb"); /* Flawfinder: ignore */ - if(downloadFile == NULL) - { - throw 0; - } - - { - CURL *curl = curl_easy_init(); - - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); - // curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &curl_download_callback); - curl_easy_setopt(curl, CURLOPT_FILE, downloadFile); - curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); - curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, &curl_progress_callback_func); - curl_easy_setopt(curl, CURLOPT_URL, gUpdateURL); - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); - - sendProgress(0, 1, CFSTR("Downloading...")); - - CURLcode result = curl_easy_perform(curl); - - curl_easy_cleanup(curl); - - if(gCancelled) - { - llinfos << "User cancel, bailing out."<< llendl; - throw 0; - } - - if(result != CURLE_OK) - { - llinfos << "Error " << result << " while downloading disk image."<< llendl; - throw 0; - } - - fclose(downloadFile); - downloadFile = NULL; - } - - begin_install: - sendProgress(0, 0, CFSTR("Mounting image...")); - LLFile::mkdir("mnt", 0700); - - // NOTE: we could add -private at the end of this command line to keep the image from showing up in the Finder, - // but if our cleanup fails, this makes it much harder for the user to unmount the image. - std::string mountOutput; - boost::format cmdFormat("hdiutil attach %s -mountpoint mnt"); - cmdFormat % dmgName; - FILE* mounter = popen(cmdFormat.str().c_str(), "r"); /* Flawfinder: ignore */ - - if(mounter == NULL) - { - llinfos << "Failed to mount disk image, exiting."<< llendl; - throw 0; - } - - // We need to scan the output from hdiutil to find the device node it uses to attach the disk image. - // If we don't have this information, we can't detach it later. - while(mounter != NULL) - { - size_t len = fread(temp, 1, sizeof(temp)-1, mounter); - temp[len] = 0; - mountOutput.append(temp); - if(len < sizeof(temp)-1) - { - // End of file or error. - int result = pclose(mounter); - if(result != 0) - { - // NOTE: We used to abort here, but pclose() started returning - // -1, possibly when the size of the DMG passed a certain point - llinfos << "Unexpected result closing pipe: " << result << llendl; - } - mounter = NULL; - } - } - - if(!mountOutput.empty()) - { - const char *s = mountOutput.c_str(); - const char *prefix = "/dev/"; - char *sub = strstr(s, prefix); - - if(sub != NULL) - { - sub += strlen(prefix); /* Flawfinder: ignore */ - sscanf(sub, "%1023s", deviceNode); /* Flawfinder: ignore */ - } - } - - if(deviceNode[0] != 0) - { - llinfos << "Disk image attached on /dev/" << deviceNode << llendl; - } - else - { - llinfos << "Disk image device node not found!" << llendl; - throw 0; - } - - // Get an FSRef to the new application on the disk image - FSRef sourceRef; - FSRef mountRef; - snprintf(temp, sizeof(temp), "%s/mnt", tempDir); - - llinfos << "Disk image mount point is: " << temp << llendl; - - err = FSPathMakeRef((UInt8 *)temp, &mountRef, NULL); - if(err != noErr) - { - llinfos << "Couldn't make FSRef to disk image mount point." << llendl; - throw 0; - } - - sendProgress(0, 0, CFSTR("Searching for the app bundle...")); - err = findAppBundleOnDiskImage(&mountRef, &sourceRef); - if(err != noErr) - { - llinfos << "Couldn't find application bundle on mounted disk image." << llendl; - throw 0; - } - else - { - llinfos << "found the bundle." << llendl; - } - - sendProgress(0, 0, CFSTR("Preparing to copy files...")); - - FSRef asideRef; - char aside[MAX_PATH]; /* Flawfinder: ignore */ - - // this will hold the name of the destination target - CFStringRef appNameRef; - - if(replacingTarget) - { - // Get the name of the target we're replacing - HFSUniStr255 appNameUniStr; - err = FSGetCatalogInfo(&targetRef, 0, NULL, &appNameUniStr, NULL, NULL); - if(err != noErr) - throw 0; - appNameRef = FSCreateStringFromHFSUniStr(NULL, &appNameUniStr); - - // Move aside old version (into work directory) - err = FSMoveObject(&targetRef, &tempDirRef, &asideRef); - if(err != noErr) - { - llwarns << "failed to move aside old version (error code " << - err << ")" << llendl; - throw 0; - } - - // Grab the path for later use. - err = FSRefMakePath(&asideRef, (UInt8*)aside, sizeof(aside)); - } - else - { - // Construct the name of the target based on the product name - char appName[MAX_PATH]; /* Flawfinder: ignore */ - snprintf(appName, sizeof(appName), "%s.app", gProductName); - appNameRef = CFStringCreateWithCString(NULL, appName, kCFStringEncodingUTF8); - } - - sendProgress(0, 0, CFSTR("Copying files...")); - - llinfos << "Starting copy..." << llendl; - - // Copy the new version from the disk image to the target location. - err = FSCopyObjectSync( - &sourceRef, - &targetParentRef, - appNameRef, - &targetRef, - kFSFileOperationDefaultOptions); - - // Grab the path for later use. - err = FSRefMakePath(&targetRef, (UInt8*)target, sizeof(target)); - if(err != noErr) - throw 0; - - llinfos << "Copy complete. Target = " << target << llendl; - - if(err != noErr) - { - // Something went wrong during the copy. Attempt to put the old version back and bail. - (void)FSDeleteObject(&targetRef); - if(replacingTarget) - { - (void)FSMoveObject(&asideRef, &targetParentRef, NULL); - } - throw 0; - } - else - { - // The update has succeeded. Clear the cache directory. - - sendProgress(0, 0, CFSTR("Clearing cache...")); - - llinfos << "Clearing cache..." << llendl; - - gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""), "*.*"); - - llinfos << "Clear complete." << llendl; - - } - } - catch(...) - { - if(!gCancelled) - if(gFailure == noErr) - gFailure = -1; - } - - // Failures from here on out are all non-fatal and not reported. - sendProgress(0, 3, CFSTR("Cleaning up...")); - - // Close disk image file if necessary - if(downloadFile != NULL) - { - llinfos << "Closing download file." << llendl; - - fclose(downloadFile); - downloadFile = NULL; - } - - sendProgress(1, 3); - // Unmount image - if(deviceNode[0] != 0) - { - llinfos << "Detaching disk image." << llendl; - - snprintf(temp, sizeof(temp), "hdiutil detach '%s'", deviceNode); - system(temp); /* Flawfinder: ignore */ - } - - sendProgress(2, 3); - - // Move work directory to the trash - if(tempDir[0] != 0) - { - llinfos << "Moving work directory to the trash." << llendl; - - FSRef trashRef; - OSStatus err = FSMoveObjectToTrashSync(&tempDirRef, &trashRef, 0); - if(err != noErr) { - llwarns << "failed to move files to trash, (error code " << - err << ")" << llendl; - } - } - - if(!gCancelled && !gFailure && (target[0] != 0)) - { - llinfos << "Touching application bundle." << llendl; - - snprintf(temp, sizeof(temp), "touch '%s'", target); - system(temp); /* Flawfinder: ignore */ - - llinfos << "Launching updated application." << llendl; - - snprintf(temp, sizeof(temp), "open '%s'", target); - system(temp); /* Flawfinder: ignore */ - } - - sendDone(); - - return(NULL); -} - -#if LL_DARWIN -#pragma GCC diagnostic warning "-Wdeprecated-declarations" -#endif -- cgit v1.2.3 From 2d316dff3dda88e12ee64b33e22682f24c7ef4fa Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 12 Aug 2014 15:41:24 -0400 Subject: Remove old Windows updater executable from source tree and CMake. --- indra/CMakeLists.txt | 5 +- indra/newview/CMakeLists.txt | 2 - indra/win_updater/CMakeLists.txt | 45 ---- indra/win_updater/updater.cpp | 516 --------------------------------------- 4 files changed, 2 insertions(+), 566 deletions(-) delete mode 100755 indra/win_updater/CMakeLists.txt delete mode 100755 indra/win_updater/updater.cpp diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 410d25ad97..5c3f3713e3 100755 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -86,9 +86,8 @@ elseif (WINDOWS) if (EXISTS ${VIEWER_DIR}win_setup) add_subdirectory(${VIEWER_DIR}win_setup) endif (EXISTS ${VIEWER_DIR}win_setup) - add_subdirectory(${VIEWER_PREFIX}win_updater) - # add_dependencies(viewer windows-updater windows-setup windows-crash-logger) - add_dependencies(viewer windows-updater windows-crash-logger) + # add_dependencies(viewer windows-setup windows-crash-logger) + add_dependencies(viewer windows-crash-logger) elseif (SOLARIS) add_subdirectory(solaris_crash_logger) add_dependencies(viewer solaris-crash-logger) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 3e296c8d9f..b1625ca1d7 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1765,7 +1765,6 @@ if (WINDOWS) media_plugin_webkit winmm_shim windows-crash-logger - windows-updater ) if (FMODEX) @@ -1811,7 +1810,6 @@ if (WINDOWS) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin - windows-updater windows-crash-logger ) diff --git a/indra/win_updater/CMakeLists.txt b/indra/win_updater/CMakeLists.txt deleted file mode 100755 index 210486c668..0000000000 --- a/indra/win_updater/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -# -*- cmake -*- - -project(win_updater) - -include(00-Common) -include(LLCommon) -include(Linking) - -# *HACK - override msvcrt implementation (intialized on 00-Common) to be -# statically linked for the installer this relies on vc taking the last flag on -# the command line -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ) - -set(win_updater_SOURCE_FILES updater.cpp) - -set(win_updater_HEADER_FILES CMakeLists.txt) - -set_source_files_properties(${win_updater_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - -list(APPEND win_updater_SOURCE_FILES ${win_updater_HEADER_FILES}) - -add_executable(windows-updater WIN32 ${win_updater_SOURCE_FILES}) - -target_link_libraries(windows-updater - wininet - user32 - gdi32 - shell32 - ) - -set_target_properties(windows-updater - PROPERTIES - LINK_FLAGS "/NODEFAULTLIB:MSVCRT" - LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;MSVCRT\"" - ) - -# The windows-updater doesn't link against anything non-system, apparently -#ll_deploy_sharedlibs_command(windows-updater) diff --git a/indra/win_updater/updater.cpp b/indra/win_updater/updater.cpp deleted file mode 100755 index aeab5a3b13..0000000000 --- a/indra/win_updater/updater.cpp +++ /dev/null @@ -1,516 +0,0 @@ -/** - * @file updater.cpp - * @brief Windows auto-updater - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -// -// Usage: updater -url -// - -// We use dangerous fopen, strtok, mbstowcs, sprintf -// which generates warnings on VC2005. -// *TODO: Switch to fopen_s, strtok_s, etc. -#define _CRT_SECURE_NO_DEPRECATE - -#include -#include -#include -#include -#include -#include -#include -#include - -#define BUFSIZE 8192 - -int gTotalBytesRead = 0; -DWORD gTotalBytes = -1; -HWND gWindow = NULL; -WCHAR gProgress[256]; -char* gUpdateURL = NULL; - -#if _DEBUG -std::ofstream logfile; -#define DEBUG(expr) logfile << expr << std::endl -#else -#define DEBUG(expr) /**/ -#endif - -char* wchars_to_utf8chars(const WCHAR* in_chars) -{ - int tlen = 0; - const WCHAR* twc = in_chars; - while (*twc++ != 0) - { - tlen++; - } - char* outchars = new char[tlen]; - char* res = outchars; - for (int i=0; i - static RESULT check(const std::string& desc, RESULT result) - { - if (result) - { - // success, show caller - return result; - } - DWORD err = GetLastError(); - std::ostringstream out; - out << desc << " Failed: " << err; - DEBUG(out.str()); - throw InetError(out.str()); - } - - HINTERNET openUrl(const std::wstring& uri) const; - HINTERNET openInet() const; - - HINTERNET mInet, mDownload; -}; - -HINTERNET Fetcher::openInet() const -{ - DEBUG("Calling InternetOpen"); - // Init wininet subsystem - return check("InternetOpen", - InternetOpen(L"LindenUpdater", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0)); -} - -HINTERNET Fetcher::openUrl(const std::wstring& uri) const -{ - DEBUG("Calling InternetOpenUrl: " << wchars_to_utf8chars(uri.c_str())); - return check("InternetOpenUrl", - InternetOpenUrl(mInet, uri.c_str(), NULL, 0, INTERNET_FLAG_NEED_FILE, NULL)); -} - -unsigned long Fetcher::read(char* buffer, size_t bufflen) const -{ - unsigned long bytes_read = 0; - DEBUG("Calling InternetReadFile"); - check("InternetReadFile", - InternetReadFile(mDownload, buffer, bufflen, &bytes_read)); - return bytes_read; -} - -int WINAPI get_url_into_file(const std::wstring& uri, const std::string& path, int *cancelled) -{ - int success = FALSE; - *cancelled = FALSE; - - DEBUG("Opening '" << path << "'"); - - FILE* fp = fopen(path.c_str(), "wb"); /* Flawfinder: ignore */ - - if (!fp) - { - DEBUG("Failed to open '" << path << "'"); - return success; - } - - // Note, ctor can throw, since it uses check() function. - Fetcher fetcher(uri); - gTotalBytes = fetcher.getTotalBytes(); - -/*==========================================================================*| - // nobody uses total_bytes?!? What's this doing here? - DWORD total_bytes = 0; - success = check("InternetQueryDataAvailable", - InternetQueryDataAvailable(hdownload, &total_bytes, 0, 0)); -|*==========================================================================*/ - - success = FALSE; - while(!success && !(*cancelled)) - { - char data[BUFSIZE]; /* Flawfinder: ignore */ - unsigned long bytes_read = fetcher.read(data, sizeof(data)); - - if (!bytes_read) - { - DEBUG("InternetReadFile Read " << bytes_read << " bytes."); - } - - DEBUG("Reading Data, bytes_read = " << bytes_read); - - if (bytes_read == 0) - { - // If InternetFileRead returns TRUE AND bytes_read == 0 - // we've successfully downloaded the entire file - wsprintf(gProgress, L"Download complete."); - success = TRUE; - } - else - { - // write what we've got, then continue - fwrite(data, sizeof(char), bytes_read, fp); - - gTotalBytesRead += int(bytes_read); - - if (gTotalBytes != -1) - wsprintf(gProgress, L"Downloaded: %d%%", 100 * gTotalBytesRead / gTotalBytes); - else - wsprintf(gProgress, L"Downloaded: %dK", gTotalBytesRead / 1024); - - } - - DEBUG("Calling InvalidateRect"); - - // Mark the window as needing redraw (of the whole thing) - InvalidateRect(gWindow, NULL, TRUE); - - // Do the redraw - DEBUG("Calling UpdateWindow"); - UpdateWindow(gWindow); - - DEBUG("Calling PeekMessage"); - MSG msg; - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - - if (msg.message == WM_QUIT) - { - // bail out, user cancelled - *cancelled = TRUE; - } - } - } - - fclose(fp); - return success; -} - -LRESULT CALLBACK WinProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) -{ - HDC hdc; // Drawing context - PAINTSTRUCT ps; - - switch(message) - { - case WM_PAINT: - { - hdc = BeginPaint(hwnd, &ps); - - RECT rect; - GetClientRect(hwnd, &rect); - DrawText(hdc, gProgress, -1, &rect, - DT_SINGLELINE | DT_CENTER | DT_VCENTER); - - EndPaint(hwnd, &ps); - return 0; - } - case WM_CLOSE: - case WM_DESTROY: - // Get out of full screen - // full_screen_mode(false); - PostQuitMessage(0); - return 0; - } - return DefWindowProc(hwnd, message, wparam, lparam); -} - -#define win_class_name L"FullScreen" - -int parse_args(int argc, char **argv) -{ - int j; - - for (j = 1; j < argc; j++) - { - if ((!strcmp(argv[j], "-url")) && (++j < argc)) - { - gUpdateURL = argv[j]; - } - } - - // If nothing was set, let the caller know. - if (!gUpdateURL) - { - return 1; - } - return 0; -} - -int WINAPI -WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) -{ - // Parse the command line. - LPSTR cmd_line_including_exe_name = GetCommandLineA(); - - const int MAX_ARGS = 100; - int argc = 0; - char* argv[MAX_ARGS]; /* Flawfinder: ignore */ - -#if _DEBUG - logfile.open("updater.log", std::ios_base::out); - DEBUG("Parsing command arguments"); -#endif - - char *token = NULL; - if( cmd_line_including_exe_name[0] == '\"' ) - { - // Exe name is enclosed in quotes - token = strtok( cmd_line_including_exe_name, "\"" ); - argv[argc++] = token; - token = strtok( NULL, " \t," ); - } - else - { - // Exe name is not enclosed in quotes - token = strtok( cmd_line_including_exe_name, " \t," ); - } - - while( (token != NULL) && (argc < MAX_ARGS) ) - { - argv[argc++] = token; - /* Get next token: */ - if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore */ - { - token = strtok( NULL, "\""); - } - else - { - token = strtok( NULL, " \t," ); - } - } - - gUpdateURL = NULL; - - ///////////////////////////////////////// - // - // Process command line arguments - // - - DEBUG("Processing command arguments"); - - // - // Parse the command line arguments - // - int parse_args_result = parse_args(argc, argv); - - WNDCLASSEX wndclassex = { 0 }; - //DEVMODE dev_mode = { 0 }; - - const int WINDOW_WIDTH = 250; - const int WINDOW_HEIGHT = 100; - - wsprintf(gProgress, L"Connecting..."); - - /* Init the WNDCLASSEX */ - wndclassex.cbSize = sizeof(WNDCLASSEX); - wndclassex.style = CS_HREDRAW | CS_VREDRAW; - wndclassex.hInstance = hInstance; - wndclassex.lpfnWndProc = WinProc; - wndclassex.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); - wndclassex.lpszClassName = win_class_name; - - RegisterClassEx(&wndclassex); - - // Get the size of the screen - //EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode); - - gWindow = CreateWindowEx(NULL, win_class_name, - L"Second Life Updater", - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, - CW_USEDEFAULT, - WINDOW_WIDTH, - WINDOW_HEIGHT, - NULL, NULL, hInstance, NULL); - - ShowWindow(gWindow, nShowCmd); - UpdateWindow(gWindow); - - if (parse_args_result) - { - MessageBox(gWindow, - L"Usage: updater -url [-name ] [-program ] [-silent]", - L"Usage", MB_OK); - return parse_args_result; - } - - // Did we get a userserver to work with? - if (!gUpdateURL) - { - MessageBox(gWindow, L"Please specify the download url from the command line", - L"Error", MB_OK); - return 1; - } - - // Can't feed GetTempPath into GetTempFile directly - char temp_path[MAX_PATH]; /* Flawfinder: ignore */ - if (0 == GetTempPathA(sizeof(temp_path), temp_path)) - { - MessageBox(gWindow, L"Problem with GetTempPath()", - L"Error", MB_OK); - return 1; - } - std::string update_exec_path(temp_path); - update_exec_path.append("Second_Life_Updater.exe"); - - WCHAR update_uri[4096]; - mbstowcs(update_uri, gUpdateURL, sizeof(update_uri)); - - int success = 0; - int cancelled = 0; - - // Actually do the download - try - { - DEBUG("Calling get_url_into_file"); - success = get_url_into_file(update_uri, update_exec_path, &cancelled); - } - catch (const Fetcher::InetError& e) - { - (void)e; - success = FALSE; - DEBUG("Caught: " << e.what()); - } - - // WinInet can't tell us if we got a 404 or not. Therefor, we check - // for the size of the downloaded file, and assume that our installer - // will always be greater than 1MB. - if (gTotalBytesRead < (1024 * 1024) && ! cancelled) - { - MessageBox(gWindow, - L"The Second Life auto-update has failed.\n" - L"The problem may be caused by other software installed \n" - L"on your computer, such as a firewall.\n" - L"Please visit http://secondlife.com/download/ \n" - L"to download the latest version of Second Life.\n", - NULL, MB_OK); - return 1; - } - - if (cancelled) - { - // silently exit - return 0; - } - - if (!success) - { - MessageBox(gWindow, - L"Second Life download failed.\n" - L"Please try again later.", - NULL, MB_OK); - return 1; - } - - // TODO: Make updates silent (with /S to NSIS) - //char params[256]; /* Flawfinder: ignore */ - //sprintf(params, "/S"); /* Flawfinder: ignore */ - //MessageBox(gWindow, - // L"Updating Second Life.\n\nSecond Life will automatically start once the update is complete. This may take a minute...", - // L"Download Complete", - // MB_OK); - -/*==========================================================================*| - // DEV-31680: ShellExecuteA() causes McAfee-GW-Edition and AntiVir - // scanners to flag this executable as a probable virus vector. - // Less than or equal to 32 means failure - if (32 >= (int) ShellExecuteA(gWindow, "open", update_exec_path.c_str(), NULL, - "C:\\", SW_SHOWDEFAULT)) -|*==========================================================================*/ - // from http://msdn.microsoft.com/en-us/library/ms682512(VS.85).aspx - STARTUPINFOA si; - PROCESS_INFORMATION pi; - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - ZeroMemory(&pi, sizeof(pi)); - - if (! CreateProcessA(update_exec_path.c_str(), // executable file - NULL, // command line - NULL, // process cannot be inherited - NULL, // thread cannot be inherited - FALSE, // do not inherit existing handles - 0, // process creation flags - NULL, // inherit parent's environment - NULL, // inherit parent's current dir - &si, // STARTUPINFO - &pi)) // PROCESS_INFORMATION - { - MessageBox(gWindow, L"Update failed. Please try again later.", NULL, MB_OK); - return 1; - } - - // Give installer some time to open a window - Sleep(1000); - - return 0; -} -- cgit v1.2.3 From b603812fac01591951092c0ceba30277f2fb013d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 12 Aug 2014 15:44:09 -0400 Subject: Remove old linux_updater executable from source tree and CMake. --- indra/CMakeLists.txt | 1 - indra/linux_updater/CMakeLists.txt | 57 --- indra/linux_updater/linux_updater.cpp | 926 ---------------------------------- 3 files changed, 984 deletions(-) delete mode 100644 indra/linux_updater/CMakeLists.txt delete mode 100644 indra/linux_updater/linux_updater.cpp diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 5c3f3713e3..24ea59ca49 100755 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -71,7 +71,6 @@ add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins) if (LINUX) add_subdirectory(${VIEWER_PREFIX}linux_crash_logger) - add_subdirectory(${VIEWER_PREFIX}linux_updater) if (INSTALL_PROPRIETARY) include(LLAppearanceUtility) add_subdirectory(${LLAPPEARANCEUTILITY_SRC_DIR} ${LLAPPEARANCEUTILITY_BIN_DIR}) diff --git a/indra/linux_updater/CMakeLists.txt b/indra/linux_updater/CMakeLists.txt deleted file mode 100644 index 4a9e82f9b6..0000000000 --- a/indra/linux_updater/CMakeLists.txt +++ /dev/null @@ -1,57 +0,0 @@ -# -*- cmake -*- - -project(linux_updater) - -include(00-Common) -include(CURL) -include(CARes) -include(OpenSSL) -include(UI) -include(LLCommon) -include(LLMessage) -include(LLVFS) -include(LLXML) -include(LLUI) -include(Linking) - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLVFS_INCLUDE_DIRS} - ${LLXML_INCLUDE_DIRS} - ${LLUI_INCLUDE_DIRS} - ${CURL_INCLUDE_DIRS} - ${CARES_INCLUDE_DIRS} - ${OPENSSL_INCLUDE_DIRS} - ${UI_INCLUDE_DIRS} - ) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ${LLXML_SYSTEM_INCLUDE_DIRS} - ) - -set(linux_updater_SOURCE_FILES linux_updater.cpp) - -set(linux_updater_HEADER_FILES CMakeLists.txt) - -set_source_files_properties(${linux_updater_HEADER_FILES} - PROPERTIES HEADER_FILES_ONLY TRUE) - -list(APPEND linux_updater_SOURCE_FILES ${linux_updater_HEADER_FILES}) - -add_executable(linux-updater ${linux_updater_SOURCE_FILES}) - -target_link_libraries(linux-updater - ${CURL_LIBRARIES} - ${CARES_LIBRARIES} - ${OPENSSL_LIBRARIES} - ${CRYPTO_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${UI_LIBRARIES} - ${LLXML_LIBRARIES} - ${LLUI_LIBRARIES} - ${LLVFS_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ) - -add_custom_target(linux-updater-target ALL - DEPENDS linux-updater) diff --git a/indra/linux_updater/linux_updater.cpp b/indra/linux_updater/linux_updater.cpp deleted file mode 100644 index 5c94deba02..0000000000 --- a/indra/linux_updater/linux_updater.cpp +++ /dev/null @@ -1,926 +0,0 @@ -/** - * @file linux_updater.cpp - * @author Kyle Ambroff , Tofu Linden - * @brief Viewer update program for unix platforms that support GTK+ - * - * $LicenseInfo:firstyear=2008&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include -#include -#include -#include -#include - -#include "linden_common.h" -#include "llerrorcontrol.h" -#include "llfile.h" -#include "lldir.h" -#include "lldiriterator.h" - -/*==========================================================================*| -// IQA-490: Use of LLTrans -- by this program at least -- appears to be buggy. -// With it, the 3.3.2 beta 1 linux-updater.bin crashes; without it seems stable. -#include "llxmlnode.h" -#include "lltrans.h" -|*==========================================================================*/ - -static class LLTrans -{ -public: - LLTrans(); - static std::string getString(const std::string& key); - -private: - std::string _getString(const std::string& key) const; - - typedef std::map MessageMap; - MessageMap mMessages; -} sLLTransInstance; - -#include -#include -#include - -extern "C" { -#include -} - -const guint UPDATE_PROGRESS_TIMEOUT = 100; -const guint UPDATE_PROGRESS_TEXT_TIMEOUT = 1000; -const guint ROTATE_IMAGE_TIMEOUT = 8000; - -typedef struct _updater_app_state { - std::string app_name; - std::string url; - std::string file; - std::string image_dir; - std::string dest_dir; - std::string strings_dirs; - std::string strings_file; - - LLDirIterator *image_dir_iter; - - GtkWidget *window; - GtkWidget *progress_bar; - GtkWidget *image; - - double progress_value; - bool activity_mode; - - guint image_rotation_timeout_id; - guint progress_update_timeout_id; - guint update_progress_text_timeout_id; - - bool failure; -} UpdaterAppState; - -// List of entries from strings.xml to always replace -static std::set default_trans_args; -void init_default_trans_args() -{ - default_trans_args.insert("SECOND_LIFE"); // World - default_trans_args.insert("APP_NAME"); - default_trans_args.insert("SECOND_LIFE_GRID"); - default_trans_args.insert("SUPPORT_SITE"); -} - -bool translate_init(std::string comma_delim_path_list, - std::string base_xml_name) -{ - return true; -/*==========================================================================*| - init_default_trans_args(); - - // extract paths string vector from comma-delimited flat string - std::vector paths; - LLStringUtil::getTokens(comma_delim_path_list, paths, ","); // split over ',' - - for(std::vector::iterator it = paths.begin(), end_it = paths.end(); - it != end_it; - ++it) - { - (*it) = gDirUtilp->findSkinnedFilename(*it, base_xml_name); - } - - // suck the translation xml files into memory - LLXMLNodePtr root; - bool success = LLXMLNode::getLayeredXMLNode(root, paths); - if (!success) - { - // couldn't load string table XML - return false; - } - else - { - // get those strings out of the XML - LLTrans::parseStrings(root, default_trans_args); - return true; - } -|*==========================================================================*/ -} - - -void updater_app_ui_init(void); -void updater_app_quit(UpdaterAppState *app_state); -void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state); -std::string next_image_filename(std::string& image_path, LLDirIterator& iter); -void display_error(GtkWidget *parent, std::string title, std::string message); -BOOL install_package(std::string package_file, std::string destination); -BOOL spawn_viewer(UpdaterAppState *app_state); - -extern "C" { - void on_window_closed(GtkWidget *sender, GdkEvent *event, gpointer state); - gpointer worker_thread_cb(gpointer *data); - int download_progress_cb(gpointer data, double t, double d, double utotal, double ulnow); - gboolean rotate_image_cb(gpointer data); - gboolean progress_update_timeout(gpointer data); - gboolean update_progress_text_timeout(gpointer data); -} - -void updater_app_ui_init(UpdaterAppState *app_state) -{ - GtkWidget *vbox; - GtkWidget *summary_label; - GtkWidget *description_label; - GtkWidget *frame; - - llassert(app_state != NULL); - - // set up window and main container - std::string window_title = LLTrans::getString("UpdaterWindowTitle"); - app_state->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_title(GTK_WINDOW(app_state->window), - window_title.c_str()); - gtk_window_set_resizable(GTK_WINDOW(app_state->window), FALSE); - gtk_window_set_position(GTK_WINDOW(app_state->window), - GTK_WIN_POS_CENTER_ALWAYS); - - gtk_container_set_border_width(GTK_CONTAINER(app_state->window), 12); - g_signal_connect(G_OBJECT(app_state->window), "delete-event", - G_CALLBACK(on_window_closed), app_state); - - vbox = gtk_vbox_new(FALSE, 6); - gtk_container_add(GTK_CONTAINER(app_state->window), vbox); - - // set top label - std::ostringstream label_ostr; - label_ostr << "" - << LLTrans::getString("UpdaterNowUpdating") - << ""; - - summary_label = gtk_label_new(NULL); - gtk_label_set_use_markup(GTK_LABEL(summary_label), TRUE); - gtk_label_set_markup(GTK_LABEL(summary_label), - label_ostr.str().c_str()); - gtk_misc_set_alignment(GTK_MISC(summary_label), 0, 0.5); - gtk_box_pack_start(GTK_BOX(vbox), summary_label, FALSE, FALSE, 0); - - // create the description label - description_label = gtk_label_new(LLTrans::getString("UpdaterUpdatingDescriptive").c_str()); - gtk_label_set_line_wrap(GTK_LABEL(description_label), TRUE); - gtk_misc_set_alignment(GTK_MISC(description_label), 0, 0.5); - gtk_box_pack_start(GTK_BOX(vbox), description_label, FALSE, FALSE, 0); - - // If an image path has been set, load the background images - if (!app_state->image_dir.empty()) { - frame = gtk_frame_new(NULL); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); - gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); - - // load the first image - app_state->image = gtk_image_new_from_file - (next_image_filename(app_state->image_dir, *app_state->image_dir_iter).c_str()); - gtk_widget_set_size_request(app_state->image, 340, 310); - gtk_container_add(GTK_CONTAINER(frame), app_state->image); - - // rotate the images every 5 seconds - app_state->image_rotation_timeout_id = g_timeout_add - (ROTATE_IMAGE_TIMEOUT, rotate_image_cb, app_state); - } - - // set up progress bar, and update it roughly every 1/10 of a second - app_state->progress_bar = gtk_progress_bar_new(); - gtk_progress_bar_set_text(GTK_PROGRESS_BAR(app_state->progress_bar), - LLTrans::getString("UpdaterProgressBarTextWithEllipses").c_str()); - gtk_box_pack_start(GTK_BOX(vbox), - app_state->progress_bar, FALSE, TRUE, 0); - app_state->progress_update_timeout_id = g_timeout_add - (UPDATE_PROGRESS_TIMEOUT, progress_update_timeout, app_state); - app_state->update_progress_text_timeout_id = g_timeout_add - (UPDATE_PROGRESS_TEXT_TIMEOUT, update_progress_text_timeout, app_state); - - gtk_widget_show_all(app_state->window); -} - -gboolean rotate_image_cb(gpointer data) -{ - UpdaterAppState *app_state; - std::string filename; - - llassert(data != NULL); - app_state = (UpdaterAppState *) data; - - filename = next_image_filename(app_state->image_dir, *app_state->image_dir_iter); - - gdk_threads_enter(); - gtk_image_set_from_file(GTK_IMAGE(app_state->image), filename.c_str()); - gdk_threads_leave(); - - return TRUE; -} - -std::string next_image_filename(std::string& image_path, LLDirIterator& iter) -{ - std::string image_filename; - iter.next(image_filename); - return gDirUtilp->add(image_path, image_filename); -} - -void on_window_closed(GtkWidget *sender, GdkEvent* event, gpointer data) -{ - UpdaterAppState *app_state; - - llassert(data != NULL); - app_state = (UpdaterAppState *) data; - - updater_app_quit(app_state); -} - -void updater_app_quit(UpdaterAppState *app_state) -{ - if (app_state != NULL) - { - g_source_remove(app_state->progress_update_timeout_id); - - if (!app_state->image_dir.empty()) - { - g_source_remove(app_state->image_rotation_timeout_id); - } - } - - gtk_main_quit(); -} - -void display_error(GtkWidget *parent, std::string title, std::string message) -{ - GtkWidget *dialog; - - dialog = gtk_message_dialog_new(GTK_WINDOW(parent), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - "%s", message.c_str()); - gtk_window_set_title(GTK_WINDOW(dialog), title.c_str()); - gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); -} - -gpointer worker_thread_cb(gpointer data) -{ - UpdaterAppState *app_state; - CURL *curl; - CURLcode result; - FILE *package_file; - GError *error = NULL; - int fd; - - //g_return_val_if_fail (data != NULL, NULL); - app_state = (UpdaterAppState *) data; - - try { - - if(!app_state->url.empty()) - { - char* tmp_local_filename = NULL; - // create temporary file to store the package. - fd = g_file_open_tmp - ("secondlife-update-XXXXXX", &tmp_local_filename, &error); - if (error != NULL) - { - LL_ERRS() << "Unable to create temporary file: " - << error->message - << LL_ENDL; - - g_error_free(error); - throw 0; - } - - if(tmp_local_filename != NULL) - { - app_state->file = tmp_local_filename; - g_free(tmp_local_filename); - } - - package_file = fdopen(fd, "wb"); - if (package_file == NULL) - { - LL_ERRS() << "Failed to create temporary file: " - << app_state->file.c_str() - << LL_ENDL; - - gdk_threads_enter(); - display_error(app_state->window, - LLTrans::getString("UpdaterFailDownloadTitle"), - LLTrans::getString("UpdaterFailUpdateDescriptive")); - gdk_threads_leave(); - throw 0; - } - - // initialize curl and start downloading the package - LL_INFOS() << "Downloading package: " << app_state->url << LL_ENDL; - - curl = curl_easy_init(); - if (curl == NULL) - { - LL_ERRS() << "Failed to initialize libcurl" << LL_ENDL; - - gdk_threads_enter(); - display_error(app_state->window, - LLTrans::getString("UpdaterFailDownloadTitle"), - LLTrans::getString("UpdaterFailUpdateDescriptive")); - gdk_threads_leave(); - throw 0; - } - - curl_easy_setopt(curl, CURLOPT_URL, app_state->url.c_str()); - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, TRUE); - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, TRUE); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, package_file); - curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE); - curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, - &download_progress_cb); - curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, app_state); - - result = curl_easy_perform(curl); - fclose(package_file); - curl_easy_cleanup(curl); - - if (result) - { - LL_ERRS() << "Failed to download update: " - << app_state->url - << LL_ENDL; - - gdk_threads_enter(); - display_error(app_state->window, - LLTrans::getString("UpdaterFailDownloadTitle"), - LLTrans::getString("UpdaterFailUpdateDescriptive")); - gdk_threads_leave(); - - throw 0; - } - } - - // now pulse the progres bar back and forth while the package is - // being unpacked - gdk_threads_enter(); - std::string installing_msg = LLTrans::getString("UpdaterNowInstalling"); - gtk_progress_bar_set_text( - GTK_PROGRESS_BAR(app_state->progress_bar), - installing_msg.c_str()); - app_state->activity_mode = TRUE; - gdk_threads_leave(); - - // *TODO: if the destination is not writable, terminate this - // thread and show file chooser? - if (!install_package(app_state->file.c_str(), app_state->dest_dir)) - { - LL_WARNS() << "Failed to install package to destination: " - << app_state->dest_dir - << LL_ENDL; - - gdk_threads_enter(); - display_error(app_state->window, - LLTrans::getString("UpdaterFailInstallTitle"), - LLTrans::getString("UpdaterFailUpdateDescriptive")); - //"Failed to update " + app_state->app_name, - gdk_threads_leave(); - throw 0; - } - - // try to spawn the new viewer - if (!spawn_viewer(app_state)) - { - LL_WARNS() << "Viewer was not installed properly in : " - << app_state->dest_dir - << LL_ENDL; - - gdk_threads_enter(); - display_error(app_state->window, - LLTrans::getString("UpdaterFailStartTitle"), - LLTrans::getString("UpdaterFailUpdateDescriptive")); - gdk_threads_leave(); - throw 0; - } - } - catch (...) - { - app_state->failure = TRUE; - } - - gdk_threads_enter(); - updater_app_quit(app_state); - gdk_threads_leave(); - - return NULL; -} - - -gboolean less_anal_gspawnsync(gchar **argv, - gchar **stderr_output, - gint *child_exit_status, - GError **spawn_error) -{ - // store current SIGCHLD handler if there is one, replace with default - // handler to make glib happy - struct sigaction sigchld_backup; - struct sigaction sigchld_appease_glib; - sigchld_appease_glib.sa_handler = SIG_DFL; - sigemptyset(&sigchld_appease_glib.sa_mask); - sigchld_appease_glib.sa_flags = 0; - sigaction(SIGCHLD, &sigchld_appease_glib, &sigchld_backup); - - gboolean rtn = g_spawn_sync(NULL, - argv, - NULL, - (GSpawnFlags) (G_SPAWN_STDOUT_TO_DEV_NULL), - NULL, - NULL, - NULL, - stderr_output, - child_exit_status, - spawn_error); - - // restore SIGCHLD handler - sigaction(SIGCHLD, &sigchld_backup, NULL); - - return rtn; -} - - -// perform a rename, or perform a (prompted) root rename if that fails -int -rename_with_sudo_fallback(const std::string& filename, const std::string& newname) -{ - int rtncode = ::rename(filename.c_str(), newname.c_str()); - LL_DEBUGS() << "rename result is: " << rtncode << " / " << errno << LL_ENDL; - if (rtncode && (EACCES == errno || EPERM == errno || EXDEV == errno)) - { - LL_INFOS() << "Permission problem in rename, or moving between different mount points. Retrying as a mv under a sudo." << LL_ENDL; - // failed due to permissions, try again as a gksudo or kdesu mv wrapper hack - char *sudo_cmd = NULL; - sudo_cmd = g_find_program_in_path("gksudo"); - if (!sudo_cmd) - { - sudo_cmd = g_find_program_in_path("kdesu"); - } - if (sudo_cmd) - { - char *mv_cmd = NULL; - mv_cmd = g_find_program_in_path("mv"); - if (mv_cmd) - { - char *src_string_copy = g_strdup(filename.c_str()); - char *dst_string_copy = g_strdup(newname.c_str()); - char* argv[] = - { - sudo_cmd, - mv_cmd, - src_string_copy, - dst_string_copy, - NULL - }; - - gchar *stderr_output = NULL; - gint child_exit_status = 0; - GError *spawn_error = NULL; - if (!less_anal_gspawnsync(argv, &stderr_output, - &child_exit_status, &spawn_error)) - { - LL_WARNS() << "Failed to spawn child process: " - << spawn_error->message - << LL_ENDL; - } - else if (child_exit_status) - { - LL_WARNS() << "mv command failed: " - << (stderr_output ? stderr_output : "(no reason given)") - << LL_ENDL; - } - else - { - // everything looks good, clear the error code - rtncode = 0; - } - - g_free(src_string_copy); - g_free(dst_string_copy); - if (spawn_error) g_error_free(spawn_error); - } - } - } - return rtncode; -} - -gboolean install_package(std::string package_file, std::string destination) -{ - char *tar_cmd = NULL; - std::ostringstream command; - - // Find the absolute path to the 'tar' command. - tar_cmd = g_find_program_in_path("tar"); - if (!tar_cmd) - { - LL_ERRS() << "`tar' was not found in $PATH" << LL_ENDL; - return FALSE; - } - LL_INFOS() << "Found tar command: " << tar_cmd << LL_ENDL; - - // Unpack the tarball in a temporary place first, then move it to - // its final destination - std::string tmp_dest_dir = gDirUtilp->getTempFilename(); - if (LLFile::mkdir(tmp_dest_dir, 0744)) - { - LL_ERRS() << "Failed to create directory: " - << destination - << LL_ENDL; - - return FALSE; - } - - char *package_file_string_copy = g_strdup(package_file.c_str()); - char *tmp_dest_dir_string_copy = g_strdup(tmp_dest_dir.c_str()); - gchar *argv[8] = { - tar_cmd, - const_cast("--strip"), const_cast("1"), - const_cast("-xjf"), - package_file_string_copy, - const_cast("-C"), tmp_dest_dir_string_copy, - NULL, - }; - - LL_INFOS() << "Untarring package: " << package_file << LL_ENDL; - - // store current SIGCHLD handler if there is one, replace with default - // handler to make glib happy - struct sigaction sigchld_backup; - struct sigaction sigchld_appease_glib; - sigchld_appease_glib.sa_handler = SIG_DFL; - sigemptyset(&sigchld_appease_glib.sa_mask); - sigchld_appease_glib.sa_flags = 0; - sigaction(SIGCHLD, &sigchld_appease_glib, &sigchld_backup); - - gchar *stderr_output = NULL; - gint child_exit_status = 0; - GError *untar_error = NULL; - if (!less_anal_gspawnsync(argv, &stderr_output, - &child_exit_status, &untar_error)) - { - LL_WARNS() << "Failed to spawn child process: " - << untar_error->message - << LL_ENDL; - return FALSE; - } - - if (child_exit_status) - { - LL_WARNS() << "Untar command failed: " - << (stderr_output ? stderr_output : "(no reason given)") - << LL_ENDL; - return FALSE; - } - - g_free(tar_cmd); - g_free(package_file_string_copy); - g_free(tmp_dest_dir_string_copy); - g_free(stderr_output); - if (untar_error) g_error_free(untar_error); - - // move the existing package out of the way if it exists - if (gDirUtilp->fileExists(destination)) - { - std::string backup_dir = destination + ".backup"; - int oldcounter = 1; - while (gDirUtilp->fileExists(backup_dir)) - { - // find a foo.backup.N folder name that isn't taken yet - backup_dir = destination + ".backup." + llformat("%d", oldcounter); - ++oldcounter; - } - - if (rename_with_sudo_fallback(destination, backup_dir)) - { - LL_WARNS() << "Failed to move directory: '" - << destination << "' -> '" << backup_dir - << LL_ENDL; - return FALSE; - } - } - - // The package has been unpacked in a staging directory, now we just - // need to move it to its destination. - if (rename_with_sudo_fallback(tmp_dest_dir, destination)) - { - LL_WARNS() << "Failed to move installation to the destination: " - << destination - << LL_ENDL; - return FALSE; - } - - // \0/ Success! - return TRUE; -} - -gboolean progress_update_timeout(gpointer data) -{ - UpdaterAppState *app_state; - - llassert(data != NULL); - - app_state = (UpdaterAppState *) data; - - gdk_threads_enter(); - if (app_state->activity_mode) - { - gtk_progress_bar_pulse - (GTK_PROGRESS_BAR(app_state->progress_bar)); - } - else - { - gtk_progress_set_value(GTK_PROGRESS(app_state->progress_bar), - app_state->progress_value); - } - gdk_threads_leave(); - - return TRUE; -} - -gboolean update_progress_text_timeout(gpointer data) -{ - UpdaterAppState *app_state; - - llassert(data != NULL); - app_state = (UpdaterAppState *) data; - - if (app_state->activity_mode == TRUE) - { - // We no longer need this timeout, it will be removed. - return FALSE; - } - - if (!app_state->progress_value) - { - return TRUE; - } - - std::string progress_text = llformat((LLTrans::getString("UpdaterProgressBarText")+" (%.0f%%)").c_str(), app_state->progress_value); - - gdk_threads_enter(); - gtk_progress_bar_set_text(GTK_PROGRESS_BAR(app_state->progress_bar), - progress_text.c_str()); - gdk_threads_leave(); - - return TRUE; -} - -int download_progress_cb(gpointer data, - double t, - double d, - double utotal, - double ulnow) -{ - UpdaterAppState *app_state; - - llassert(data != NULL); - app_state = (UpdaterAppState *) data; - - if (t <= 0.0) - { - app_state->progress_value = 0; - } - else - { - app_state->progress_value = d * 100.0 / t; - } - return 0; -} - -BOOL spawn_viewer(UpdaterAppState *app_state) -{ - llassert(app_state != NULL); - - std::string cmd = app_state->dest_dir + "/secondlife"; - GError *error = NULL; - - // We want to spawn the Viewer on the same display as the updater app - gboolean success = gdk_spawn_command_line_on_screen - (gtk_widget_get_screen(app_state->window), cmd.c_str(), &error); - - if (!success) - { - LL_WARNS() << "Failed to launch viewer: " << error->message - << LL_ENDL; - } - - if (error) g_error_free(error); - - return success; -} - -void show_usage_and_exit() -{ - std::cout << "Usage: linux-updater <--url URL | --file FILE> --name NAME --dest PATH --stringsdir PATH1,PATH2 --stringsfile FILE" - << "[--image-dir PATH]" - << std::endl; - exit(1); -} - -void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state) -{ - int i; - - for (i = 1; i < argc; i++) - { - if ((!strcmp(argv[i], "--url")) && (++i < argc)) - { - app_state->url = argv[i]; - } - else if ((!strcmp(argv[i], "--file")) && (++i < argc)) - { - app_state->file = argv[i]; - } - else if ((!strcmp(argv[i], "--name")) && (++i < argc)) - { - app_state->app_name = argv[i]; - } - else if ((!strcmp(argv[i], "--image-dir")) && (++i < argc)) - { - app_state->image_dir = argv[i]; - app_state->image_dir_iter = new LLDirIterator(argv[i], "*.jpg"); - } - else if ((!strcmp(argv[i], "--dest")) && (++i < argc)) - { - app_state->dest_dir = argv[i]; - } - else if ((!strcmp(argv[i], "--stringsdir")) && (++i < argc)) - { - app_state->strings_dirs = argv[i]; - } - else if ((!strcmp(argv[i], "--stringsfile")) && (++i < argc)) - { - app_state->strings_file = argv[i]; - } - else - { - // show usage, an invalid option was given. - show_usage_and_exit(); - } - } - - if (app_state->app_name.empty() - || (app_state->url.empty() && app_state->file.empty()) - || app_state->dest_dir.empty()) - { - show_usage_and_exit(); - } - - app_state->progress_value = 0.0; - app_state->activity_mode = FALSE; - app_state->failure = FALSE; - - translate_init(app_state->strings_dirs, app_state->strings_file); -} - -int main(int argc, char **argv) -{ - UpdaterAppState* app_state = new UpdaterAppState; - - parse_args_and_init(argc, argv, app_state); - - // Initialize logger, and rename old log file - gDirUtilp->initAppDirs("SecondLife"); - LLError::initForApplication - (gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); - std::string old_log_file = gDirUtilp->getExpandedFilename - (LL_PATH_LOGS, "updater.log.old"); - std::string log_file = - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log"); - LLFile::rename(log_file, old_log_file); - LLError::logToFile(log_file); - - // initialize gthreads and gtk+ - if (!g_thread_supported()) - { - g_thread_init(NULL); - gdk_threads_init(); - } - - gtk_init(&argc, &argv); - - // create UI - updater_app_ui_init(app_state); - - //LL_INFOS() << "SAMPLE TRANSLATION IS: " << LLTrans::getString("LoginInProgress") << LL_ENDL; - - // create download thread - g_thread_create(GThreadFunc(worker_thread_cb), app_state, FALSE, NULL); - - gdk_threads_enter(); - gtk_main(); - gdk_threads_leave(); - - // Delete the file only if created from url download. - if(!app_state->url.empty() && !app_state->file.empty()) - { - if (gDirUtilp->fileExists(app_state->file)) - { - LLFile::remove(app_state->file); - } - } - - bool success = !app_state->failure; - delete app_state->image_dir_iter; - delete app_state; - return success ? 0 : 1; -} - -/***************************************************************************** -* Dummy LLTrans implementation (IQA-490) -*****************************************************************************/ -static LLTrans sStaticStrings; - -// lookup -std::string LLTrans::_getString(const std::string& key) const -{ - MessageMap::const_iterator found = mMessages.find(key); - if (found != mMessages.end()) - { - return found->second; - } - LL_WARNS("linux_updater") << "No message for key '" << key - << "' -- add to LLTrans::LLTrans() in linux_updater.cpp" - << LL_ENDL; - return key; -} - -// static lookup -std::string LLTrans::getString(const std::string& key) -{ - return sLLTransInstance._getString(key); -} - -// initialization -LLTrans::LLTrans() -{ - typedef std::pair Pair; - static const Pair data[] = - { - Pair("UpdaterFailDownloadTitle", - "Failed to download update"), - Pair("UpdaterFailInstallTitle", - "Failed to install update"), - Pair("UpdaterFailStartTitle", - "Failed to start viewer"), - Pair("UpdaterFailUpdateDescriptive", - "An error occurred while updating Second Life. " - "Please download the latest version from www.secondlife.com."), - Pair("UpdaterNowInstalling", - "Installing Second Life..."), - Pair("UpdaterNowUpdating", - "Now updating Second Life..."), - Pair("UpdaterProgressBarText", - "Downloading update"), - Pair("UpdaterProgressBarTextWithEllipses", - "Downloading update..."), - Pair("UpdaterUpdatingDescriptive", - "Your Second Life Viewer is being updated to the latest release. " - "This may take some time, so please be patient."), - Pair("UpdaterWindowTitle", - "Second Life Update") - }; - - BOOST_FOREACH(Pair pair, data) - { - mMessages[pair.first] = pair.second; - } -} -- cgit v1.2.3 From d56958e68934e673195ec2966e0a3c20dac7fb41 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 13 Aug 2014 17:57:09 -0400 Subject: MAINT-4356 adjust abuse report category label for gaming --- indra/newview/skins/default/xui/en/floater_report_abuse.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_report_abuse.xml b/indra/newview/skins/default/xui/en/floater_report_abuse.xml index c50c8c02fe..af62c7a9bc 100755 --- a/indra/newview/skins/default/xui/en/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml @@ -253,7 +253,7 @@ name="Land__Encroachment__Objects_textures" value="63" /> -- cgit v1.2.3 From c8e90833207674515a545a4cf539bc9d78236ad2 Mon Sep 17 00:00:00 2001 From: NiranV Date: Thu, 14 Aug 2014 03:21:58 +0200 Subject: BUG-6958: Fixed: Snapshot position is always <0,0,0>. onIdle isn't called as much as they thought it is, it's only called when "Auto refresh" is on but not on normal manual snapshot refreshes. --- indra/newview/llsnapshotlivepreview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 8ad9ca000c..1aa7041175 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -195,6 +195,8 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail mSnapshotDelayTimer.start(); mSnapshotDelayTimer.setTimerExpirySec(delay); + mPosTakenGlobal = gAgentCamera.getCameraPositionGlobal(); + // Tell the floater container that the snapshot is in the process of updating itself if (mViewContainer) { @@ -760,7 +762,6 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) curr_preview_image->setFilteringOption(previewp->getSnapshotType() == SNAPSHOT_TEXTURE ? LLTexUnit::TFO_ANISOTROPIC : LLTexUnit::TFO_POINT); curr_preview_image->setAddressMode(LLTexUnit::TAM_CLAMP); - previewp->mPosTakenGlobal = gAgentCamera.getCameraPositionGlobal(); previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame } } -- cgit v1.2.3 From 9d406f69cc648e70fba0d9cdd3de3baf348fdbdd Mon Sep 17 00:00:00 2001 From: NiranV Date: Thu, 14 Aug 2014 03:27:13 +0200 Subject: Changed: Updated contributions file. --- doc/contributions.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index faaac602a5..46f3e70996 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1003,8 +1003,22 @@ NiranV Dean STORM-2050 STORM-2051 STORM-2052 + STORM-2057 + STORM-2058 + STORM-2059 + STORM-2060 + STORM-2061 + STORM-2063 + STORM-2064 + STORM-2065 + STORM-2066 BUG-372 BUG-1179 + BUG-6835 + BUG-6837 + BUG-6839 + BUG-6840 + BUG-6958 Nounouch Hapmouche VWR-238 Ollie Kubrick -- cgit v1.2.3 From ea79b23e85a4e526b222582a585a55d490724e87 Mon Sep 17 00:00:00 2001 From: NiranV Date: Thu, 14 Aug 2014 03:36:28 +0200 Subject: STORM-2064: Changed: Made background of status text invisible. #2 --- indra/newview/skins/default/xui/en/floater_snapshot.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index c0907d6031..f0a175902b 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -294,8 +294,7 @@ width="199" top_pad="-16"/> Date: Fri, 15 Aug 2014 18:35:00 +0200 Subject: BUG-7020: Fixed: Snapshot floater being resized while it's minimized. --- indra/newview/llfloatersnapshot.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index f927b50092..55dfad37d8 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -287,7 +287,10 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) thumbnail_placeholder->reshape(panel_width, thumbnail_placeholder->getRect().getHeight()); floaterp->getChild("image_res_text")->setVisible(advanced); floaterp->getChild("file_size_label")->setVisible(advanced); - floaterp->reshape(floater_width, floaterp->getRect().getHeight()); + if(!floaterp->isMinimized()) + { + floaterp->reshape(floater_width, floaterp->getRect().getHeight()); + } bool use_freeze_frame = floaterp->getChild("freeze_frame_check")->getValue().asBoolean(); -- cgit v1.2.3 From e11451fc1d543759d397ecaa4cac7b720cc26506 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 15 Aug 2014 18:36:30 +0200 Subject: STORM-2060: Fixed: Height spinner not being detected as first changed. --- indra/newview/llfloatersnapshot.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 55dfad37d8..3f9243381c 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -813,7 +813,16 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL previewp->getSize(width, height); - updateSpinners(view, previewp, width, height, TRUE); // may change width and height + bool width_changed; + if(original_width != width) + { + width_changed = TRUE; + } + else + { + width_changed = FALSE; + } + updateSpinners(view, previewp, width, height, width_changed); // may change width and height if(getWidthSpinner(view)->getValue().asInteger() != width || getHeightSpinner(view)->getValue().asInteger() != height) { -- cgit v1.2.3 From b740891b1f19c3d0e9ee494ef3bdb8adc3dcb151 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 15 Aug 2014 19:40:21 +0300 Subject: MAINT-4293 [BEAR] Very slow inventory fetch on Bear compared to current release: this change-set will does this issue not [BEAR] and reverts most part of fix for MAINT-1192. --- indra/newview/llinventorypanel.cpp | 6 ------ indra/newview/llpanelmaininventory.cpp | 4 +--- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 32e5675f5e..ce7d4f50ad 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -337,12 +337,6 @@ void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType { if (filter_type == LLInventoryFilter::FILTERTYPE_OBJECT) { - //Don't show folder without recent item in it - if ("Recent Items" == getName()) - { - types &= ~(0x1 << LLInventoryType::IT_CATEGORY); - } - getFilter().setFilterObjectTypes(types); } if (filter_type == LLInventoryFilter::FILTERTYPE_CATEGORY) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index ddf1a63c6e..90dfb24377 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -151,9 +151,7 @@ BOOL LLPanelMainInventory::postBuild() recent_items_panel->setSinceLogoff(TRUE); recent_items_panel->setSortOrder(LLInventoryFilter::SO_DATE); recent_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - LLInventoryFilter& recent_filter = recent_items_panel->getFilter(); - recent_filter.setFilterObjectTypes(recent_filter.getFilterObjectTypes() & ~(0x1 << LLInventoryType::IT_CATEGORY)); - recent_filter.markDefault(); + recent_items_panel->getFilter().markDefault(); recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2)); } -- cgit v1.2.3 From 0d46af3d38eeeb295c0b12393668755871042661 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 15 Aug 2014 18:42:17 +0200 Subject: STORM-2064: Changed: Renamed 'Scanlines' filter to 'Video' and removed the old 'Video' one. --- indra/newview/app_settings/filters/Scanlines.xml | 30 ------------------------ indra/newview/app_settings/filters/Video.xml | 23 +++++++----------- 2 files changed, 8 insertions(+), 45 deletions(-) delete mode 100644 indra/newview/app_settings/filters/Scanlines.xml diff --git a/indra/newview/app_settings/filters/Scanlines.xml b/indra/newview/app_settings/filters/Scanlines.xml deleted file mode 100644 index e9ba2889fa..0000000000 --- a/indra/newview/app_settings/filters/Scanlines.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - linearize - 0.0 - 1.0 - 1.0 - 1.0 - - - stencil - scanlines - add-back - 0.0 - 1.0 - 0.015 - 0 - - - gamma - 0.5 - 1.0 - 1.0 - 1.0 - - - blur - - - \ No newline at end of file diff --git a/indra/newview/app_settings/filters/Video.xml b/indra/newview/app_settings/filters/Video.xml index fe17f3950a..441a506d40 100755 --- a/indra/newview/app_settings/filters/Video.xml +++ b/indra/newview/app_settings/filters/Video.xml @@ -9,27 +9,23 @@ darken - 0.15 + 0.05 1.0 1.0 1.0 stencil - uniform - add - 0.0 - 0.5 - - - screen - line - 0.02 + scanlines + add-back 0.0 + 0.25 + 0.025 + 0 gamma - 0.25 + 0.0 1.0 1.0 1.0 @@ -37,8 +33,5 @@ blur - - blur - - + \ No newline at end of file -- cgit v1.2.3 From 2605ad9c01355ffc2b45b3d0ec74c4da451423f6 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 15 Aug 2014 21:25:31 +0200 Subject: STORM-2064: Changed: Reverted previous changes since Merov has clarified that it is intended behavior. --- indra/newview/app_settings/filters/Video.xml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/filters/Video.xml b/indra/newview/app_settings/filters/Video.xml index 441a506d40..fe17f3950a 100755 --- a/indra/newview/app_settings/filters/Video.xml +++ b/indra/newview/app_settings/filters/Video.xml @@ -9,23 +9,27 @@ darken - 0.05 + 0.15 1.0 1.0 1.0 stencil - scanlines - add-back + uniform + add 0.0 - 0.25 - 0.025 - 0 + 0.5 - gamma + screen + line + 0.02 0.0 + + + gamma + 0.25 1.0 1.0 1.0 @@ -33,5 +37,8 @@ blur + + blur + - \ No newline at end of file + -- cgit v1.2.3 From bca5c1ed7956d2b32f1ba1609edd2f00566adc81 Mon Sep 17 00:00:00 2001 From: NiranV Date: Fri, 15 Aug 2014 22:41:10 +0200 Subject: Changed: Updated contributions file. --- doc/contributions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index 46f3e70996..3b995bcb31 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1012,6 +1012,7 @@ NiranV Dean STORM-2064 STORM-2065 STORM-2066 + STORM-2068 BUG-372 BUG-1179 BUG-6835 -- cgit v1.2.3 From 2b66eeb4a61235fae4c29ecd98890b8b47badafe Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 01:38:50 +0200 Subject: STORM-2073: Fixed: Do not post our status if we press the "Connect" button otherwise we end up double posting. --- indra/newview/llfloaterfacebook.cpp | 7 +++++-- indra/newview/llfloaterfacebook.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index 516cf5c15c..d8cc070fd0 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -156,7 +156,8 @@ void LLFacebookStatusPanel::onSend() { LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookStatusPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); - + + pressedConnect = FALSE; // Connect to Facebook if necessary and then post if (LLFacebookConnect::instance().isConnected()) { @@ -186,7 +187,8 @@ bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data) switch (data.get("enum").asInteger()) { case LLFacebookConnect::FB_CONNECTED: - sendStatus(); + if(!pressedConnect) + sendStatus(); break; case LLFacebookConnect::FB_POSTED: @@ -293,6 +295,7 @@ void LLFacebookStatusPanel::onConnect() { LLFacebookConnect::instance().checkConnectionToFacebook(true); + pressedConnect = TRUE; //Clear only the facebook browser cookies so that the facebook login screen appears LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); } diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h index 86e3a148b9..e1526db18d 100644 --- a/indra/newview/llfloaterfacebook.h +++ b/indra/newview/llfloaterfacebook.h @@ -62,6 +62,8 @@ private: void showDisconnectedLayout(); void showConnectedLayout(); + bool pressedConnect; + LLTextBox * mAccountCaptionLabel; LLTextBox * mAccountNameLabel; LLUICtrl * mPanelButtons; -- cgit v1.2.3 From 5bdf2a0cda79e7cf67818489e8d3a86232863758 Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 04:06:15 +0200 Subject: STORM-2060/STORM-2076: Fixed: Whole detection logic not working because of reasons i cannot seem to understand in this hypercube like snapshot floater. --- indra/newview/llfloatersnapshot.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 3f9243381c..31b743b7e8 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -814,13 +814,13 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL previewp->getSize(width, height); bool width_changed; - if(original_width != width) + if(getHeightSpinner(view)->isDirty()) { - width_changed = TRUE; + width_changed = FALSE; } else { - width_changed = FALSE; + width_changed = TRUE; } updateSpinners(view, previewp, width, height, width_changed); // may change width and height @@ -952,6 +952,8 @@ void LLFloaterSnapshot::Impl::setImageSizeSpinnersValues(LLFloaterSnapshot *view // static void LLFloaterSnapshot::Impl::updateSpinners(LLFloaterSnapshot* view, LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL is_width_changed) { + getWidthSpinner(view)->resetDirty(); + getHeightSpinner(view)->resetDirty(); if (checkImageSize(previewp, width, height, is_width_changed, previewp->getMaxImageSize())) { setImageSizeSpinnersValues(view, width, height); -- cgit v1.2.3 From 417362e9d8555b77c8510430e2a4b3e8901be2b3 Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 16:04:50 +0200 Subject: STORM-2060/STORM-2076: Changed: Code to a more appropiate, shorter version. Thanks Oz. --- indra/newview/llfloatersnapshot.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 31b743b7e8..8037c22173 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -813,16 +813,7 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL previewp->getSize(width, height); - bool width_changed; - if(getHeightSpinner(view)->isDirty()) - { - width_changed = FALSE; - } - else - { - width_changed = TRUE; - } - updateSpinners(view, previewp, width, height, width_changed); // may change width and height + updateSpinners(view, previewp, width, height, !getHeightSpinner(view)->isDirty()); // may change width and height if(getWidthSpinner(view)->getValue().asInteger() != width || getHeightSpinner(view)->getValue().asInteger() != height) { -- cgit v1.2.3 From 887510c335ebd83dc7f61753443f2e35dc2a69e2 Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 16:07:01 +0200 Subject: Changed: Updated contributions file. --- doc/contributions.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 3b995bcb31..4035dc7da2 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1009,10 +1009,11 @@ NiranV Dean STORM-2060 STORM-2061 STORM-2063 - STORM-2064 STORM-2065 STORM-2066 STORM-2068 + STORM-2073 + STORM-2076 BUG-372 BUG-1179 BUG-6835 @@ -1020,6 +1021,7 @@ NiranV Dean BUG-6839 BUG-6840 BUG-6958 + BUG-7020 Nounouch Hapmouche VWR-238 Ollie Kubrick -- cgit v1.2.3 From 7e5ede1678ef6b167602b3d8d0660c5e89e319f5 Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 16:56:18 +0200 Subject: STORM-2060/STORM-2076: Added: Commenting to explain why we use the height spinner instead of the width one. --- indra/newview/llfloatersnapshot.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 8037c22173..8677028942 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1,4 +1,4 @@ -/** +/** * @file llfloatersnapshot.cpp * @brief Snapshot preview window, allowing saving, e-mailing, etc. * @@ -813,6 +813,10 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL previewp->getSize(width, height); + // We use the height spinner here because we come here via the aspect ratio + // checkbox as well and we want height always changing to width by default. + // If we use the width spinner we would change width according to height by + // default, that is not what we want. updateSpinners(view, previewp, width, height, !getHeightSpinner(view)->isDirty()); // may change width and height if(getWidthSpinner(view)->getValue().asInteger() != width || getHeightSpinner(view)->getValue().asInteger() != height) -- cgit v1.2.3 From 0a134e749d01b711ca38a91044efb787cd815701 Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 16:57:30 +0200 Subject: Fixed: Line endings. --- indra/newview/llfloaterfacebook.cpp | 260 ++++++++++++++++++------------------ indra/newview/llfloaterfacebook.h | 34 ++--- 2 files changed, 147 insertions(+), 147 deletions(-) diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index d8cc070fd0..33422fb5fd 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -98,27 +98,27 @@ S32 compute_jpeg_quality(S32 width, S32 height) LLFacebookStatusPanel::LLFacebookStatusPanel() : mMessageTextEditor(NULL), mPostButton(NULL), - mCancelButton(NULL), - mAccountCaptionLabel(NULL), - mAccountNameLabel(NULL), - mPanelButtons(NULL), - mConnectButton(NULL), + mCancelButton(NULL), + mAccountCaptionLabel(NULL), + mAccountNameLabel(NULL), + mPanelButtons(NULL), + mConnectButton(NULL), mDisconnectButton(NULL) { - mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this)); - mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this)); - - setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2)); + mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this)); + mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this)); + + setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2)); mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLFacebookStatusPanel::onSend, this)); } BOOL LLFacebookStatusPanel::postBuild() { - mAccountCaptionLabel = getChild("account_caption_label"); - mAccountNameLabel = getChild("account_name_label"); - mPanelButtons = getChild("panel_buttons"); - mConnectButton = getChild("connect_btn"); + mAccountCaptionLabel = getChild("account_caption_label"); + mAccountNameLabel = getChild("account_name_label"); + mPanelButtons = getChild("panel_buttons"); + mConnectButton = getChild("connect_btn"); mDisconnectButton = getChild("disconnect_btn"); mMessageTextEditor = getChild("status_message"); @@ -130,15 +130,15 @@ BOOL LLFacebookStatusPanel::postBuild() void LLFacebookStatusPanel::draw() { - LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); - - //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress - bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; - mDisconnectButton->setEnabled(!disconnecting); - - //Disable the 'connect' button when a connection is in progress - bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; - mConnectButton->setEnabled(!connecting); + LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); + + //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress + bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; + mDisconnectButton->setEnabled(!disconnecting); + + //Disable the 'connect' button when a connection is in progress + bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; + mConnectButton->setEnabled(!connecting); if (mMessageTextEditor && mPostButton && mCancelButton) { @@ -171,18 +171,18 @@ void LLFacebookStatusPanel::onSend() bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data) { - if(LLFacebookConnect::instance().isConnected()) - { - //In process of disconnecting so leave the layout as is - if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) - { - showConnectedLayout(); - } - } - else - { - showDisconnectedLayout(); - } + if(LLFacebookConnect::instance().isConnected()) + { + //In process of disconnecting so leave the layout as is + if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) + { + showConnectedLayout(); + } + } + else + { + showDisconnectedLayout(); + } switch (data.get("enum").asInteger()) { @@ -209,102 +209,102 @@ void LLFacebookStatusPanel::sendStatus() } } -void LLFacebookStatusPanel::onVisibilityChange(BOOL visible) -{ - if(visible) - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); - - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this)); - - //Connected - if(LLFacebookConnect::instance().isConnected()) - { - showConnectedLayout(); - } - //Check if connected (show disconnected layout in meantime) - else - { - showDisconnectedLayout(); - } - if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || - (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) - { - LLFacebookConnect::instance().checkConnectionToFacebook(); - } - } - else - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); - } -} - -bool LLFacebookStatusPanel::onFacebookConnectInfoChange() -{ - LLSD info = LLFacebookConnect::instance().getInfo(); - std::string clickable_name; - - //Strings of format [http://www.somewebsite.com Click Me] become clickable text - if(info.has("link") && info.has("name")) - { - clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; - } - - mAccountNameLabel->setText(clickable_name); - - return false; -} - -void LLFacebookStatusPanel::showConnectButton() -{ - if(!mConnectButton->getVisible()) - { - mConnectButton->setVisible(TRUE); - mDisconnectButton->setVisible(FALSE); - } -} - -void LLFacebookStatusPanel::hideConnectButton() -{ - if(mConnectButton->getVisible()) - { - mConnectButton->setVisible(FALSE); - mDisconnectButton->setVisible(TRUE); - } -} - -void LLFacebookStatusPanel::showDisconnectedLayout() -{ - mAccountCaptionLabel->setText(getString("facebook_disconnected")); - mAccountNameLabel->setText(std::string("")); - showConnectButton(); -} - -void LLFacebookStatusPanel::showConnectedLayout() -{ - LLFacebookConnect::instance().loadFacebookInfo(); - - mAccountCaptionLabel->setText(getString("facebook_connected")); - hideConnectButton(); -} - -void LLFacebookStatusPanel::onConnect() -{ - LLFacebookConnect::instance().checkConnectionToFacebook(true); - - pressedConnect = TRUE; - //Clear only the facebook browser cookies so that the facebook login screen appears - LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); -} - -void LLFacebookStatusPanel::onDisconnect() -{ - LLFacebookConnect::instance().disconnectFromFacebook(); - - LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); +void LLFacebookStatusPanel::onVisibilityChange(BOOL visible) +{ + if(visible) + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); + + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this)); + + //Connected + if(LLFacebookConnect::instance().isConnected()) + { + showConnectedLayout(); + } + //Check if connected (show disconnected layout in meantime) + else + { + showDisconnectedLayout(); + } + if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || + (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) + { + LLFacebookConnect::instance().checkConnectionToFacebook(); + } + } + else + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); + } +} + +bool LLFacebookStatusPanel::onFacebookConnectInfoChange() +{ + LLSD info = LLFacebookConnect::instance().getInfo(); + std::string clickable_name; + + //Strings of format [http://www.somewebsite.com Click Me] become clickable text + if(info.has("link") && info.has("name")) + { + clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; + } + + mAccountNameLabel->setText(clickable_name); + + return false; +} + +void LLFacebookStatusPanel::showConnectButton() +{ + if(!mConnectButton->getVisible()) + { + mConnectButton->setVisible(TRUE); + mDisconnectButton->setVisible(FALSE); + } +} + +void LLFacebookStatusPanel::hideConnectButton() +{ + if(mConnectButton->getVisible()) + { + mConnectButton->setVisible(FALSE); + mDisconnectButton->setVisible(TRUE); + } +} + +void LLFacebookStatusPanel::showDisconnectedLayout() +{ + mAccountCaptionLabel->setText(getString("facebook_disconnected")); + mAccountNameLabel->setText(std::string("")); + showConnectButton(); +} + +void LLFacebookStatusPanel::showConnectedLayout() +{ + LLFacebookConnect::instance().loadFacebookInfo(); + + mAccountCaptionLabel->setText(getString("facebook_connected")); + hideConnectButton(); +} + +void LLFacebookStatusPanel::onConnect() +{ + LLFacebookConnect::instance().checkConnectionToFacebook(true); + + pressedConnect = TRUE; + //Clear only the facebook browser cookies so that the facebook login screen appears + LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); +} + +void LLFacebookStatusPanel::onDisconnect() +{ + LLFacebookConnect::instance().disconnectFromFacebook(); + + LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); } void LLFacebookStatusPanel::clearAndClose() diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h index e1526db18d..6fe7a6541b 100644 --- a/indra/newview/llfloaterfacebook.h +++ b/indra/newview/llfloaterfacebook.h @@ -51,23 +51,23 @@ public: void clearAndClose(); private: - void onVisibilityChange(BOOL new_visibility); - bool onFacebookConnectInfoChange(); - void onConnect(); - void onUseAnotherAccount(); - void onDisconnect(); - - void showConnectButton(); - void hideConnectButton(); - void showDisconnectedLayout(); - void showConnectedLayout(); - - bool pressedConnect; - - LLTextBox * mAccountCaptionLabel; - LLTextBox * mAccountNameLabel; - LLUICtrl * mPanelButtons; - LLUICtrl * mConnectButton; + void onVisibilityChange(BOOL new_visibility); + bool onFacebookConnectInfoChange(); + void onConnect(); + void onUseAnotherAccount(); + void onDisconnect(); + + void showConnectButton(); + void hideConnectButton(); + void showDisconnectedLayout(); + void showConnectedLayout(); + + bool pressedConnect; + + LLTextBox * mAccountCaptionLabel; + LLTextBox * mAccountNameLabel; + LLUICtrl * mPanelButtons; + LLUICtrl * mConnectButton; LLUICtrl * mDisconnectButton; LLUICtrl* mMessageTextEditor; LLUICtrl* mPostButton; -- cgit v1.2.3 From d632f91d942404f15d24fce741f12904f024798a Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 21 Aug 2014 16:12:40 -0700 Subject: GAMING-19 : Unknown content message on attempting to enter an SLSG restricted region with an ineligible account. --- indra/newview/llviewermessage.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 703c6d87c6..9554f06342 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5828,11 +5828,11 @@ bool handle_teleport_access_blocked(LLSD& llsdBlock) maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); returnValue = true; } - } + } - if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) + // If we have a notification but it is normally ignored, give a simple one instead of an in-your-face dialog + if (returnValue && (maturityLevelNotification != NULL) && maturityLevelNotification->isIgnored()) { - // Given a simple notification if no maturityLevelNotification is set or it is ignore LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock); } -- cgit v1.2.3 From 123f8e77cd643dcb8f701fafdaf1233e3ef03892 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 22 Aug 2014 16:38:37 +0300 Subject: MAINT-4288 FIXED Backed out changeset for MAINT-4018 (c92d43623c2c) --- indra/newview/llavatariconctrl.cpp | 5 ++--- indra/newview/llviewertexture.cpp | 11 ----------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index b89b0d9900..746b541f9d 100755 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -247,7 +247,7 @@ void LLAvatarIconCtrl::setValue(const LLSD& value) { LLAvatarPropertiesProcessor* app = LLAvatarPropertiesProcessor::getInstance(); - if (mAvatarId.notNull() && mAvatarId != value.asUUID()) + if (mAvatarId.notNull()) { app->removeObserver(mAvatarId, this); } @@ -255,7 +255,6 @@ void LLAvatarIconCtrl::setValue(const LLSD& value) if (mAvatarId != value.asUUID()) { mAvatarId = value.asUUID(); - app->addObserver(mAvatarId, this); // *BUG: This will return stale icons if a user changes their // profile picture. However, otherwise we send too many upstream @@ -271,7 +270,7 @@ void LLAvatarIconCtrl::setValue(const LLSD& value) // People API, rather than sending AvatarPropertyRequest // messages. People API already hits the user table. LLIconCtrl::setValue(mDefaultIconName); - // duplicated requests are filtered later if there are any + app->addObserver(mAvatarId, this); app->sendAvatarPropertiesRequest(mAvatarId); } } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 3f6d244af1..4e2eef39d6 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1480,17 +1480,6 @@ void LLViewerFetchedTexture::processTextureStats() { mDesiredDiscardLevel = 0; } - else if (mDontDiscard && (mBoostLevel == LLGLTexture::BOOST_UI || mBoostLevel == LLGLTexture::BOOST_ICON)) - { - if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT) - { - mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048 - } - else - { - mDesiredDiscardLevel = 0; - } - } else if(!mFullWidth || !mFullHeight) { mDesiredDiscardLevel = llmin(getMaxDiscardLevel(), (S32)mLoadedCallbackDesiredDiscardLevel); -- cgit v1.2.3 From ed29df03092092247d2743fe1c0ec9e501c4da28 Mon Sep 17 00:00:00 2001 From: NiranV Date: Tue, 26 Aug 2014 21:04:54 +0200 Subject: STORM-2073: Fixed: Double post when clicking "Post" while not logged in. Makes the previous double post for "Connect" obselete. --- indra/newview/llfloaterfacebook.cpp | 34 ++++++++++++++++++---------------- indra/newview/llfloaterfacebook.h | 3 +-- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index 33422fb5fd..6888e076aa 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -157,7 +157,6 @@ void LLFacebookStatusPanel::onSend() LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookStatusPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); - pressedConnect = FALSE; // Connect to Facebook if necessary and then post if (LLFacebookConnect::instance().isConnected()) { @@ -170,6 +169,23 @@ void LLFacebookStatusPanel::onSend() } bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data) +{ + switch (data.get("enum").asInteger()) + { + case LLFacebookConnect::FB_CONNECTED: + sendStatus(); + break; + + case LLFacebookConnect::FB_POSTED: + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); + clearAndClose(); + break; + } + + return false; +} + +bool LLFacebookStatusPanel::onFacebookConnectAccountStateChange(const LLSD& data) { if(LLFacebookConnect::instance().isConnected()) { @@ -184,19 +200,6 @@ bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data) showDisconnectedLayout(); } - switch (data.get("enum").asInteger()) - { - case LLFacebookConnect::FB_CONNECTED: - if(!pressedConnect) - sendStatus(); - break; - - case LLFacebookConnect::FB_POSTED: - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); - clearAndClose(); - break; - } - return false; } @@ -214,7 +217,7 @@ void LLFacebookStatusPanel::onVisibilityChange(BOOL visible) if(visible) { LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectAccountStateChange, this, _1)); LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this)); @@ -295,7 +298,6 @@ void LLFacebookStatusPanel::onConnect() { LLFacebookConnect::instance().checkConnectionToFacebook(true); - pressedConnect = TRUE; //Clear only the facebook browser cookies so that the facebook login screen appears LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); } diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h index 6fe7a6541b..a4ca666b20 100644 --- a/indra/newview/llfloaterfacebook.h +++ b/indra/newview/llfloaterfacebook.h @@ -46,6 +46,7 @@ public: void draw(); void onSend(); bool onFacebookConnectStateChange(const LLSD& data); + bool onFacebookConnectAccountStateChange(const LLSD& data); void sendStatus(); void clearAndClose(); @@ -62,8 +63,6 @@ private: void showDisconnectedLayout(); void showConnectedLayout(); - bool pressedConnect; - LLTextBox * mAccountCaptionLabel; LLTextBox * mAccountNameLabel; LLUICtrl * mPanelButtons; -- cgit v1.2.3 From ef9bee5098bc1adcb9054bba6f4bc24f184e445a Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 8 Sep 2014 14:52:59 -0400 Subject: Added tag 3.7.15-release for changeset 3f11f57f2b4d --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index bd574ec656..dd0dc4499a 100755 --- a/.hgtags +++ b/.hgtags @@ -487,3 +487,4 @@ a9f2d0cb11f73b06858e6083bb50083becc3f9cd 3.7.9-release 3b44ea8988cb902f0dda8429e8d5e4569e304532 3.7.12-release d86a7e1bc96d27b683f951d3701d5b7042158c68 3.7.13-release a7872554f3665588f1e8347d472cec3a299254b3 3.7.14-release +3f11f57f2b4d15a9f987d12bc70ef507eefb5018 3.7.15-release -- cgit v1.2.3 From eef4acc5367a486b0c52c6ce5e1aba995fefd99c Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 8 Sep 2014 14:52:59 -0400 Subject: increment viewer version to 3.7.16 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 03d7b8fb9b..36f601f10e 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.7.15 +3.7.16 -- cgit v1.2.3 From 19ce74567954d5b234cb931f7faa5fe58037c513 Mon Sep 17 00:00:00 2001 From: MNikolenko ProductEngine Date: Tue, 9 Sep 2014 20:54:05 +0300 Subject: MAINT-4432 FIXED Packets Lost under Help -> About Second Life does not display correctly --- indra/newview/skins/default/xui/fr/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index 46fcbe005f..bca134eef3 100755 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -71,7 +71,7 @@ Version Qt Webkit : [QT_WEBKIT_VERSION] Version serveur vocal : [VOICE_VERSION] - Paquets perdus : [PACKETS_LOST,nombre,0]/[PACKETS_IN,nombre,0] ([PACKETS_PCT,nombre,1]%) + Paquets perdus : [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%) Erreur lors de la récupération de l'URL des notes de version du serveur. -- cgit v1.2.3 From 7982ae6b911b8e0400aa593c476b8a634174a6a5 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 28 Aug 2014 19:36:47 +0300 Subject: MAINT-3967 FIXED Up arrow key does not move the cursor up in chat field. Reverted previous two fixes and modified LLTextBase::changeLine() --- indra/llui/lltextbase.cpp | 34 +++++++----------------- indra/llui/lltextbase.h | 1 - indra/llui/lltexteditor.cpp | 64 ++------------------------------------------- 3 files changed, 11 insertions(+), 88 deletions(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 2d7062e71d..9b125a85b9 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -218,8 +218,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mParseHighlights(p.parse_highlights), mBGVisible(p.bg_visible), mScroller(NULL), - mStyleDirty(true), - mDrawRightmostCursor(false) + mStyleDirty(true) { if(p.allow_scroll) { @@ -1505,11 +1504,6 @@ void LLTextBase::reflow() // find and erase line info structs starting at start_index and going to end of document if (!mLineInfoList.empty()) { - if (mDrawRightmostCursor) - { - start_index--; - } - // find first element whose end comes after start_index line_list_t::iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), start_index, line_end_compare()); line_start_index = iter->mDocIndexStart; @@ -1698,11 +1692,6 @@ S32 LLTextBase::getLineNumFromDocIndex( S32 doc_index, bool include_wordwrap) co } else { - if (mDrawRightmostCursor) - { - doc_index--; - } - line_list_t::const_iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), doc_index, line_end_compare()); if (include_wordwrap) { @@ -1731,11 +1720,6 @@ S32 LLTextBase::getLineOffsetFromDocIndex( S32 startpos, bool include_wordwrap) } else { - if (mDrawRightmostCursor) - { - startpos--; - } - line_list_t::const_iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), startpos, line_end_compare()); return startpos - iter->mDocIndexStart; } @@ -2456,7 +2440,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round, } else if (hit_past_end_of_line && segmentp->getEnd() >= line_iter->mDocIndexEnd) { - if (getLineNumFromDocIndex(line_iter->mDocIndexEnd - 1) == line_iter->mLineNum && !mDrawRightmostCursor) + if (getLineNumFromDocIndex(line_iter->mDocIndexEnd - 1) == line_iter->mLineNum) { // if segment wraps to the next line we should step one char back // to compensate for the space char between words @@ -2489,13 +2473,7 @@ LLRect LLTextBase::getDocRectFromDocIndex(S32 pos) const // clamp pos to valid values pos = llclamp(pos, 0, mLineInfoList.back().mDocIndexEnd - 1); - S32 corrected_pos = pos; - if (mDrawRightmostCursor && pos > 0) - { - corrected_pos--; - } - - line_list_t::const_iterator line_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), corrected_pos, line_end_compare()); + line_list_t::const_iterator line_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), pos, line_end_compare()); doc_rect.mLeft = line_iter->mRect.mLeft; doc_rect.mBottom = line_iter->mRect.mBottom; @@ -2670,6 +2648,12 @@ void LLTextBase::changeLine( S32 delta ) LLRect visible_region = getVisibleDocumentRect(); S32 new_cursor_pos = getDocIndexFromLocalCoord(mDesiredXPixel, mLineInfoList[new_line].mRect.mBottom + mVisibleTextRect.mBottom - visible_region.mBottom, TRUE); + S32 actual_line = getLineNumFromDocIndex(new_cursor_pos); + if (actual_line != new_line) + { + // line edge, correcting position by 1 to move onto proper line + new_cursor_pos += new_line - actual_line; + } setCursorPos(new_cursor_pos, true); } } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 9c3bc3ed98..738b4d5b8e 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -618,7 +618,6 @@ protected: // cursor S32 mCursorPos; // I-beam is just after the mCursorPos-th character. - bool mDrawRightmostCursor; // When cursor is on the rightmost position on the line S32 mDesiredXPixel; // X pixel position where the user wants the cursor to be LLFrameTimer mCursorBlinkTimer; // timer that controls cursor blinking diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 9219490bf2..cf5fdef539 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1124,13 +1124,6 @@ void LLTextEditor::addChar(llwchar wc) setCursorPos(new_cursor_pos); } } - - if (mCursorPos > 0) - { - LLRect current_cursor_rect = getDocRectFromDocIndex(mCursorPos); - LLRect prev_cursor_rect = getDocRectFromDocIndex(mCursorPos - 1); - mDrawRightmostCursor = current_cursor_rect.mBottom < prev_cursor_rect.mBottom; - } } void LLTextEditor::addLineBreakChar(BOOL group_together) @@ -1277,12 +1270,6 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) break; case KEY_HOME: - if(mDrawRightmostCursor && mCursorPos > 0) - { - mCursorPos--; - mDrawRightmostCursor = false; - } - startOfLine(); break; @@ -1297,23 +1284,6 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) case KEY_END: endOfLine(); - { - S32 last_line_index = mLineInfoList.size() - 1; - if (getLineNumFromDocIndex(mCursorPos, true) < last_line_index) - { - mDrawRightmostCursor = true; - setCursorPos(mCursorPos + 1); - } - else if (last_line_index > 0) // only for two and more lines - { - S32 prev_line_width = mLineInfoList[last_line_index - 1].mRect.getWidth(); - S32 last_line_width = mLineInfoList[last_line_index].mRect.getWidth(); - if (prev_line_width <= last_line_width) - { - mDrawRightmostCursor = true; - } - } - } break; case KEY_LEFT: @@ -1325,18 +1295,7 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) { if( 0 < mCursorPos ) { - LLRect current_cursor_rect = getDocRectFromDocIndex(mCursorPos); - LLRect next_cursor_rect = getDocRectFromDocIndex(mCursorPos - 1); - - if (current_cursor_rect.mBottom < next_cursor_rect.mBottom) - { - mDrawRightmostCursor = true; - } - else - { - mDrawRightmostCursor = false; - setCursorPos(mCursorPos - 1); - } + setCursorPos(mCursorPos - 1); } else { @@ -1354,26 +1313,7 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) { if( mCursorPos < getLength() ) { - LLRect current_cursor_rect = getDocRectFromDocIndex(mCursorPos); - LLRect next_cursor_rect = getDocRectFromDocIndex(mCursorPos + 1); - - if (current_cursor_rect.mBottom > next_cursor_rect.mBottom) - { - if (mDrawRightmostCursor) - { - mDrawRightmostCursor = false; - } - else - { - mDrawRightmostCursor = true; - setCursorPos(mCursorPos + 1); - } - } - else - { - mDrawRightmostCursor = false; - setCursorPos(mCursorPos + 1); - } + setCursorPos(mCursorPos + 1); } else { -- cgit v1.2.3 From c97d191ab3aaf87e939e07e8d3d9b325ed3be386 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 22 Sep 2014 14:26:06 -0400 Subject: Added tag 3.7.16-release for changeset 562e7dace746 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index dd0dc4499a..be348ca406 100755 --- a/.hgtags +++ b/.hgtags @@ -488,3 +488,4 @@ a9f2d0cb11f73b06858e6083bb50083becc3f9cd 3.7.9-release d86a7e1bc96d27b683f951d3701d5b7042158c68 3.7.13-release a7872554f3665588f1e8347d472cec3a299254b3 3.7.14-release 3f11f57f2b4d15a9f987d12bc70ef507eefb5018 3.7.15-release +562e7dace7465060ac9adb2e8eca800b699ff024 3.7.16-release -- cgit v1.2.3 From 499f5aa9a4b46d61ee94b26d5c86bc032766af70 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 22 Sep 2014 14:26:06 -0400 Subject: increment viewer version to 3.7.17 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 36f601f10e..9a4c4371ee 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.7.16 +3.7.17 -- cgit v1.2.3