I'll apologize in advanced for length of this email but I need some extra eyes on the code for this
Diff to show changes being made(also the reason for the length of email): diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -1528,6 +1528,7 @@ // because it resets chatbar's width according to resize logic. void LLBottomTray::initButtonsVisibility() { + setVisibleAndFitWidths(RS_BUTTON_SPEAK, gSavedSettings.getBOOL("EnableVoiceChat")); setVisibleAndFitWidths(RS_BUTTON_GESTURES, gSavedSettings.getBOOL("ShowGestureButton")); setVisibleAndFitWidths(RS_BUTTON_MOVEMENT, gSavedSettings.getBOOL("ShowMoveButton")); setVisibleAndFitWidths(RS_BUTTON_CAMERA, gSavedSettings.getBOOL("ShowCameraButton")); @@ -1540,6 +1541,7 @@ void LLBottomTray::setButtonsControlsAndListeners() { + gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bi nd(&LLBottomTray::toggleShowButton, RS_BUTTON_SPEAK, _2)); gSavedSettings.getControl("ShowGestureButton")->getSignal()->connect(boost:: bind(&LLBottomTray::toggleShowButton, RS_BUTTON_GESTURES, _2)); gSavedSettings.getControl("ShowMoveButton")->getSignal()->connect(boost::bin d(&LLBottomTray::toggleShowButton, RS_BUTTON_MOVEMENT, _2)); gSavedSettings.getControl("ShowCameraButton")->getSignal()->connect(boost::b ind(&LLBottomTray::toggleShowButton, RS_BUTTON_CAMERA, _2)); diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -34,6 +34,7 @@ #include "llcallfloater.h" #include "lloutputmonitorctrl.h" #include "lltransientfloatermgr.h" +#include "llviewercontrol.h" #include "llspeakbutton.h" @@ -55,12 +56,15 @@ void LLSpeakButton::draw() { - // LLVoiceClient::getInstance() is the authoritative global source of info regarding our open-mic state, we merely reflect that state. - bool openmic = LLVoiceClient::getInstance()->getUserPTTState(); - bool voiceenabled = LLVoiceClient::getInstance()->voiceEnabled(); - mSpeakBtn->setToggleState(openmic && voiceenabled); - mOutputMonitor->setIsMuted(!voiceenabled); - LLUICtrl::draw(); + if ( gSavedSettings.getBOOL("EnableVoiceChat") ) + { + // LLVoiceClient::getInstance() is the authoritative global source of info regarding our open-mic state, we merely reflect that state. + bool openmic = LLVoiceClient::getInstance()->getUserPTTState(); + bool voiceenabled = LLVoiceClient::getInstance()->voiceEnabled(); + mSpeakBtn->setToggleState(openmic && voiceenabled); + mOutputMonitor->setIsMuted(!voiceenabled); + LLUICtrl::draw(); + } } void LLSpeakButton::setSpeakBtnEnabled(bool enabled) { diff --git a/indra/newview/skins/default/xui/en/menu_bottomtray.xml b/indra/newview/skins/default/xui/en/menu_bottomtray.xml --- a/indra/newview/skins/default/xui/en/menu_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/menu_bottomtray.xml @@ -9,6 +9,17 @@ visible="false" width="128"> <menu_item_check + label="Speak button" + layout="topleft" + name="EnableVoiceChat"> + <menu_item_check.on_click + function="ToggleControl" + parameter="EnableVoiceChat" /> + <menu_item_check.on_check + function="CheckControl" + parameter="EnableVoiceChat" /> + </menu_item_check> + <menu_item_check label="Gesture button" layout="topleft" name="ShowGestureButton"> with the above code changed the speak button show/hide in accordance to the voice settings like it should. now for the problem: 1 when hiding the speak button(disabling voice) the space it took up is not freed(visible buttons sliding towards the text input field) this is a problem. 2 when showing the speak button(enabling voice) I get the following message in the log file: WARNING: LLToastAlertPanel::LLToastAlertPanel: Alert: Selected button cannot be shown right now. The button will be shown when there is enough space for it. Now somewhere in the related files there is a place that sets the space for the speak button and I feel that if I could locate it and make the needed changes it should solve both problems as I think the second one is tied to the fact that the space is not freed up.
_______________________________________________ Policies and (un)subscribe information available here: http://wiki.secondlife.com/wiki/OpenSource-Dev Please read the policies before posting to keep unmoderated posting privileges