diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/lltoolbar.cpp | 45 | ||||
-rw-r--r-- | indra/llui/lltoolbar.h | 1 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 3 | ||||
-rw-r--r-- | indra/newview/lltoolbarview.cpp | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_voice_controls.xml | 8 |
5 files changed, 58 insertions, 5 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 629c7d9bc7..c559a2bf1d 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -302,7 +302,50 @@ bool LLToolBar::enableCommand(const LLCommandId& commandId, bool enabled) command_id_map::iterator it = mButtonMap.find(commandId.uuid()); if (it != mButtonMap.end()) { - it->second->setEnabled(enabled); + command_button = it->second; + command_button->setEnabled(enabled); + } + } + + return (command_button != NULL); +} + +bool LLToolBar::stopCommandInProgress(const LLCommandId& commandId) +{ + // + // Note from Leslie: + // + // This implementation was largely put in place to handle EXP-1348 which is related to + // dragging and dropping the "speak" button. The "speak" button can be in one of two + // modes, i.e., either a toggle action or a push-to-talk action. Because of this it + // responds to mouse down and mouse up in different ways, based on which behavior the + // button is currently set to obey. This was the simplest way of getting the button + // to turn off the microphone for both behaviors without risking duplicate state. + // + + LLToolBarButton * command_button = NULL; + + if (commandId != LLCommandId::null) + { + LLCommand* command = LLCommandManager::instance().getCommand(commandId); + llassert(command); + + // If this command has an explicit function for execution stop + if (command->executeStopFunctionName().length() > 0) + { + command_id_map::iterator it = mButtonMap.find(commandId.uuid()); + if (it != mButtonMap.end()) + { + command_button = it->second; + llassert(command_button->mIsRunningSignal); + + // Check to see if it is running + if ((*command_button->mIsRunningSignal)(command_button, command->isRunningParameters())) + { + // Trigger an additional button commit, which calls mouse down, mouse up and commit + command_button->onCommit(); + } + } } } diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 616710ea70..ad42d1fa35 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -185,6 +185,7 @@ public: int removeCommand(const LLCommandId& commandId); // Returns the rank the removed command was at, RANK_NONE if not found bool hasCommand(const LLCommandId& commandId) const; bool enableCommand(const LLCommandId& commandId, bool enabled); + bool stopCommandInProgress(const LLCommandId& commandId); void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 20fa26915b..36a8b41d8b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -89,6 +89,7 @@ #include "llweb.h" #include "llsecondlifeurls.h" #include "llupdaterservice.h" +#include "llcallfloater.h" // Linden library includes #include "llavatarnamecache.h" @@ -112,6 +113,7 @@ #include <boost/foreach.hpp> + #if LL_WINDOWS # include <share.h> // For _SH_DENYWR in initMarkerFile #else @@ -1183,6 +1185,7 @@ bool LLAppViewer::mainLoop() LLVoiceChannel::initClass(); LLVoiceClient::getInstance()->init(gServicePump); + LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::sOnCurrentChannelChanged, _1), true); LLTimer frameTimer,idleTimer; LLTimer debugTime; LLViewerJoystick* joystick(LLViewerJoystick::getInstance()); diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index 21e682f072..c7c8268eb9 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -355,6 +355,12 @@ BOOL LLToolBarView::handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_VIEWER; LLUUID srcID; LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, src, srcID); + + // Second, stop the command if it is in progress and requires stopping! + LLCommandId command_id = LLCommandId(uuid); + gToolBarView->mToolbarLeft->stopCommandInProgress(command_id); + gToolBarView->mToolbarRight->stopCommandInProgress(command_id); + gToolBarView->mToolbarBottom->stopCommandInProgress(command_id); // Second, check if the command is present in one of the 3 toolbars // If it is, store the command, the toolbar and the rank in the toolbar and diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index 1a2b248b16..14a722e3be 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -19,19 +19,19 @@ width="282"> <string name="title_nearby"> - Nearby voice + VOICE SETTINGS </string> <string name="title_group"> - Group call with [GROUP] + GROUP CALL WITH [GROUP] </string> <string name="title_adhoc"> - Conference call + CONFERENCE CALL </string> <string name="title_peer_2_peer"> - Call with [NAME] + CALL WITH [NAME] </string> <string name="no_one_near"> |