diff options
| -rw-r--r-- | indra/newview/llbuycurrencyhtml.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/llfloaterbuycurrency.cpp | 6 | ||||
| -rw-r--r-- | indra/newview/llfloaterbuycurrencyhtml.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/llstatusbar.cpp | 18 | ||||
| -rw-r--r-- | indra/newview/llstatusbar.h | 2 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_status_bar.xml | 2 | 
6 files changed, 30 insertions, 6 deletions
diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp index d35c9ed853..e5a9be0203 100644 --- a/indra/newview/llbuycurrencyhtml.cpp +++ b/indra/newview/llbuycurrencyhtml.cpp @@ -33,6 +33,7 @@  #include "llfloaterreg.h"  #include "llcommandhandler.h"  #include "llviewercontrol.h" +#include "llstatusbar.h"  // support for secondlife:///app/buycurrencyhtml/{ACTION}/{NEXT_ACTION}/{RETURN_CODE} SLapps  class LLBuyCurrencyHTMLHandler :  @@ -156,4 +157,7 @@ void LLBuyCurrencyHTML::closeDialog()  	{  		buy_currency_floater->closeFloater();  	}; +	 +	// Update L$ balance in the status bar in case L$ were purchased +	LLStatusBar::sendMoneyBalanceRequest();  } diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 58c79fdf15..e21a8594bc 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -267,17 +267,23 @@ void LLFloaterBuyCurrencyUI::onClickBuy()  {  	mManager.buy(getString("buy_currency"));  	updateUI(); +	// Update L$ balance +	LLStatusBar::sendMoneyBalanceRequest();  }  void LLFloaterBuyCurrencyUI::onClickCancel()  {  	closeFloater(); +	// Update L$ balance +	LLStatusBar::sendMoneyBalanceRequest();  }  void LLFloaterBuyCurrencyUI::onClickErrorWeb()  {  	LLWeb::loadURLExternal(mManager.errorURI());  	closeFloater(); +	// Update L$ balance +	LLStatusBar::sendMoneyBalanceRequest();  }  // static diff --git a/indra/newview/llfloaterbuycurrencyhtml.cpp b/indra/newview/llfloaterbuycurrencyhtml.cpp index bde620d965..013cf74c7b 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.cpp +++ b/indra/newview/llfloaterbuycurrencyhtml.cpp @@ -82,7 +82,7 @@ void LLFloaterBuyCurrencyHTML::navigateToFinalURL()  	LLStringUtil::format( buy_currency_url, replace );  	// write final URL to debug console -	llinfos << "Buy currency HTML prased URL is " << buy_currency_url << llendl; +	llinfos << "Buy currency HTML parsed URL is " << buy_currency_url << llendl;  	// kick off the navigation  	mBrowser->navigateTo( buy_currency_url, "text/html" ); @@ -105,7 +105,7 @@ void LLFloaterBuyCurrencyHTML::handleMediaEvent( LLPluginClassMedia* self, EMedi  //  void LLFloaterBuyCurrencyHTML::onClose( bool app_quitting )  { -	// update L$ balanace one more time +	// Update L$ balance one more time  	LLStatusBar::sendMoneyBalanceRequest();  	destroy(); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index e9fc25404a..1b8be7a5b2 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -115,6 +115,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect)  	mSGBandwidth(NULL),  	mSGPacketLoss(NULL),  	mBtnVolume(NULL), +	mBoxBalance(NULL),  	mBalance(0),  	mHealth(100),  	mSquareMetersCredit(0), @@ -168,6 +169,9 @@ BOOL LLStatusBar::postBuild()  	getChild<LLUICtrl>("buyL")->setCommitCallback(  		boost::bind(&LLStatusBar::onClickBuyCurrency, this)); +	mBoxBalance = getChild<LLTextBox>("balance"); +	mBoxBalance->setClickedCallback( &LLStatusBar::onClickBalance, this ); +  	mBtnVolume = getChild<LLButton>( "volume_btn" );  	mBtnVolume->setClickedCallback( onClickVolume, this );  	mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this)); @@ -304,6 +308,7 @@ void LLStatusBar::setVisibleForMouselook(bool visible)  {  	mTextTime->setVisible(visible);  	getChild<LLUICtrl>("balance_bg")->setVisible(visible); +	mBoxBalance->setVisible(visible);  	mBtnVolume->setVisible(visible);  	mMediaToggle->setVisible(visible);  	mSGBandwidth->setVisible(visible); @@ -330,16 +335,15 @@ void LLStatusBar::setBalance(S32 balance)  	std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance ); -	LLTextBox* balance_box = getChild<LLTextBox>("balance");  	LLStringUtil::format_map_t string_args;  	string_args["[AMT]"] = llformat("%s", money_str.c_str());  	std::string label_str = getString("buycurrencylabel", string_args); -	balance_box->setValue(label_str); +	mBoxBalance->setValue(label_str);  	// Resize the L$ balance background to be wide enough for your balance plus the buy button  	{  		const S32 HPAD = 24; -		LLRect balance_rect = balance_box->getTextBoundingRect(); +		LLRect balance_rect = mBoxBalance->getTextBoundingRect();  		LLRect buy_rect = getChildView("buyL")->getRect();  		LLView* balance_bg_view = getChildView("balance_bg");  		LLRect balance_bg_rect = balance_bg_view->getRect(); @@ -506,6 +510,14 @@ static void onClickVolume(void* data)  }  //static  +void LLStatusBar::onClickBalance(void* ) +{ +	// Force a balance request message: +	LLStatusBar::sendMoneyBalanceRequest(); +	// The refresh of the display (call to setBalance()) will be done by process_money_balance_reply() +} + +//static   void LLStatusBar::onClickMediaToggle(void* data)  {  	LLStatusBar *status_bar = (LLStatusBar*)data; diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 2388aeb0c8..4ea3183d18 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -94,6 +94,7 @@ private:  	void onClickScreen(S32 x, S32 y);  	static void onClickMediaToggle(void* data); +	static void onClickBalance(void* data);  private:  	LLTextBox	*mTextTime; @@ -102,6 +103,7 @@ private:  	LLStatGraph *mSGPacketLoss;  	LLButton	*mBtnVolume; +	LLTextBox	*mBoxBalance;  	LLButton	*mMediaToggle;  	LLView*		mScriptOut;  	LLFrameTimer	mClockUpdateTimer; diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 2f52ca660b..d756dfb7de 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -51,7 +51,7 @@       height="18"       left="0"        name="balance" -     tool_tip="My Balance" +     tool_tip="Click to refresh your L$ balance"       v_pad="4"       top="0"       wrap="false"   | 
