Automated merge with ssh://hg.lindenlab.com/viewer/viewer-2-0

meow-7.2.2
Lynx Linden 2009-11-13 18:34:12 +00:00
commit 69ca84a6a4
3 changed files with 45 additions and 6 deletions

View File

@ -109,6 +109,7 @@ const S32 TEXT_HEIGHT = 18;
static void onClickBuyCurrency(void*);
static void onClickHealth(void*);
static void onClickScriptDebug(void*);
static void onClickVolume(void*);
std::vector<std::string> LLStatusBar::sDays;
std::vector<std::string> LLStatusBar::sMonths;
@ -116,6 +117,12 @@ const U32 LLStatusBar::MAX_DATE_STRING_LENGTH = 2000;
LLStatusBar::LLStatusBar(const LLRect& rect)
: LLPanel(),
mTextHealth(NULL),
mTextTime(NULL),
mSGBandwidth(NULL),
mSGPacketLoss(NULL),
mBtnBuyCurrency(NULL),
mBtnVolume(NULL),
mBalance(0),
mHealth(100),
mSquareMetersCredit(0),
@ -148,6 +155,11 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
mBtnBuyCurrency = getChild<LLButton>( "buycurrency" );
mBtnBuyCurrency->setClickedCallback( onClickBuyCurrency, this );
mBtnVolume = getChild<LLButton>( "volume_btn" );
mBtnVolume->setClickedCallback( onClickVolume, this );
gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2));
childSetAction("scriptout", onClickScriptDebug, this);
childSetAction("health", onClickHealth, this);
@ -333,6 +345,10 @@ void LLStatusBar::refresh()
mSGBandwidth->setVisible(net_stats_visible);
mSGPacketLoss->setVisible(net_stats_visible);
childSetEnabled("stat_btn", net_stats_visible);
// update the master volume button state
BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio");
mBtnVolume->setToggleState(mute_audio);
}
void LLStatusBar::setVisibleForMouselook(bool visible)
@ -488,6 +504,13 @@ static void onClickScriptDebug(void*)
LLFloaterScriptDebug::show(LLUUID::null);
}
static void onClickVolume(void* data)
{
// toggle the master mute setting
BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio");
gSavedSettings.setBOOL("MuteAudio", !mute_audio);
}
// sets the static variables necessary for the date
void LLStatusBar::setupDate()
{
@ -562,6 +585,10 @@ BOOL can_afford_transaction(S32 cost)
return((cost <= 0)||((gStatusBar) && (gStatusBar->getBalance() >=cost)));
}
void LLStatusBar::onVolumeChanged(const LLSD& newvalue)
{
refresh();
}
// Implements secondlife:///app/balance/request to request a L$ balance
// update via UDP message system. JC

View File

@ -91,9 +91,10 @@ private:
// simple method to setup the part that holds the date
void setupDate();
static void onCommitSearch(LLUICtrl*, void* data);
static void onClickSearch(void* data);
void onVolumeChanged(const LLSD& newvalue);
static void onClickStatGraph(void* data);
private:
LLTextBox *mTextHealth;
@ -103,6 +104,7 @@ private:
LLStatGraph *mSGPacketLoss;
LLButton *mBtnBuyCurrency;
LLButton *mBtnVolume;
S32 mBalance;
S32 mHealth;

View File

@ -46,14 +46,24 @@
font="SansSerifSmall"
image_selected="BuyArrow_Over"
image_unselected="BuyArrow_Off"
image_pressed="BuyArrow_Press"
image_pressed="BuyArrow_Press"
height="16"
left="-220"
left="-245"
name="buycurrency"
pad_right="22px"
tool_tip="My Balance: Click to buy more L$"
top="1"
width="117" />
<button
follows="right|bottom"
height="16"
image_selected="parcel_drk_VoiceNo"
image_unselected="parcel_drk_Voice"
is_toggle="true"
left_pad="15"
top="1"
name="volume_btn"
width="16" />
<text
type="string"
length="1"
@ -61,9 +71,9 @@
follows="right|bottom"
halign="right"
height="16"
top="3"
top="5"
layout="topleft"
left_pad="15"
left_pad="7"
name="TimeText"
text_color="TimeTextColor"
tool_tip="Current time (Pacific)"