Merge remote-tracking branch 'shyotl/master'

This commit is contained in:
Latif Khalifa
2013-06-28 05:48:46 +02:00
9 changed files with 124 additions and 51 deletions

View File

@@ -43,6 +43,8 @@ static LLRegisterWidget<LLUICtrl> r("ui_ctrl");
LLUICtrl::LLUICtrl() :
mViewModel(LLViewModelPtr(new LLViewModel)),
mMakeVisibleControlVariable(NULL),
mMakeInvisibleControlVariable(NULL),
mCommitSignal(NULL),
mValidateSignal(NULL),
mMouseEnterSignal(NULL),
@@ -144,6 +146,56 @@ LLViewModel* LLUICtrl::getViewModel() const
{
return mViewModel;
}
void LLUICtrl::setMakeVisibleControlVariable(LLControlVariable* control)
{
if (mMakeVisibleControlVariable)
{
mMakeVisibleControlConnection.disconnect(); // disconnect current signal
mMakeVisibleControlVariable = NULL;
}
if (control)
{
mMakeVisibleControlVariable = control;
mMakeVisibleControlConnection = mMakeVisibleControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getHandle(), std::string("visible")));
setVisible(mMakeVisibleControlVariable->getValue().asBoolean());
}
}
void LLUICtrl::setMakeInvisibleControlVariable(LLControlVariable* control)
{
if (mMakeInvisibleControlVariable)
{
mMakeInvisibleControlConnection.disconnect(); // disconnect current signal
mMakeInvisibleControlVariable = NULL;
}
if (control)
{
mMakeInvisibleControlVariable = control;
mMakeInvisibleControlConnection = mMakeInvisibleControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getHandle(), std::string("invisible")));
setVisible(!(mMakeInvisibleControlVariable->getValue().asBoolean()));
}
}
// static
bool LLUICtrl::controlListener(const LLSD& newvalue, LLHandle<LLUICtrl> handle, std::string type)
{
LLUICtrl* ctrl = handle.get();
if (ctrl)
{
if (type == "visible")
{
ctrl->setVisible(newvalue.asBoolean());
return true;
}
else if (type == "invisible")
{
ctrl->setVisible(!newvalue.asBoolean());
return true;
}
}
return false;
}
// virtual
BOOL LLUICtrl::setTextArg( const std::string& key, const LLStringExplicit& text )
{
@@ -532,6 +584,19 @@ void LLUICtrl::initFromXML(LLXMLNodePtr node, LLView* parent)
}
}
LLView::initFromXML(node, parent);
if(node->getAttributeString("visibility_control",attrib_str) || node->getAttributeString("visiblity_control",attrib_str))
{
LLControlVariable* control = findControl(attrib_str);
if (control)
setMakeVisibleControlVariable(control);
}
if(node->getAttributeString("invisibility_control",attrib_str) || node->getAttributeString("invisiblity_control",attrib_str))
{
LLControlVariable* control = findControl(attrib_str);
if (control)
setMakeInvisibleControlVariable(control);
}
}
LLXMLNodePtr LLUICtrl::getXML(bool save_children) const

View File

@@ -80,6 +80,8 @@ public:
virtual class LLCtrlSelectionInterface* getSelectionInterface();
virtual class LLCtrlListInterface* getListInterface();
virtual class LLCtrlScrollInterface* getScrollInterface();
void setMakeVisibleControlVariable(LLControlVariable* control);
void setMakeInvisibleControlVariable(LLControlVariable* control);
virtual void setTentative(BOOL b);
virtual BOOL getTentative() const;
@@ -116,6 +118,7 @@ public:
BOOL focusLastItem(BOOL prefer_text_fields = FALSE);
// Non Virtuals
LLHandle<LLUICtrl> getHandle() const { return getDerivedHandle<LLUICtrl>(); }
BOOL getIsChrome() const;
void setTabStop( BOOL b );
@@ -151,9 +154,11 @@ public:
class CommitCallbackRegistry : public CallbackRegistry<commit_callback_t, CommitCallbackRegistry>{};
// the enable callback registry is also used for visiblity callbacks
class EnableCallbackRegistry : public CallbackRegistry<enable_callback_t, EnableCallbackRegistry>{};
protected:
static bool controlListener(const LLSD& newvalue, LLHandle<LLUICtrl> handle, std::string type);
commit_signal_t* mCommitSignal;
enable_signal_t* mValidateSignal;
@@ -162,6 +167,10 @@ protected:
LLViewModelPtr mViewModel;
LLControlVariable* mMakeVisibleControlVariable;
boost::signals2::connection mMakeVisibleControlConnection;
LLControlVariable* mMakeInvisibleControlVariable;
boost::signals2::connection mMakeInvisibleControlConnection;
private:
BOOL mTabStop;

View File

@@ -334,7 +334,7 @@ void LLFloaterTeleportHistory::onTeleport(void* data)
LLFloaterTeleportHistory* self = (LLFloaterTeleportHistory*) data;
// build secondlife::/app link from simstring for instant teleport to destination
std::string slapp = "secondlife:///app/teleport/" + self->mPlacesList->getFirstSelected()->getColumn(LIST_SLURL)->getValue().asString();
std::string slapp = "secondlife:///app/teleport/" + self->mPlacesList->getFirstSelected()->getColumn(LIST_SIMSTRING)->getValue().asString();
LLUrlAction::teleportToLocation(slapp);
}

View File

@@ -30,11 +30,12 @@
#include "llpanel.h"
#include "llvoiceclient.h"
#include "lllayoutstack.h"
class LLComboBox;
class LLPanelVoiceEffect
: public LLPanel
: public LLLayoutPanel
, public LLVoiceEffectObserver
{
public:

View File

@@ -3,28 +3,23 @@
height="300" min_height="200" min_width="180" name="active_speakers"
rect_control="FloaterActiveSpeakersRect" title="Active Speakers"
width="250">
<panel bottom="0" follows="left|top|right|bottom" left="0" mouse_opaque="false"
name="active_speakers_panel" right="250" top="300">
<panel top="-18" left="11" right="-9" name="panel_voice_effect" visiblity_control="VoiceMorphingEnabled" filename="panel_voice_effect.xml" follows="top|right|left"/>
<scroll_list bottom="32" can_resize="true" column_padding="0" draw_heading="true"
draw_stripes="false" follows="left|top|bottom|right" left="10"
multi_select="false" name="speakers_list" right="-10" search_column="1"
sort_column="2" top="-46">
<column name="icon_speaking_status" sort="speaking_status" width="20" />
<column dynamicwidth="true" label="Name" name="speaker_name" />
<column label="" name="speaking_status" width="0" />
</scroll_list>
<panel background_opaque="false" background_visible="false" bevel_style="in"
bg_alpha_color="0,0,0,0" bg_opaque_color="0,0,0,0.3" border="false"
bottom="5" can_resize="false" follows="left|right|bottom" height="20"
left="10" mouse_opaque="true" name="volume_container" right="-10">
<volume_slider bottom="5" follows="left|bottom" height="15" increment="0.05" initial_val="0.5"
left_delta="10" max_val="1.0" min_val="0.0" name="speaker_volume"
width="110" />
<button bottom_delta="0" height="20" image_selected="icn_speaker-muted_dark.tga"
image_unselected="icn_speaker_dark.tga" label="" left_delta="115"
name="mute_btn" toggle="true" tool_tip="Mute voice for this resident"
width="25" scale_image="false" />
</panel>
</panel>
<layout_stack bottom="0" follows="all" mouse_opaque="false" left="5" right="-4" top="280" name="active_speakers_stack">
<layout_panel name="panel_voice_effect" auto_resize="false" user_resize="false" visiblity_control="VoiceMorphingEnabled" filename="panel_voice_effect.xml" height="23"/>
<layout_panel mouse_opaque="false" auto_resize="true" user_resize="false" name="active_speakers_panel" height="232">
<scroll_list bottom="25" top="232" left="0" right="-1"
draw_stripes="false" follows="all" can_resize="true" column_padding="0" draw_heading="true"
multi_select="false" name="speakers_list" search_column="1" sort_column="2">
<column name="icon_speaking_status" sort="speaking_status" width="20" />
<column dynamicwidth="true" label="Name" name="speaker_name" />
<column label="" name="speaking_status" width="0" />
</scroll_list>
<volume_slider bottom="5" follows="left|bottom" height="15" increment="0.05" initial_val="0.5"
left="0" max_val="1.0" min_val="0.0" name="speaker_volume"
width="145" />
<button bottom_delta="0" height="20" image_selected="icn_speaker-muted_dark.tga"
image_unselected="icn_speaker_dark.tga" label="" left_delta="145"
name="mute_btn" toggle="true" tool_tip="Mute voice for this resident"
width="25" scale_image="false" />
</layout_panel>
</layout_stack>
</floater>

View File

@@ -5,6 +5,9 @@
height="23"
layout="topleft"
name="panel_voice_effect"
auto_resize="false"
user_resize="false"
visiblity_control="VoiceMorphingEnabled"
width="200">
<string name="no_voice_effect">
Voice Morphing Off

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="active_speakers" title="Participantes Activos">
<panel name="active_speakers_panel">
<scroll_list name="speakers_list">
<column label="Nombre" name="speaker_name"/>
</scroll_list>
<panel name="volume_container">
<button name="mute_btn" tool_tip="Ignorar la voz de este residente"/>
</panel>
</panel>
<layout_stack name="active_speakers_stack">
<layout_panel name="active_speakers_panel">
<scroll_list name="speakers_list">
<column label="Nombre" name="speaker_name"/>
</scroll_list>
<button name="mute_btn" tool_tip="Ignorar la voz de este residente"/>
</layout_panel>
</layout_stack>
</floater>

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="active_speakers" title="Intervenants actifs">
<panel name="active_speakers_panel">
<scroll_list name="speakers_list">
<column label="Nom" name="speaker_name"/>
</scroll_list>
<panel name="volume_container">
<button name="mute_btn" tool_tip="Ignorer ce résident"/>
</panel>
</panel>
<layout_stack name="active_speakers_stack">
<layout_panel name="active_speakers_panel">
<scroll_list name="speakers_list">
<column label="Nom" name="speaker_name"/>
</scroll_list>
<button name="mute_btn" tool_tip="Ignorer ce résident"/>
</layout_panel>
</layout_stack>
</floater>

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="active_speakers" title="Falantes Ativos">
<panel name="active_speakers_panel">
<scroll_list name="speakers_list">
<column label="Nome" name="speaker_name"/>
</scroll_list>
<panel name="volume_container">
<button label="" name="mute_btn" tool_tip="Emudecer a voz para este residente"/>
</panel>
</panel>
<layout_stack name="active_speakers_stack">
<layout_panel name="active_speakers_panel">
<scroll_list name="speakers_list">
<column label="Nome" name="speaker_name"/>
</scroll_list>
<button label="" name="mute_btn" tool_tip="Emudecer a voz para este residente"/>
</layout_panel>
</layout_stack>
</floater>