STORM-524 : pull in viewer-development
commit
a2d7d12246
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
@ -505,6 +509,14 @@ static void onClickVolume(void* data)
|
|||
LLAppViewer::instance()->setMasterSystemAudioMute(!mute_audio);
|
||||
}
|
||||
|
||||
//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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue