aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatertools.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-04 18:53:30 -0700
committerMcCabe Maxsted2009-09-04 18:53:30 -0700
commite0450b604383f3a0276097496f1935e1b543ec5e (patch)
tree22f3d9bc82d90d24cfae02dd0d9f7da44fb4e5c6 /linden/indra/newview/llfloatertools.cpp
parentfix NDOF linking issues when using cmake 2.6 on linux (diff)
downloadmeta-impy-e0450b604383f3a0276097496f1935e1b543ec5e.zip
meta-impy-e0450b604383f3a0276097496f1935e1b543ec5e.tar.gz
meta-impy-e0450b604383f3a0276097496f1935e1b543ec5e.tar.bz2
meta-impy-e0450b604383f3a0276097496f1935e1b543ec5e.tar.xz
Integrated 1.23's tool floater with link/unlink buttons
Diffstat (limited to 'linden/indra/newview/llfloatertools.cpp')
-rw-r--r--linden/indra/newview/llfloatertools.cpp81
1 files changed, 19 insertions, 62 deletions
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index 84a1edc..a99227d 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -54,6 +54,7 @@
54#include "llpanelobject.h" 54#include "llpanelobject.h"
55#include "llpanelvolume.h" 55#include "llpanelvolume.h"
56#include "llpanelpermissions.h" 56#include "llpanelpermissions.h"
57#include "llresmgr.h"
57#include "llselectmgr.h" 58#include "llselectmgr.h"
58#include "llslider.h" 59#include "llslider.h"
59#include "llstatusbar.h" 60#include "llstatusbar.h"
@@ -329,14 +330,10 @@ BOOL LLFloaterTools::postBuild()
329 // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here 330 // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here
330 childSetValue( "slider force", log10(gSavedSettings.getF32("LandBrushForce"))); 331 childSetValue( "slider force", log10(gSavedSettings.getF32("LandBrushForce")));
331 332
332 childSetAction("button more", click_show_more, this);
333 childSetAction("button less", click_show_more, this);
334 mTab = getChild<LLTabContainer>("Object Info Tabs"); 333 mTab = getChild<LLTabContainer>("Object Info Tabs");
335 if(mTab) 334 if(mTab)
336 { 335 {
337 mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") );
338 mTab->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); 336 mTab->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
339 mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") );
340 mTab->setBorderVisible(FALSE); 337 mTab->setBorderVisible(FALSE);
341 mTab->selectFirstTab(); 338 mTab->selectFirstTab();
342 } 339 }
@@ -436,19 +433,6 @@ LLFloaterTools::LLFloaterTools()
436 factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo 433 factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo
437 434
438 LLUICtrlFactory::getInstance()->buildFloater(this,"floater_tools.xml",&factory_map,FALSE); 435 LLUICtrlFactory::getInstance()->buildFloater(this,"floater_tools.xml",&factory_map,FALSE);
439
440 mLargeHeight = getRect().getHeight();
441 mSmallHeight = mLargeHeight;
442 if (mTab) mSmallHeight -= mTab->getRect().getHeight();
443
444 // force a toggle initially. seems to be needed to correctly initialize
445 // both "more" and "less" cases. it also seems to be important to begin
446 // with the user's preference first so that it's initial position will
447 // be correct (SL-51192) -MG
448 BOOL show_more = gSavedSettings.getBOOL("ToolboxShowMore"); // get user's preference
449 gSavedSettings.setBOOL("ToolboxShowMore", show_more); // sets up forced toggle below
450 showMore( !show_more ); // does the toggle
451 showMore( show_more ); // reset the real user's preference
452} 436}
453 437
454LLFloaterTools::~LLFloaterTools() 438LLFloaterTools::~LLFloaterTools()
@@ -492,6 +476,16 @@ void LLFloaterTools::refresh()
492 mTab->enableTabButton(idx_face, all_volume); 476 mTab->enableTabButton(idx_face, all_volume);
493 mTab->enableTabButton(idx_contents, all_volume); 477 mTab->enableTabButton(idx_contents, all_volume);
494 478
479 // Refresh object and prim count labels
480 LLLocale locale(LLLocale::USER_LOCALE);
481 std::string obj_count_string;
482 LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount());
483 childSetTextArg("obj_count", "[COUNT]", obj_count_string);
484 std::string prim_count_string;
485 LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount());
486 childSetTextArg("prim_count", "[COUNT]", prim_count_string);
487
488 // Refresh child tabs
495 mPanelPermissions->refresh(); 489 mPanelPermissions->refresh();
496 mPanelObject->refresh(); 490 mPanelObject->refresh();
497 mPanelVolume->refresh(); 491 mPanelVolume->refresh();
@@ -799,8 +793,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
799 if (mSliderDozerSize) 793 if (mSliderDozerSize)
800 { 794 {
801 mSliderDozerSize ->setVisible( land_visible ); 795 mSliderDozerSize ->setVisible( land_visible );
802 childSetVisible("Brush:", land_visible); 796 childSetVisible("Bulldozer:", land_visible);
803 childSetVisible("Brush Size:", land_visible); 797 childSetVisible("Dozer Size:", land_visible);
804 } 798 }
805 if (mCheckShowOwners) 799 if (mCheckShowOwners)
806 { 800 {
@@ -812,13 +806,10 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
812 childSetVisible("Strength:", land_visible); 806 childSetVisible("Strength:", land_visible);
813 } 807 }
814 808
815 // 809 childSetVisible("obj_count", !land_visible);
816 // More panel visibility 810 childSetVisible("prim_count", !land_visible);
817 // 811 mTab->setVisible(!land_visible);
818 BOOL show_more = gSavedSettings.getBOOL("ToolboxShowMore"); 812 mPanelLandInfo->setVisible(land_visible);
819
820 mTab->setVisible(show_more && tool != LLToolBrushLand::getInstance() && tool != LLToolSelectLand::getInstance());
821 mPanelLandInfo->setVisible(show_more && (tool == LLToolBrushLand::getInstance() || tool == LLToolSelectLand::getInstance()));
822} 813}
823 814
824 815
@@ -873,46 +864,12 @@ void LLFloaterTools::onClose(bool app_quitting)
873 // gMenuBarView->arrange(); 864 // gMenuBarView->arrange();
874} 865}
875 866
876void LLFloaterTools::showMore(BOOL show_more)
877{
878 BOOL showing_more = gSavedSettings.getBOOL("ToolboxShowMore");
879 if (show_more == showing_more)
880 {
881 return;
882 }
883
884 gSavedSettings.setBOOL("ToolboxShowMore", show_more);
885
886 // Visibility updated next frame - JC
887 // mTab->setVisible(show_more);
888
889 if (show_more)
890 {
891 reshape( getRect().getWidth(), mLargeHeight, TRUE);
892 translate( 0, mSmallHeight - mLargeHeight );
893 }
894 else
895 {
896 reshape( getRect().getWidth(), mSmallHeight, TRUE);
897 translate( 0, mLargeHeight - mSmallHeight );
898 }
899 childSetVisible("button less", show_more);
900 childSetVisible("button more", !show_more);
901}
902
903void LLFloaterTools::showPanel(EInfoPanel panel) 867void LLFloaterTools::showPanel(EInfoPanel panel)
904{ 868{
905 llassert(panel >= 0 && panel < PANEL_COUNT); 869 llassert(panel >= 0 && panel < PANEL_COUNT);
906 mTab->selectTabByName(PANEL_NAMES[panel]); 870 mTab->selectTabByName(PANEL_NAMES[panel]);
907} 871}
908 872
909void click_show_more(void *userdata)
910{
911 LLFloaterTools *f = (LLFloaterTools *)userdata;
912 BOOL show_more = !gSavedSettings.getBOOL("ToolboxShowMore");
913 f->showMore( show_more );
914}
915
916void click_popup_info(void*) 873void click_popup_info(void*)
917{ 874{
918// gBuildView->setPropertiesPanelOpen(TRUE); 875// gBuildView->setPropertiesPanelOpen(TRUE);
@@ -997,8 +954,8 @@ void click_popup_dozer_mode(LLUICtrl *, void *user)
997 954
998void commit_slider_dozer_size(LLUICtrl *ctrl, void*) 955void commit_slider_dozer_size(LLUICtrl *ctrl, void*)
999{ 956{
1000 S32 size = (S32)ctrl->getValue().asInteger(); 957 F32 size = (F32)ctrl->getValue().asReal();
1001 gSavedSettings.setS32("LandBrushSize", size); 958 gSavedSettings.setF32("LandBrushSize", size);
1002} 959}
1003 960
1004void commit_slider_dozer_force(LLUICtrl *ctrl, void*) 961void commit_slider_dozer_force(LLUICtrl *ctrl, void*)