diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 7dbca795d..ee9e74ae4 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -43,6 +43,8 @@ static LLRegisterWidget 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 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 diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 79d8fd8fc..c1de060cb 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -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 getHandle() const { return getDerivedHandle(); } BOOL getIsChrome() const; void setTabStop( BOOL b ); @@ -151,9 +154,11 @@ public: class CommitCallbackRegistry : public CallbackRegistry{}; // the enable callback registry is also used for visiblity callbacks class EnableCallbackRegistry : public CallbackRegistry{}; - + protected: + static bool controlListener(const LLSD& newvalue, LLHandle 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; diff --git a/indra/newview/llfloaterteleporthistory.cpp b/indra/newview/llfloaterteleporthistory.cpp index a4ffe91fa..173aaf5a7 100644 --- a/indra/newview/llfloaterteleporthistory.cpp +++ b/indra/newview/llfloaterteleporthistory.cpp @@ -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); } diff --git a/indra/newview/llpanelvoiceeffect.h b/indra/newview/llpanelvoiceeffect.h index 27face087..a6cbac181 100755 --- a/indra/newview/llpanelvoiceeffect.h +++ b/indra/newview/llpanelvoiceeffect.h @@ -30,11 +30,12 @@ #include "llpanel.h" #include "llvoiceclient.h" +#include "lllayoutstack.h" class LLComboBox; class LLPanelVoiceEffect - : public LLPanel + : public LLLayoutPanel , public LLVoiceEffectObserver { public: diff --git a/indra/newview/skins/default/xui/en-us/floater_active_speakers.xml b/indra/newview/skins/default/xui/en-us/floater_active_speakers.xml index 7eb229a8c..b6410386d 100644 --- a/indra/newview/skins/default/xui/en-us/floater_active_speakers.xml +++ b/indra/newview/skins/default/xui/en-us/floater_active_speakers.xml @@ -3,28 +3,23 @@ height="300" min_height="200" min_width="180" name="active_speakers" rect_control="FloaterActiveSpeakersRect" title="Active Speakers" width="250"> - - - - - - - - - -