From 2f97829aab549a4d65daead298361a0c25399be2 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 12 Nov 2009 20:11:53 -0500 Subject: Introduce LLEventDispatcher::begin()/end() to iterate over (name, desc) pairs for all registered operations. (untested) Introduce LLEventDispatcher::getMetadata(name) query so you can discover, for a given named operation, its query string and required parameters. (untested) Introduce LLEventDispatcher::add() convenience methods allowing you to omit description strings. Fix LLLoginInstance (which uses a non-LLEventAPI LLEventDispatcher) back to description-less add() calls. However, filter LLEventDispatcher::add() methods inherited by LLEventAPI so that an LLEventAPI subclass *must* provide a description string. --- indra/newview/lllogininstance.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 945294f3f2..e5f347ddc4 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -73,9 +73,9 @@ LLLoginInstance::LLLoginInstance() : { mLoginModule->getEventPump().listen("lllogininstance", boost::bind(&LLLoginInstance::handleLoginEvent, this, _1)); - mDispatcher.add("fail.login", "", boost::bind(&LLLoginInstance::handleLoginFailure, this, _1)); - mDispatcher.add("connect", "", boost::bind(&LLLoginInstance::handleLoginSuccess, this, _1)); - mDispatcher.add("disconnect", "", boost::bind(&LLLoginInstance::handleDisconnect, this, _1)); + mDispatcher.add("fail.login", boost::bind(&LLLoginInstance::handleLoginFailure, this, _1)); + mDispatcher.add("connect", boost::bind(&LLLoginInstance::handleLoginSuccess, this, _1)); + mDispatcher.add("disconnect", boost::bind(&LLLoginInstance::handleDisconnect, this, _1)); } LLLoginInstance::~LLLoginInstance() -- cgit v1.2.3 From a69bce6928f84d53edc776b19018c7726002be74 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Fri, 13 Nov 2009 12:55:34 +0000 Subject: EXT-2458: Added global mute/unmute button to the status bar. --- indra/newview/llstatusbar.cpp | 27 ++++++++++++++++++++++ indra/newview/llstatusbar.h | 6 +++-- .../skins/default/xui/en/panel_status_bar.xml | 18 +++++++++++---- 3 files changed, 45 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 4dccdfd7e6..b649a0c38e 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -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 LLStatusBar::sDays; std::vector 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( "buycurrency" ); mBtnBuyCurrency->setClickedCallback( onClickBuyCurrency, this ); + mBtnVolume = getChild( "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 diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index d5629e6f1e..3ce3549961 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -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; 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 1171a8f0b5..8fc78c6701 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -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" /> +