diff options
author | Melinda Green <melinda@lindenlab.com> | 2008-12-15 21:21:19 +0000 |
---|---|---|
committer | Melinda Green <melinda@lindenlab.com> | 2008-12-15 21:21:19 +0000 |
commit | e1d8dac25a93db837c780428a23f81cbf9109270 (patch) | |
tree | a0bcaec0cec1ba6b3ce813764650eada61fcde4f /indra/newview/llfloatertools.cpp | |
parent | 9c0dbb123376608e464fcd8d1a2e288e01d78a3f (diff) |
svn merge -r105329:105903 svn+ssh://svn/svn/linden/branches/featurettes/featurettes-batch4-merge
Resolving QAR-1051 Merge featurettes batch #4
Diffstat (limited to 'indra/newview/llfloatertools.cpp')
-rw-r--r-- | indra/newview/llfloatertools.cpp | 115 |
1 files changed, 28 insertions, 87 deletions
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 9e5eb2008b..1c28991261 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -53,6 +53,7 @@ #include "llpanelobject.h" #include "llpanelvolume.h" #include "llpanelpermissions.h" +#include "llresmgr.h" #include "llselectmgr.h" #include "llslider.h" #include "llstatusbar.h" @@ -106,9 +107,8 @@ void click_popup_rotate_left(void*); void click_popup_rotate_reset(void*); void click_popup_rotate_right(void*); void click_popup_dozer_mode(LLUICtrl *, void *user); -void click_popup_dozer_size(LLUICtrl *, void *user); +void commit_slider_dozer_size(LLUICtrl *, void*); void commit_slider_dozer_force(LLUICtrl *, void*); -void click_dozer_size(LLUICtrl *, void*); void click_apply_to_selection(void*); void commit_radio_zoom(LLUICtrl *, void*); void commit_radio_orbit(LLUICtrl *, void*); @@ -303,27 +303,22 @@ BOOL LLFloaterTools::postBuild() childSetCommitCallback("radio noise",click_popup_dozer_mode, (void*)4); mRadioDozerRevert = getChild<LLCheckBoxCtrl>("radio revert"); childSetCommitCallback("radio revert",click_popup_dozer_mode, (void*)5); - mComboDozerSize = getChild<LLComboBox>("combobox brush size"); - childSetCommitCallback("combobox brush size",click_dozer_size, (void*)0); - if(mComboDozerSize) mComboDozerSize->setCurrentByIndex(0); mBtnApplyToSelection = getChild<LLButton>("button apply to selection"); childSetAction("button apply to selection",click_apply_to_selection, (void*)0); - mCheckShowOwners = getChild<LLCheckBoxCtrl>("checkbox show owners"); - childSetValue("checkbox show owners",gSavedSettings.getBOOL("ShowParcelOwners")); + mSliderDozerSize = getChild<LLSlider>("slider brush size"); + childSetCommitCallback("slider brush size", commit_slider_dozer_size, (void*)0); + childSetValue( "slider brush size", gSavedSettings.getS32("RadioLandBrushSize")); + mSliderDozerForce = getChild<LLSlider>("slider force"); childSetCommitCallback("slider force",commit_slider_dozer_force, (void*)0); // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here childSetValue( "slider force", log10(gSavedSettings.getF32("LandBrushForce"))); - childSetAction("button more", click_show_more, this); - childSetAction("button less", click_show_more, this); mTab = getChild<LLTabContainer>("Object Info Tabs"); if(mTab) { - mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") ); mTab->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); - mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") ); mTab->setBorderVisible(FALSE); mTab->selectFirstTab(); } @@ -391,10 +386,9 @@ LLFloaterTools::LLFloaterTools() mRadioDozerSmooth(NULL), mRadioDozerNoise(NULL), mRadioDozerRevert(NULL), - mComboDozerSize(NULL), + mSliderDozerSize(NULL), + mSliderDozerForce(NULL), mBtnApplyToSelection(NULL), - mCheckShowOwners(NULL), - mTab(NULL), mPanelPermissions(NULL), @@ -418,19 +412,6 @@ LLFloaterTools::LLFloaterTools() factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo LLUICtrlFactory::getInstance()->buildFloater(this,"floater_tools.xml",&factory_map,FALSE); - - mLargeHeight = getRect().getHeight(); - mSmallHeight = mLargeHeight; - if (mTab) mSmallHeight -= mTab->getRect().getHeight(); - - // force a toggle initially. seems to be needed to correctly initialize - // both "more" and "less" cases. it also seems to be important to begin - // with the user's preference first so that it's initial position will - // be correct (SL-51192) -MG - BOOL show_more = gSavedSettings.getBOOL("ToolboxShowMore"); // get user's preference - gSavedSettings.setBOOL("ToolboxShowMore", show_more); // sets up forced toggle below - showMore( !show_more ); // does the toggle - showMore( show_more ); // reset the real user's preference } LLFloaterTools::~LLFloaterTools() @@ -474,6 +455,16 @@ void LLFloaterTools::refresh() mTab->enableTabButton(idx_face, all_volume); mTab->enableTabButton(idx_contents, all_volume); + // Refresh object and prim count labels + LLLocale locale(LLLocale::USER_LOCALE); + std::string obj_count_string; + LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); + childSetTextArg("obj_count", "[COUNT]", obj_count_string); + std::string prim_count_string; + LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); + childSetTextArg("prim_count", "[COUNT]", prim_count_string); + + // Refresh child tabs mPanelPermissions->refresh(); mPanelObject->refresh(); mPanelVolume->refresh(); @@ -702,7 +693,6 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) if (mRadioSelectLand) mRadioSelectLand->setVisible( land_visible ); S32 dozer_mode = gSavedSettings.getS32("RadioLandBrushAction"); - S32 dozer_size = gSavedSettings.getS32("RadioLandBrushSize"); if (mRadioDozerFlatten) { @@ -734,20 +724,16 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) mRadioDozerRevert ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 5); mRadioDozerRevert ->setVisible( land_visible ); } - if (mComboDozerSize) - { - mComboDozerSize ->setCurrentByIndex(dozer_size); - mComboDozerSize ->setVisible( land_visible ); - mComboDozerSize ->setEnabled( tool == LLToolBrushLand::getInstance() ); - } if (mBtnApplyToSelection) { mBtnApplyToSelection->setVisible( land_visible ); mBtnApplyToSelection->setEnabled( land_visible && !LLViewerParcelMgr::getInstance()->selectionEmpty() && tool != LLToolSelectLand::getInstance()); } - if (mCheckShowOwners) + if (mSliderDozerSize) { - mCheckShowOwners ->setVisible( land_visible ); + mSliderDozerSize ->setVisible( land_visible ); + childSetVisible("Bulldozer:", land_visible); + childSetVisible("Dozer Size:", land_visible); } if (mSliderDozerForce) { @@ -755,13 +741,10 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) childSetVisible("Strength:", land_visible); } - // - // More panel visibility - // - BOOL show_more = gSavedSettings.getBOOL("ToolboxShowMore"); - - mTab->setVisible(show_more && tool != LLToolBrushLand::getInstance() && tool != LLToolSelectLand::getInstance()); - mPanelLandInfo->setVisible(show_more && (tool == LLToolBrushLand::getInstance() || tool == LLToolSelectLand::getInstance())); + childSetVisible("obj_count", !land_visible); + childSetVisible("prim_count", !land_visible); + mTab->setVisible(!land_visible); + mPanelLandInfo->setVisible(land_visible); } @@ -816,46 +799,12 @@ void LLFloaterTools::onClose(bool app_quitting) // gMenuBarView->arrange(); } -void LLFloaterTools::showMore(BOOL show_more) -{ - BOOL showing_more = gSavedSettings.getBOOL("ToolboxShowMore"); - if (show_more == showing_more) - { - return; - } - - gSavedSettings.setBOOL("ToolboxShowMore", show_more); - - // Visibility updated next frame - JC - // mTab->setVisible(show_more); - - if (show_more) - { - reshape( getRect().getWidth(), mLargeHeight, TRUE); - translate( 0, mSmallHeight - mLargeHeight ); - } - else - { - reshape( getRect().getWidth(), mSmallHeight, TRUE); - translate( 0, mLargeHeight - mSmallHeight ); - } - childSetVisible("button less", show_more); - childSetVisible("button more", !show_more); -} - void LLFloaterTools::showPanel(EInfoPanel panel) { llassert(panel >= 0 && panel < PANEL_COUNT); mTab->selectTabByName(PANEL_NAMES[panel]); } -void click_show_more(void *userdata) -{ - LLFloaterTools *f = (LLFloaterTools *)userdata; - BOOL show_more = !gSavedSettings.getBOOL("ToolboxShowMore"); - f->showMore( show_more ); -} - void click_popup_info(void*) { // gBuildView->setPropertiesPanelOpen(TRUE); @@ -933,22 +882,14 @@ void click_popup_rotate_right(void*) void click_popup_dozer_mode(LLUICtrl *, void *user) { - S32 show_owners = gSavedSettings.getBOOL("ShowParcelOwners"); S32 mode = (S32)(intptr_t) user; gFloaterTools->setEditTool( LLToolBrushLand::getInstance() ); gSavedSettings.setS32("RadioLandBrushAction", mode); - gSavedSettings.setBOOL("ShowParcelOwners", show_owners); -} - -void click_popup_dozer_size(LLUICtrl *, void *user) -{ - S32 size = (S32)(intptr_t) user; - gSavedSettings.setS32("RadioLandBrushSize", size); } -void click_dozer_size(LLUICtrl *ctrl, void *user) +void commit_slider_dozer_size(LLUICtrl *ctrl, void*) { - S32 size = ((LLComboBox*) ctrl)->getCurrentIndex(); + S32 size = (S32)ctrl->getValue().asInteger(); gSavedSettings.setS32("RadioLandBrushSize", size); } |