From 4813b8b99ff83b3a72f9e7f35d20809b4452ca32 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 15 Jan 2010 10:06:40 -0800 Subject: EXT-4304 Clicking on "Buy L$" in nav bar does nothing Now it buys currency. Also fixes EXT-4176, same issue Reviewed with Richard. --- indra/newview/llstatusbar.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index b3b2b9ee5d..0c9c6eaebe 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -122,7 +122,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mTextTime(NULL), mSGBandwidth(NULL), mSGPacketLoss(NULL), - mBtnBuyCurrency(NULL), mBtnVolume(NULL), mBalance(0), mHealth(100), @@ -153,8 +152,10 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mTextHealth = getChild("HealthText" ); mTextTime = getChild("TimeText" ); - mBtnBuyCurrency = getChild( "buycurrency" ); - mBtnBuyCurrency->setClickedCallback( onClickBuyCurrency, this ); + getChild("buycurrency")->setCommitCallback( + boost::bind(&LLStatusBar::onClickBuyCurrency, this)); + getChild("buyL")->setCommitCallback( + boost::bind(&LLStatusBar::onClickBuyCurrency, this)); mBtnVolume = getChild( "volume_btn" ); mBtnVolume->setClickedCallback( onClickVolume, this ); @@ -362,7 +363,8 @@ void LLStatusBar::refresh() void LLStatusBar::setVisibleForMouselook(bool visible) { mTextTime->setVisible(visible); - mBtnBuyCurrency->setVisible(visible); + getChild("buycurrency")->setVisible(visible); + getChild("buyL")->setVisible(visible); mSGBandwidth->setVisible(visible); mSGPacketLoss->setVisible(visible); setBackgroundVisible(visible); @@ -382,17 +384,18 @@ void LLStatusBar::setBalance(S32 balance) { std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance ); + LLButton* btn_buy_currency = getChild("buycurrency"); LLStringUtil::format_map_t string_args; string_args["[AMT]"] = llformat("%s", money_str.c_str()); std::string labe_str = getString("buycurrencylabel", string_args); - mBtnBuyCurrency->setLabel(labe_str); + btn_buy_currency->setLabel(labe_str); // Resize the balance button so that the label fits it, and the button expands to the left. // *TODO: LLButton should have an option where to expand. { - S32 saved_right = mBtnBuyCurrency->getRect().mRight; - mBtnBuyCurrency->autoResize(); - mBtnBuyCurrency->translate(saved_right - mBtnBuyCurrency->getRect().mRight, 0); + S32 saved_right = btn_buy_currency->getRect().mRight; + btn_buy_currency->autoResize(); + btn_buy_currency->translate(saved_right - btn_buy_currency->getRect().mRight, 0); } if (mBalance && (fabs((F32)(mBalance - balance)) > gSavedSettings.getF32("UISndMoneyChangeThreshold"))) @@ -497,7 +500,7 @@ S32 LLStatusBar::getSquareMetersLeft() const return mSquareMetersCredit - mSquareMetersCommitted; } -static void onClickBuyCurrency(void* data) +void LLStatusBar::onClickBuyCurrency() { LLFloaterBuyCurrency::buyCurrency(); } -- cgit v1.2.3 From 9d7108e8f1f3d27743dc735669ad34318858464b Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 15 Jan 2010 11:23:01 -0800 Subject: Fix linux build - missed unused function declaration --- indra/newview/llstatusbar.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 0c9c6eaebe..24895e7a35 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -107,7 +107,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 onClickBuyCurrency(void*); static void onClickHealth(void*); static void onClickScriptDebug(void*); static void onClickVolume(void*); -- cgit v1.2.3