From 9b526997d93d9290602a86f91a7f096da4395d97 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 30 Jul 2010 10:02:30 -0700 Subject: deprecated LLPanel::child*() methods --- indra/newview/llstatusbar.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index c02559b209..fc5937ea7d 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -235,7 +235,7 @@ BOOL LLStatusBar::postBuild() mSGPacketLoss->mPerSec = FALSE; addChild(mSGPacketLoss); - childSetActionTextbox("stat_btn", onClickStatGraph); + getChild("stat_btn")->setClickedCallback(onClickStatGraph); mPanelVolumePulldown = new LLPanelVolumePulldown(); addChild(mPanelVolumePulldown); @@ -300,15 +300,16 @@ void LLStatusBar::refresh() if (LLHUDIcon::iconsNearby()) { - childGetRect( "scriptout", buttonRect ); + LLView* script_out = getChildView("scriptout"); + buttonRect = script_out->getRect(); r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect("scriptout",r); - childSetVisible("scriptout", true); + script_out->setShape(r); + script_out->setVisible( true); x += buttonRect.getWidth(); } else { - childSetVisible("scriptout", false); + getChildView("scriptout")->setVisible( false); } if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK && @@ -317,24 +318,25 @@ void LLStatusBar::refresh() // set visibility based on flashing if( mHealthTimer->hasExpired() ) { - childSetVisible("health", true); + getChildView("health")->setVisible( true); } else { BOOL flash = S32(mHealthTimer->getElapsedSeconds() * ICON_FLASH_FREQUENCY) & 1; - childSetVisible("health", flash); + getChildView("health")->setVisible( flash); } // Health - childGetRect( "health", buttonRect ); + LLView* healthp = getChildView("health"); + buttonRect = healthp->getRect(); r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect("health", r); + healthp->setShape(r); x += buttonRect.getWidth(); } mSGBandwidth->setVisible(net_stats_visible); mSGPacketLoss->setVisible(net_stats_visible); - childSetEnabled("stat_btn", net_stats_visible); + getChildView("stat_btn")->setEnabled(net_stats_visible); // update the master volume button state bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); -- cgit v1.2.3 From b95ad3b5cec84387d20d2a1af08eeb090b54b134 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 30 Jul 2010 15:17:32 -0700 Subject: further UI rendering performance improvements --- indra/newview/llstatusbar.cpp | 89 +++++++++++++------------------------------ 1 file changed, 26 insertions(+), 63 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index fc5937ea7d..213925ecdf 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -195,9 +195,6 @@ BOOL LLStatusBar::postBuild() gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); - childSetAction("scriptout", onClickScriptDebug, this); - childSetAction("health", onClickHealth, this); - // Adding Net Stat Graph S32 x = getRect().getWidth() - 2; S32 y = 0; @@ -247,14 +244,17 @@ BOOL LLStatusBar::postBuild() mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); mPanelNearByMedia->setVisible(FALSE); + mScriptOut = getChildView("scriptout"); + return TRUE; } // Per-frame updates of visibility void LLStatusBar::refresh() { - bool net_stats_visible = gSavedSettings.getBOOL("ShowNetStats"); - + static LLCachedControl show_net_stats(gSavedSettings, "ShowNetStats", false); + bool net_stats_visible = show_net_stats; + if (net_stats_visible) { // Adding Net Stat Meter back in @@ -266,26 +266,30 @@ void LLStatusBar::refresh() mSGBandwidth->setThreshold(2, bwtotal); } - // Get current UTC time, adjusted for the user's clock - // being off. - time_t utc_time; - utc_time = time_corrected(); - - std::string timeStr = getString("time"); - LLSD substitution; - substitution["datetime"] = (S32) utc_time; - LLStringUtil::format (timeStr, substitution); - mTextTime->setText(timeStr); - - // set the tooltip to have the date - std::string dtStr = getString("timeTooltip"); - LLStringUtil::format (dtStr, substitution); - mTextTime->setToolTip (dtStr); + // update clock every 10 seconds + if(mClockUpdateTimer.getElapsedTimeF32() > 10.f) + { + mClockUpdateTimer.reset(); + + // Get current UTC time, adjusted for the user's clock + // being off. + time_t utc_time; + utc_time = time_corrected(); + + std::string timeStr = getString("time"); + LLSD substitution; + substitution["datetime"] = (S32) utc_time; + LLStringUtil::format (timeStr, substitution); + mTextTime->setText(timeStr); + + // set the tooltip to have the date + std::string dtStr = getString("timeTooltip"); + LLStringUtil::format (dtStr, substitution); + mTextTime->setToolTip (dtStr); + } LLRect r; const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge(); - S32 x = MENU_RIGHT + MENU_PARCEL_SPACING; - S32 y = 0; // reshape menu bar to its content's width if (MENU_RIGHT != gMenuBarView->getRect().getWidth()) @@ -293,47 +297,6 @@ void LLStatusBar::refresh() gMenuBarView->reshape(MENU_RIGHT, gMenuBarView->getRect().getHeight()); } - LLViewerRegion *region = gAgent.getRegion(); - LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - - LLRect buttonRect; - - if (LLHUDIcon::iconsNearby()) - { - LLView* script_out = getChildView("scriptout"); - buttonRect = script_out->getRect(); - r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - script_out->setShape(r); - script_out->setVisible( true); - x += buttonRect.getWidth(); - } - else - { - getChildView("scriptout")->setVisible( false); - } - - if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK && - ((region && region->getAllowDamage()) || (parcel && parcel->getAllowDamage()))) - { - // set visibility based on flashing - if( mHealthTimer->hasExpired() ) - { - getChildView("health")->setVisible( true); - } - else - { - BOOL flash = S32(mHealthTimer->getElapsedSeconds() * ICON_FLASH_FREQUENCY) & 1; - getChildView("health")->setVisible( flash); - } - - // Health - LLView* healthp = getChildView("health"); - buttonRect = healthp->getRect(); - r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - healthp->setShape(r); - x += buttonRect.getWidth(); - } - mSGBandwidth->setVisible(net_stats_visible); mSGPacketLoss->setVisible(net_stats_visible); getChildView("stat_btn")->setEnabled(net_stats_visible); -- cgit v1.2.3 From db7fb78b8b915d1ab1ae3af7a9ae4c3c4608525b Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 30 Jul 2010 17:30:53 -0700 Subject: fix for mac build --- indra/newview/llstatusbar.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 213925ecdf..39f0f32205 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -464,16 +464,6 @@ void LLStatusBar::onClickBuyCurrency() LLBuyCurrencyHTML::openCurrencyFloater(); } -static void onClickHealth(void* ) -{ - LLNotificationsUtil::add("NotSafe"); -} - -static void onClickScriptDebug(void*) -{ - LLFloaterScriptDebug::show(LLUUID::null); -} - void LLStatusBar::onMouseEnterVolume() { LLButton* volbtn = getChild( "volume_btn" ); -- cgit v1.2.3 From 3caa8cb79b7014971438c1c6266e2e83bec2e021 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 30 Jul 2010 17:33:41 -0700 Subject: fix for mac --- indra/newview/llstatusbar.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 39f0f32205..a6bb4d4d5f 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -111,8 +111,6 @@ const F32 ICON_TIMER_EXPIRY = 3.f; // How long the balance and health icons sho const F32 ICON_FLASH_FREQUENCY = 2.f; const S32 TEXT_HEIGHT = 18; -static void onClickHealth(void*); -static void onClickScriptDebug(void*); static void onClickVolume(void*); std::vector LLStatusBar::sDays; -- cgit v1.2.3 From 90e3d83a5cb35e98a02a3017dd79ebc272bbfe85 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 21 Sep 2010 13:26:52 -0400 Subject: Fix for build failures - disabling tcmalloc for now --- indra/newview/llstatusbar.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/newview/llstatusbar.cpp (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp old mode 100644 new mode 100755 -- cgit v1.2.3