Skip to content
Snippets Groups Projects
Commit b52d2a2f authored by Andrew Dyukov's avatar Andrew Dyukov
Browse files

Fixed normal bug EXT-4648 (Right segment of Speak button is disabled if nearby...

Fixed normal bug EXT-4648 (Right segment of Speak button is disabled if nearby voice chat is disabled in estate).

- Added methods for separate enabling of left and right parts of speak button and used them instead of simply enabling/disabling LLSpeakButton in bottomtray.

- Made changes to reset() in LLCallFloater to show "no one near..." instead of "loading" in vcp for nearby chat in regions with disabled voice.

--HG--
branch : product-engine
parent a1c3d608
No related branches found
No related tags found
No related merge requests found
......@@ -280,7 +280,13 @@ void LLBottomTray::onChange(EStatusType status, const std::string &channelURI, b
break;
}
mSpeakBtn->setEnabled(enable);
// We have to enable/disable right and left parts of speak button separately (EXT-4648)
mSpeakBtn->setSpeakBtnEnabled(enable);
// skipped to avoid button blinking
if (status != STATUS_JOINING && status!= STATUS_LEFT_CHANNEL)
{
mSpeakBtn->setFlyoutBtnEnabled(LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking());
}
}
void LLBottomTray::onMouselookModeOut()
......@@ -410,9 +416,10 @@ BOOL LLBottomTray::postBuild()
mSpeakPanel = getChild<LLPanel>("speak_panel");
mSpeakBtn = getChild<LLSpeakButton>("talk");
// Speak button should be initially disabled because
// Both parts of speak button should be initially disabled because
// it takes some time between logging in to world and connecting to voice channel.
mSpeakBtn->setEnabled(FALSE);
mSpeakBtn->setSpeakBtnEnabled(false);
mSpeakBtn->setFlyoutBtnEnabled(false);
// Localization tool doesn't understand custom buttons like <talk_button>
mSpeakBtn->setSpeakToolTip( getString("SpeakBtnToolTip") );
......
......@@ -52,6 +52,7 @@
#include "lltransientfloatermgr.h"
#include "llviewerwindow.h"
#include "llvoicechannel.h"
#include "llviewerparcelmgr.h"
static void get_voice_participants_uuids(std::vector<LLUUID>& speakers_uuids);
void reshape_floater(LLCallFloater* floater, S32 delta_height);
......@@ -731,11 +732,11 @@ void LLCallFloater::updateState(const LLVoiceChannel::EState& new_state)
}
else
{
reset();
reset(new_state);
}
}
void LLCallFloater::reset()
void LLCallFloater::reset(const LLVoiceChannel::EState& new_state)
{
// lets forget states from the previous session
// for timers...
......@@ -748,8 +749,18 @@ void LLCallFloater::reset()
mParticipants = NULL;
mAvatarList->clear();
// update floater to show Loading while waiting for data.
mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
// "loading" is shown in parcel with disabled voice only when state is "ringing"
// to avoid showing it in nearby chat vcp all the time- "no_one_near" is now shown there (EXT-4648)
bool show_loading = LLVoiceChannel::STATE_RINGING == new_state;
if(!show_loading && !LLViewerParcelMgr::getInstance()->allowAgentVoice() && mVoiceType == VC_LOCAL_CHAT)
{
mAvatarList->setNoItemsCommentText(getString("no_one_near"));
}
else
{
// update floater to show Loading while waiting for data.
mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
}
mAvatarList->setVisible(TRUE);
mNonAvatarCaller->setVisible(FALSE);
......
......@@ -220,7 +220,7 @@ private:
*
* Clears all data from the latest voice session.
*/
void reset();
void reset(const LLVoiceChannel::EState& new_state);
private:
speaker_state_map_t mSpeakerStateMap;
......
......@@ -66,6 +66,16 @@ void LLSpeakButton::draw()
mOutputMonitor->setIsMuted(!voiceenabled);
LLUICtrl::draw();
}
void LLSpeakButton::setSpeakBtnEnabled(bool enabled)
{
LLButton* speak_btn = getChild<LLButton>("speak_btn");
speak_btn->setEnabled(enabled);
}
void LLSpeakButton::setFlyoutBtnEnabled(bool enabled)
{
LLButton* show_btn = getChild<LLButton>("speak_flyout_btn");
show_btn->setEnabled(enabled);
}
LLSpeakButton::LLSpeakButton(const Params& p)
: LLUICtrl(p)
......
......@@ -61,6 +61,10 @@ public:
/*virtual*/ ~LLSpeakButton();
/*virtual*/ void draw();
// methods for enabling/disabling right and left parts of speak button separately(EXT-4648)
void setSpeakBtnEnabled(bool enabled);
void setFlyoutBtnEnabled(bool enabled);
// *HACK: Need to put tooltips in a translatable location,
// the panel that contains this button.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment