From 83aa99aa77ddbe69082c1b557787bcf029003775 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Mon, 19 Apr 2010 04:38:13 -0700 Subject: Applied slviewer-0-v12350-NumberOfDecimalsInTools.patch patch from the CV --- linden/indra/newview/app_settings/settings.xml | 11 +++++++++ linden/indra/newview/llfloatertools.cpp | 34 +++++++++++++++++++++++--- linden/indra/newview/llfloatertools.h | 5 +++- 3 files changed, 46 insertions(+), 4 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 0fee2e0..6d5fc58 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -15,6 +15,17 @@ Value 1 + DecimalsForTools + + Comment + Number of decimals for the edit tool position, size and rotation settings (0 to 5) + Persist + 1 + Type + U32 + Value + 3 + DisableLoginLogoutScreens Comment diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 260872f..c145791 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2009, Linden Research, Inc. + * Copyright (c) 2002-2010, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -58,6 +58,7 @@ #include "llresmgr.h" #include "llselectmgr.h" #include "llslider.h" +#include "llspinctrl.h" #include "llstatusbar.h" #include "lltabcontainer.h" #include "lltextbox.h" @@ -178,6 +179,28 @@ void* LLFloaterTools::createPanelLandInfo(void* data) return floater->mPanelLandInfo; } +void LLFloaterTools::toolsPrecision() +{ + U32 decimals = gSavedSettings.getU32("DecimalsForTools"); + if (decimals != mPrecision) + { + if (decimals > 5) + { + decimals = 5; + } + getChild("Pos X")->setPrecision(decimals); + getChild("Pos Y")->setPrecision(decimals); + getChild("Pos Z")->setPrecision(decimals); + getChild("Scale X")->setPrecision(decimals); + getChild("Scale Y")->setPrecision(decimals); + getChild("Scale Z")->setPrecision(decimals); + getChild("Rot X")->setPrecision(decimals); + getChild("Rot Y")->setPrecision(decimals); + getChild("Rot Z")->setPrecision(decimals); + mPrecision = decimals; + } +} + BOOL LLFloaterTools::postBuild() { @@ -245,6 +268,8 @@ BOOL LLFloaterTools::postBuild() mBtnUnlink = getChild("unlink_btn"); childSetAction("unlink_btn",onClickUnlink, this); + toolsPrecision(); + // // Create Buttons // @@ -418,7 +443,8 @@ LLFloaterTools::LLFloaterTools() mPanelLandInfo(NULL), mTabLand(NULL), - mDirty(TRUE) + mDirty(TRUE), + mPrecision(3) { setAutoFocus(FALSE); LLCallbackMap::map_t factory_map; @@ -483,6 +509,8 @@ void LLFloaterTools::refresh() LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); childSetTextArg("prim_count", "[COUNT]", prim_count_string); + toolsPrecision(); + // Refresh child tabs mPanelPermissions->refresh(); mPanelObject->refresh(); @@ -864,7 +892,7 @@ void LLFloaterTools::onClose(bool app_quitting) LLViewerJoystick::getInstance()->moveAvatar(false); - // Different from handle_reset_view in that it doesn't actually + // Different from handle_reset_view in that it doesn't actually // move the camera if EditCameraMovement is not set. gAgent.resetView(gSavedSettings.getBOOL("EditCameraMovement")); diff --git a/linden/indra/newview/llfloatertools.h b/linden/indra/newview/llfloatertools.h index 2bb3fb7..ba09bc8 100644 --- a/linden/indra/newview/llfloatertools.h +++ b/linden/indra/newview/llfloatertools.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2009, Linden Research, Inc. + * Copyright (c) 2002-2010, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -79,6 +79,8 @@ public: // button highlights, etc. void updatePopup(LLCoordGL center, MASK mask); + void toolsPrecision(); + // When the floater is going away, reset any options that need to be // cleared. void resetToolState(); @@ -197,6 +199,7 @@ public: private: BOOL mDirty; + U32 mPrecision; std::map mStatusText; -- cgit v1.1