diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/lleventapi.h | 13 | ||||
-rw-r--r-- | indra/llcommon/lleventdispatcher.cpp | 14 | ||||
-rw-r--r-- | indra/llcommon/lleventdispatcher.h | 65 | ||||
-rw-r--r-- | indra/media_plugins/quicktime/media_plugin_quicktime.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 11 | ||||
-rw-r--r-- | indra/newview/lllogininstance.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llstatusbar.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llstatusbar.h | 6 | ||||
-rw-r--r-- | indra/newview/llvoicechannel.cpp | 65 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_incoming_call.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_outgoing_call.xml | 14 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/main_view.xml | 14 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 10 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_status_bar.xml | 18 |
14 files changed, 219 insertions, 62 deletions
diff --git a/indra/llcommon/lleventapi.h b/indra/llcommon/lleventapi.h index 2cd3b5bf89..96d1b03be8 100644 --- a/indra/llcommon/lleventapi.h +++ b/indra/llcommon/lleventapi.h @@ -46,6 +46,19 @@ public: /// Get the documentation string std::string getDesc() const { return mDesc; } + /** + * Publish only selected add() methods from LLEventDispatcher. + * Every LLEventAPI add() @em must have a description string. + */ + template <typename CALLABLE> + void add(const std::string& name, + const std::string& desc, + CALLABLE callable, + const LLSD& required=LLSD()) + { + LLEventDispatcher::add(name, desc, callable, required); + } + private: std::string mDesc; }; diff --git a/indra/llcommon/lleventdispatcher.cpp b/indra/llcommon/lleventdispatcher.cpp index 017bf3a521..5fa6059718 100644 --- a/indra/llcommon/lleventdispatcher.cpp +++ b/indra/llcommon/lleventdispatcher.cpp @@ -121,6 +121,20 @@ LLEventDispatcher::Callable LLEventDispatcher::get(const std::string& name) cons return found->second.mFunc; } +LLSD LLEventDispatcher::getMetadata(const std::string& name) const +{ + DispatchMap::const_iterator found = mDispatch.find(name); + if (found == mDispatch.end()) + { + return LLSD(); + } + LLSD meta; + meta["name"] = name; + meta["desc"] = found->second.mDesc; + meta["required"] = found->second.mRequired; + return meta; +} + LLDispatchListener::LLDispatchListener(const std::string& pumpname, const std::string& key): LLEventDispatcher(pumpname, key), mPump(pumpname, true), // allow tweaking for uniqueness diff --git a/indra/llcommon/lleventdispatcher.h b/indra/llcommon/lleventdispatcher.h index eba7b607f1..c8c4fe0c3c 100644 --- a/indra/llcommon/lleventdispatcher.h +++ b/indra/llcommon/lleventdispatcher.h @@ -19,6 +19,7 @@ #include <map> #include <boost/function.hpp> #include <boost/bind.hpp> +#include <boost/iterator/transform_iterator.hpp> #include <typeinfo> #include "llevents.h" @@ -73,6 +74,16 @@ public: addMethod<CLASS>(name, desc, method, required); } + /// Convenience: for LLEventDispatcher, not every callable needs a + /// documentation string. + template <typename CALLABLE> + void add(const std::string& name, + CALLABLE callable, + const LLSD& required=LLSD()) + { + add(name, "", callable, required); + } + /// Unregister a callable bool remove(const std::string& name); @@ -87,10 +98,47 @@ public: /// @a required prototype specified at add() time, die with LL_ERRS. void operator()(const LLSD& event) const; + /// @name Iterate over defined names + //@{ + typedef std::pair<std::string, std::string> NameDesc; + +private: + struct DispatchEntry + { + DispatchEntry(const Callable& func, const std::string& desc, const LLSD& required): + mFunc(func), + mDesc(desc), + mRequired(required) + {} + Callable mFunc; + std::string mDesc; + LLSD mRequired; + }; + typedef std::map<std::string, DispatchEntry> DispatchMap; + +public: + /// We want the flexibility to redefine what data we store per name, + /// therefore our public interface doesn't expose DispatchMap iterators, + /// or DispatchMap itself, or DispatchEntry. Instead we explicitly + /// transform each DispatchMap item to NameDesc on dereferencing. + typedef boost::transform_iterator<NameDesc(*)(const DispatchMap::value_type&), DispatchMap::const_iterator> const_iterator; + const_iterator begin() const + { + return boost::make_transform_iterator(mDispatch.begin(), makeNameDesc); + } + const_iterator end() const + { + return boost::make_transform_iterator(mDispatch.end(), makeNameDesc); + } + //@} + /// Fetch the Callable for the specified name. If no such name was /// registered, return an empty() Callable. Callable get(const std::string& name) const; + /// Get information about a specific Callable + LLSD getMetadata(const std::string& name) const; + private: template <class CLASS, typename METHOD> void addMethod(const std::string& name, const std::string& desc, @@ -111,19 +159,12 @@ private: bool attemptCall(const std::string& name, const LLSD& event) const; std::string mDesc, mKey; - struct DispatchEntry - { - DispatchEntry(const Callable& func, const std::string& desc, const LLSD& required): - mFunc(func), - mDesc(desc), - mRequired(required) - {} - Callable mFunc; - std::string mDesc; - LLSD mRequired; - }; - typedef std::map<std::string, DispatchEntry> DispatchMap; DispatchMap mDispatch; + + static NameDesc makeNameDesc(const DispatchMap::value_type& item) + { + return NameDesc(item.first, item.second.mDesc); + } }; /** diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index de927de1cd..dac0509531 100644 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp @@ -528,11 +528,17 @@ private: if ( ! mMovieController ) return; - // service QuickTime - // Calling it this way doesn't have good behavior on Windows... -// MoviesTask( mMovieHandle, milliseconds ); - // This was the original, but I think using both MoviesTask and MCIdle is redundant. Trying with only MCIdle. -// MoviesTask( mMovieHandle, 0 ); + // this wasn't required in 1.xx viewer but we have to manually + // work the Windows message pump now + #if defined( LL_WINDOWS ) + MSG msg;
+ while ( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
+ {
+ GetMessage( &msg, NULL, 0, 0 );
+ TranslateMessage( &msg );
+ DispatchMessage( &msg );
+ };
+ #endif MCIdle( mMovieController ); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ee785e7ecb..dc32291714 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1124,13 +1124,9 @@ void LLOutgoingCallDialog::onOpen(const LLSD& key) LLSD callee_id = mPayload["other_user_id"]; childSetTextArg("calling", "[CALLEE_NAME]", callee_name); + childSetTextArg("connecting", "[CALLEE_NAME]", callee_name); LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); icon->setValue(callee_id); - - // dock the dialog to the sys well, where other sys messages appear - setDockControl(new LLDockControl(LLBottomTray::getInstance()->getSysWell(), - this, getDockTongue(), LLDockControl::TOP, - boost::bind(&LLOutgoingCallDialog::getAllowedRect, this, _1))); } @@ -1155,6 +1151,11 @@ BOOL LLOutgoingCallDialog::postBuild() childSetAction("Cancel", onCancel, this); + // dock the dialog to the sys well, where other sys messages appear + setDockControl(new LLDockControl(LLBottomTray::getInstance()->getSysWell(), + this, getDockTongue(), LLDockControl::TOP, + boost::bind(&LLOutgoingCallDialog::getAllowedRect, this, _1))); + return success; } diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index a01426ea87..955347bce2 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() 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<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 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/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index d93913b944..ae32ec7d11 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -870,29 +870,60 @@ void LLVoiceChannelP2P::setSessionHandle(const std::string& handle, const std::s void LLVoiceChannelP2P::setState(EState state) { - // HACK: Open/close the call window if needed. + // *HACK: Open/close the call window if needed. toggleCallWindowIfNeeded(state); - // *HACK: open outgoing call floater if needed, might be better done elsewhere. - mCallDialogPayload["session_id"] = mSessionID; - mCallDialogPayload["session_name"] = mSessionName; - mCallDialogPayload["other_user_id"] = mOtherUserID; - if (!mReceivedCall && state == STATE_RINGING) - { - llinfos << "RINGINGGGGGGGG " << mSessionName << llendl; - if (!mSessionName.empty()) + if (mReceivedCall) // incoming call + { + // you only "answer" voice invites in p2p mode + // so provide a special purpose message here + if (mReceivedCall && state == STATE_RINGING) { - LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE); + gIMMgr->addSystemMessage(mSessionID, "answering", mNotifyArgs); + doSetState(state); + return; } } - - // you only "answer" voice invites in p2p mode - // so provide a special purpose message here - if (mReceivedCall && state == STATE_RINGING) + else // outgoing call { - gIMMgr->addSystemMessage(mSessionID, "answering", mNotifyArgs); - doSetState(state); - return; + mCallDialogPayload["session_id"] = mSessionID; + mCallDialogPayload["session_name"] = mSessionName; + mCallDialogPayload["other_user_id"] = mOtherUserID; + if (state == STATE_RINGING) + { + // *HACK: open outgoing call floater if needed, might be better done elsewhere. + // *TODO: should move this squirrelly ui-fudging crap into LLOutgoingCallDialog itself + if (!mSessionName.empty()) + { + LLOutgoingCallDialog *ocd = dynamic_cast<LLOutgoingCallDialog*>(LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE)); + if (ocd) + { + ocd->getChild<LLTextBox>("calling")->setVisible(true); + ocd->getChild<LLTextBox>("leaving")->setVisible(true); + ocd->getChild<LLTextBox>("connecting")->setVisible(false); + } + } + } + /*else if (state == STATE_CONNECTED) + { + LLOutgoingCallDialog *ocd = dynamic_cast<LLOutgoingCallDialog*>(LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE)); + if (ocd) + { + ocd->getChild<LLTextBox>("calling")->setVisible(false); + ocd->getChild<LLTextBox>("leaving")->setVisible(false); + ocd->getChild<LLTextBox>("connecting")->setVisible(true); + } + }*/ + else if (state == STATE_HUNG_UP || + state == STATE_CONNECTED) + { + LLOutgoingCallDialog *ocd = dynamic_cast<LLOutgoingCallDialog*>(LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE)); + if (ocd) + { + ocd->closeFloater(); + } + } } + LLVoiceChannel::setState(state); } diff --git a/indra/newview/skins/default/xui/en/floater_incoming_call.xml b/indra/newview/skins/default/xui/en/floater_incoming_call.xml index 9c2898945b..526fda90d1 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -12,7 +12,7 @@ width="410"> <floater.string name="localchat"> - Local Voice Chat + Nearby Voice Chat </floater.string> <floater.string name="anonymous"> diff --git a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml index 44956f7e52..82417de8a7 100644 --- a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml +++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml @@ -12,7 +12,7 @@ width="410"> <floater.string name="localchat"> - Local Voice Chat + Nearby Voice Chat </floater.string> <floater.string name="anonymous"> @@ -40,6 +40,18 @@ height="20" layout="topleft" left="77" + name="connecting" + top="27" + visible="false" + width="315" + word_wrap="true"> +Connecting to [CALLEE_NAME] + </text> + <text + font="SansSerifLarge" + height="20" + layout="topleft" + left="77" name="calling" top="27" width="315" diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index 9e35c95d45..08f7ee456e 100644 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -51,13 +51,6 @@ name="main_view" user_resize="true" width="500"> - <view bottom="500" - follows="all" - height="500" - left="0" - mouse_opaque="false" - name="world_view_rect" - width="500"/> <layout_stack border_size="0" bottom="500" follows="all" @@ -73,6 +66,13 @@ mouse_opaque="false" name="hud container" width="500"> + <view bottom="500" + follows="all" + height="500" + left="0" + mouse_opaque="false" + name="world_view_rect" + width="500"/> <panel follows="right|top|bottom" height="500" mouse_opaque="false" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 70b21d14be..9fe03859bb 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5587,7 +5587,7 @@ We're sorry. This area has reached maximum capacity for voice conversation icon="notifytip.tga" name="VoiceChannelDisconnected" type="notifytip"> -You have been disconnected from [VOICE_CHANNEL_NAME]. You will now be reconnected to spatial voice chat. +You have been disconnected from [VOICE_CHANNEL_NAME]. You will now be reconnected to Nearby Voice Chat. <unique> <context key="VOICE_CHANNEL_NAME"/> </unique> @@ -5597,7 +5597,7 @@ You have been disconnected from [VOICE_CHANNEL_NAME]. You will now be reconnect icon="notifytip.tga" name="VoiceChannelDisconnectedP2P" type="notifytip"> -[VOICE_CHANNEL_NAME] has ended the call. You will now be reconnected to spatial voice chat. +[VOICE_CHANNEL_NAME] has ended the call. You will now be reconnected to Nearby Voice Chat. <unique> <context key="VOICE_CHANNEL_NAME"/> </unique> @@ -5607,7 +5607,7 @@ You have been disconnected from [VOICE_CHANNEL_NAME]. You will now be reconnect icon="notifytip.tga" name="P2PCallDeclined" type="notifytip"> -[VOICE_CHANNEL_NAME] has declined your call. You will now be reconnected to spatial voice chat. +[VOICE_CHANNEL_NAME] has declined your call. You will now be reconnected to Nearby Voice Chat. <unique> <context key="VOICE_CHANNEL_NAME"/> </unique> @@ -5617,7 +5617,7 @@ You have been disconnected from [VOICE_CHANNEL_NAME]. You will now be reconnect icon="notifytip.tga" name="P2PCallNoAnswer" type="notifytip"> -[VOICE_CHANNEL_NAME] is not available to take your call. You will now be reconnected to spatial voice chat. +[VOICE_CHANNEL_NAME] is not available to take your call. You will now be reconnected to Nearby Voice Chat. <unique> <context key="VOICE_CHANNEL_NAME"/> </unique> @@ -5627,7 +5627,7 @@ You have been disconnected from [VOICE_CHANNEL_NAME]. You will now be reconnect icon="notifytip.tga" name="VoiceChannelJoinFailed" type="notifytip"> -Failed to connect to [VOICE_CHANNEL_NAME], please try again later. You will now be reconnected to spatial voice chat. +Failed to connect to [VOICE_CHANNEL_NAME], please try again later. You will now be reconnected to Nearby Voice Chat. <unique> <context key="VOICE_CHANNEL_NAME"/> </unique> 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" /> + <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)" |