Merge branch 'Moap' of git://github.com/Shyotl/SingularityViewer into VoiceUpdate

Conflicts:
	indra/newview/lloverlaybar.cpp - Shyotl did some caching, VoiceUpdate turned LLVoiceClient::voiceEnabled non-static.
	indra/newview/llvoiceclient.cpp - Change actually belongs in llvoicevivox.cpp
This commit is contained in:
Lirusaito
2013-06-26 04:43:46 -04:00
5 changed files with 57 additions and 69 deletions

View File

@@ -263,8 +263,8 @@ void LLLayoutStack::draw()
// only force drawing invisible children if visible amount is non-zero // only force drawing invisible children if visible amount is non-zero
drawChild(panelp, 0, 0, !clip_rect.isEmpty()); drawChild(panelp, 0, 0, !clip_rect.isEmpty());
//if (sDebugRects) if (sDebugRects)
/*{ {
LLUI::pushMatrix(); LLUI::pushMatrix();
{ {
// drawing solids requires texturing be disabled // drawing solids requires texturing be disabled
@@ -280,11 +280,11 @@ void LLLayoutStack::draw()
} }
} }
LLUI::popMatrix(); LLUI::popMatrix();
}*/ }
} }
} }
//if (sDebugRects) if (sDebugRects)
/*{ {
drawDebugRect(); drawDebugRect();
// Check for bogus rectangle // Check for bogus rectangle
@@ -292,7 +292,7 @@ void LLLayoutStack::draw()
{ {
llwarns << "Bogus rectangle for " << getName() << " with " << getRect() << llendl; llwarns << "Bogus rectangle for " << getName() << " with " << getRect() << llendl;
} }
}*/ }
} }
void LLLayoutStack::removeChild(LLView* view) void LLLayoutStack::removeChild(LLView* view)

View File

@@ -509,7 +509,7 @@ void LLChatBar::sendChat( EChatType type )
// static // static
void LLChatBar::startChat(const char* line) void LLChatBar::startChat(const char* line)
{ {
gChatBar->setVisible(TRUE); gChatBar->getParent()->setVisible(TRUE);
gChatBar->setKeyboardFocus(TRUE); gChatBar->setKeyboardFocus(TRUE);
gSavedSettings.setBOOL("ChatVisible", TRUE); gSavedSettings.setBOOL("ChatVisible", TRUE);
@@ -540,7 +540,7 @@ void LLChatBar::stopChat()
gAgent.stopTyping(); gAgent.stopTyping();
// hide chat bar so it doesn't grab focus back // hide chat bar so it doesn't grab focus back
gChatBar->setVisible(FALSE); gChatBar->getParent()->setVisible(FALSE);
gSavedSettings.setBOOL("ChatVisible", FALSE); gSavedSettings.setBOOL("ChatVisible", FALSE);
} }

View File

@@ -87,11 +87,6 @@
LLOverlayBar *gOverlayBar = NULL; LLOverlayBar *gOverlayBar = NULL;
extern S32 MENU_BAR_HEIGHT;
extern ImportTracker gImportTracker;
BOOL LLOverlayBar::sChatVisible;
// //
// Functions // Functions
// //
@@ -153,33 +148,30 @@ LLOverlayBar::LLOverlayBar()
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml", &factory_map); LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml", &factory_map);
} }
bool LLOverlayBar::updateAdvSettingsPopup() bool LLOverlayBar::updateAdvSettingsPopup(const LLSD &data)
{ {
bool wfl_adv_settings_popup = gSavedSettings.getBOOL("wlfAdvSettingsPopup"); bool wfl_adv_settings_popup = data.asBoolean();
wlfPanel_AdvSettings::updateClass(); wlfPanel_AdvSettings::updateClass();
if(LLLayoutStack* layout_stack = findChild<LLLayoutStack>("overlay_layout_panel")) LLLayoutPanel* layout_panel = dynamic_cast<LLLayoutPanel*>((LLPanel*)mAdvSettingsContainer);
if(layout_panel)
{ {
LLLayoutPanel* layout_panel = layout_stack->findChild<LLLayoutPanel>("AdvSettings_container"); ((LLLayoutStack*)layout_panel->getParent())->collapsePanel(layout_panel,!wfl_adv_settings_popup);
if(layout_panel) if(wfl_adv_settings_popup)
{ layout_panel->setTargetDim(layout_panel->getChild<LLView>("Adv_Settings")->getBoundingRect().getWidth());
layout_stack->collapsePanel(layout_panel,!wfl_adv_settings_popup);
if(wfl_adv_settings_popup)
layout_panel->setTargetDim(layout_panel->getChild<LLView>("Adv_Settings")->getBoundingRect().getWidth());
}
} }
return true; return true;
} }
bool updateChatVisible(const LLSD &data) bool LLOverlayBar::updateChatVisible(const LLSD &data)
{ {
LLOverlayBar::sChatVisible = data.asBoolean(); mChatBar->getParent()->setVisible(data.asBoolean());
return true; return true;
} }
bool updateAORemote(const LLSD &data) bool LLOverlayBar::updateAORemoteVisible(const LLSD &data)
{ {
gOverlayBar->childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote")); mAORemoteContainer->setVisible(data.asBoolean());
return true; return true;
} }
@@ -189,6 +181,7 @@ bool updateNearbyMediaFloater(const LLSD &data)
return true; return true;
} }
BOOL LLOverlayBar::postBuild() BOOL LLOverlayBar::postBuild()
{ {
childSetAction("New IM",onClickIMReceived,this); childSetAction("New IM",onClickIMReceived,this);
@@ -197,12 +190,13 @@ BOOL LLOverlayBar::postBuild()
childSetAction("Stand Up",onClickStandUp,this); childSetAction("Stand Up",onClickStandUp,this);
childSetAction("Cancel TP",onClickCancelTP,this); childSetAction("Cancel TP",onClickCancelTP,this);
childSetAction("Flycam",onClickFlycam,this); childSetAction("Flycam",onClickFlycam,this);
childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible"));
mCancelBtn = getChild<LLButton>("Cancel TP"); mCancelBtn = getChild<LLButton>("Cancel TP");
setFocusRoot(TRUE); setFocusRoot(TRUE);
mBuilt = true; mBuilt = true;
mUnreadCountStringPlural = getString("unread_count_string_plural");
mChatbarAndButtons.connect(this,"chatbar_and_buttons"); mChatbarAndButtons.connect(this,"chatbar_and_buttons");
mNewIM.connect(this,"New IM"); mNewIM.connect(this,"New IM");
mNotBusy.connect(this,"Set Not Busy"); mNotBusy.connect(this,"Set Not Busy");
@@ -211,21 +205,27 @@ BOOL LLOverlayBar::postBuild()
mFlyCam.connect(this,"Flycam"); mFlyCam.connect(this,"Flycam");
mChatBar.connect(this,"chat_bar"); mChatBar.connect(this,"chat_bar");
mVoiceRemoteContainer.connect(this,"voice_remote_container"); mVoiceRemoteContainer.connect(this,"voice_remote_container");
mStateManagementContainer.connect(this,"state_management_buttons_container");
mAORemoteContainer.connect(this,"ao_remote_container");
mAdvSettingsContainer.connect(this,"AdvSettings_container");
mMediaRemoteContainer.connect(this,"media_remote_container");
updateAdvSettingsPopup(gSavedSettings.getBOOL("wlfAdvSettingsPopup"));
updateChatVisible(gSavedSettings.getBOOL("ChatVisible"));
updateAORemoteVisible(gSavedSettings.getBOOL("EnableAORemote"));
mOriginalIMLabel = mNewIM->getLabelSelected(); mOriginalIMLabel = mNewIM->getLabelSelected();
layoutButtons(); layoutButtons();
sChatVisible = gSavedSettings.getBOOL("ChatVisible"); gSavedSettings.getControl("wlfAdvSettingsPopup")->getSignal()->connect(boost::bind(&LLOverlayBar::updateAdvSettingsPopup,this,_2));
gSavedSettings.getControl("ChatVisible")->getSignal()->connect(boost::bind(&LLOverlayBar::updateChatVisible,this,_2));
gSavedSettings.getControl("wlfAdvSettingsPopup")->getSignal()->connect(boost::bind(&LLOverlayBar::updateAdvSettingsPopup,this)); gSavedSettings.getControl("EnableAORemote")->getSignal()->connect(boost::bind(&LLOverlayBar::updateAORemoteVisible,this,_2));
gSavedSettings.getControl("ChatVisible")->getSignal()->connect(boost::bind(&updateChatVisible,_2));
gSavedSettings.getControl("EnableAORemote")->getSignal()->connect(boost::bind(&updateAORemote,_2));
gSavedSettings.getControl("ShowNearbyMediaFloater")->getSignal()->connect(boost::bind(&updateNearbyMediaFloater,_2)); gSavedSettings.getControl("ShowNearbyMediaFloater")->getSignal()->connect(boost::bind(&updateNearbyMediaFloater,_2));
childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote")); mAORemoteContainer->setVisible(gSavedSettings.getBOOL("EnableAORemote"));
updateAdvSettingsPopup();
return TRUE; return TRUE;
} }
@@ -254,12 +254,10 @@ void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent)
void LLOverlayBar::layoutButtons() void LLOverlayBar::layoutButtons()
{ {
LLView* state_buttons_panel = getChildView("state_management_buttons_container"); if (mStateManagementContainer->getVisible())
if (state_buttons_panel->getVisible())
{ {
U32 button_count = 0; U32 button_count = 0;
const child_list_t& view_list = *(state_buttons_panel->getChildList()); const child_list_t& view_list = *(mStateManagementContainer->getChildList());
BOOST_FOREACH(LLView* viewp, view_list) BOOST_FOREACH(LLView* viewp, view_list)
{ {
if(!viewp->getEnabled()) if(!viewp->getEnabled())
@@ -267,7 +265,7 @@ void LLOverlayBar::layoutButtons()
++button_count; ++button_count;
} }
const S32 MAX_BAR_WIDTH = 600; const S32 MAX_BAR_WIDTH = 600;
S32 bar_width = llclamp(state_buttons_panel->getRect().getWidth(), 0, MAX_BAR_WIDTH); S32 bar_width = llclamp(mStateManagementContainer->getRect().getWidth(), 0, MAX_BAR_WIDTH);
// calculate button widths // calculate button widths
const S32 MAX_BUTTON_WIDTH = 150; const S32 MAX_BUTTON_WIDTH = 150;
@@ -318,7 +316,7 @@ void LLOverlayBar::refresh()
if (unread_count > 1) if (unread_count > 1)
{ {
std::stringstream ss; std::stringstream ss;
ss << unread_count << " " << getString("unread_count_string_plural"); ss << unread_count << " " << mUnreadCountStringPlural;
button->setLabel(ss.str()); button->setLabel(ss.str());
} }
else else
@@ -349,31 +347,17 @@ void LLOverlayBar::refresh()
if(last_mouselook != in_mouselook) if(last_mouselook != in_mouselook)
{ {
last_mouselook = in_mouselook; last_mouselook = in_mouselook;
if (in_mouselook)
{ static const LLCachedControl<bool> enable_ao_remote("EnableAORemote", true);
childSetVisible("media_remote_container", FALSE); mMediaRemoteContainer->setVisible(!in_mouselook);
childSetVisible("voice_remote_container", FALSE); mVoiceRemoteContainer->setVisible(!in_mouselook && LLVoiceClient::getInstance()->voiceEnabled());
childSetVisible("AdvSettings_container", FALSE); mAdvSettingsContainer->setVisible(!in_mouselook);
childSetVisible("ao_remote_container", FALSE); mAORemoteContainer->setVisible(!in_mouselook && enable_ao_remote);
childSetVisible("state_management_buttons_container", FALSE); mStateManagementContainer->setVisible(!in_mouselook);
}
else
{
// update "remotes"
childSetVisible("media_remote_container", TRUE);
childSetVisible("voice_remote_container", LLVoiceClient::getInstance()->voiceEnabled());
childSetVisible("AdvSettings_container", TRUE);
childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote"));
childSetVisible("state_management_buttons_container", TRUE);
}
} }
if(!in_mouselook) if(!in_mouselook)
mVoiceRemoteContainer->setVisible(LLVoiceClient::getInstance()->voiceEnabled()); mVoiceRemoteContainer->setVisible(LLVoiceClient::getInstance()->voiceEnabled());
// always let user toggle into and out of chatbar
static const LLCachedControl<bool> chat_visible("ChatVisible",true);
mChatBar->setVisible(chat_visible);
if (buttons_changed) if (buttons_changed)
{ {
layoutButtons(); layoutButtons();

View File

@@ -98,7 +98,6 @@ public:
void setCancelTPButtonVisible(BOOL b, const std::string& label); void setCancelTPButtonVisible(BOOL b, const std::string& label);
static BOOL sChatVisible;
protected: protected:
static void* createMediaRemote(void* userdata); static void* createMediaRemote(void* userdata);
static void* createVoiceRemote(void* userdata); static void* createVoiceRemote(void* userdata);
@@ -118,6 +117,7 @@ protected:
enum { STOPPED=0, PLAYING=1, PAUSED=2 }; enum { STOPPED=0, PLAYING=1, PAUSED=2 };
S32 mMusicState; S32 mMusicState;
std::string mOriginalIMLabel; std::string mOriginalIMLabel;
std::string mUnreadCountStringPlural;
CachedUICtrl<LLView> mChatbarAndButtons; CachedUICtrl<LLView> mChatbarAndButtons;
CachedUICtrl<LLButton> mNewIM; CachedUICtrl<LLButton> mNewIM;
@@ -127,12 +127,14 @@ protected:
CachedUICtrl<LLButton> mFlyCam; CachedUICtrl<LLButton> mFlyCam;
CachedUICtrl<LLChatBar> mChatBar; CachedUICtrl<LLChatBar> mChatBar;
CachedUICtrl<LLPanel> mVoiceRemoteContainer; CachedUICtrl<LLPanel> mVoiceRemoteContainer;
CachedUICtrl<LLPanel> mStateManagementContainer;
CachedUICtrl<LLPanel> mAORemoteContainer;
CachedUICtrl<LLPanel> mAdvSettingsContainer;
CachedUICtrl<LLPanel> mMediaRemoteContainer;
private: private:
bool updateChatVisible(const LLSD &data);
bool updateAORemoteVisible(const LLSD &data);
bool updateAdvSettingsPopup(); bool updateAdvSettingsPopup(const LLSD &data);
//static void updateChatVisible(const LLSD &data);
}; };
extern LLOverlayBar* gOverlayBar; extern LLOverlayBar* gOverlayBar;

View File

@@ -5320,7 +5320,9 @@ void LLVivoxVoiceClient::setVoiceEnabled(bool enabled)
bool LLVivoxVoiceClient::voiceEnabled() bool LLVivoxVoiceClient::voiceEnabled()
{ {
return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice"); static const LLCachedControl<bool> enable_voice_chat("EnableVoiceChat",true);
static const LLCachedControl<bool> cmdline_disable_voice("CmdLineDisableVoice",false);
return enable_voice_chat && !cmdline_disable_voice;
} }
void LLVivoxVoiceClient::setLipSyncEnabled(BOOL enabled) void LLVivoxVoiceClient::setLipSyncEnabled(BOOL enabled)