summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llmenugl.cpp2
-rw-r--r--indra/llui/llmenugl.h15
-rw-r--r--indra/llui/llpanel.h1
-rw-r--r--indra/llui/lluictrl.cpp29
-rw-r--r--indra/llui/lluictrl.h15
5 files changed, 7 insertions, 55 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 907f2352a0..fd5c2b7fef 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -761,7 +761,7 @@ void LLMenuItemCallGL::initFromParams(const Params& p)
{
if (p.on_visible.isProvided())
{
- mVisibleSignal.connect(initVisibleCallback(p.on_visible));
+ mVisibleSignal.connect(initEnableCallback(p.on_visible));
}
if (p.on_enable.isProvided())
{
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index cbb9b4d344..61e06f9e5f 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -175,9 +175,7 @@ protected:
// This function appends the character string representation of
// the current accelerator key and mask to the provided string.
void appendAcceleratorString( std::string& st ) const;
-
- void initMenuEnableCallback(const EnableCallbackParam& cb, enable_signal_t& sig);
-
+
protected:
KEY mAcceleratorKey;
MASK mAcceleratorMask;
@@ -249,7 +247,7 @@ public:
{
Optional<EnableCallbackParam > on_enable;
Optional<CommitCallbackParam > on_click;
- Optional<VisibleCallbackParam > on_visible;
+ Optional<EnableCallbackParam > on_visible;
Params()
: on_enable("on_enable"),
on_click("on_click"),
@@ -284,15 +282,10 @@ public:
{
return mEnableSignal.connect(cb);
}
-
- boost::signals2::connection setVisibleCallback( const visible_signal_t::slot_type& cb )
- {
- return mVisibleSignal.connect(cb);
- }
-
+
private:
enable_signal_t mEnableSignal;
- visible_signal_t mVisibleSignal;
+ enable_signal_t mVisibleSignal;
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index a8bd5fd5e5..d0986a06d3 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -249,7 +249,6 @@ protected:
LLCallbackMap::map_t mFactoryMap;
CommitCallbackRegistry::ScopedRegistrar mCommitCallbackRegistrar;
EnableCallbackRegistry::ScopedRegistrar mEnableCallbackRegistrar;
- VisibleCallbackRegistry::ScopedRegistrar mVisibleCallbackRegistrar;
commit_signal_t* mVisibleSignal; // Called when visibility changes, passes new visibility as LLSD()
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 706712ec5e..6044908ca7 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -232,11 +232,6 @@ bool default_enable_handler(LLUICtrl* ctrl, const LLSD& param)
return true;
}
-bool default_visible_handler(LLUICtrl* ctrl, const LLSD& param)
-{
- return true;
-}
-
LLUICtrl::commit_signal_t::slot_type LLUICtrl::initCommitCallback(const CommitCallbackParam& cb)
{
@@ -290,30 +285,6 @@ LLUICtrl::enable_signal_t::slot_type LLUICtrl::initEnableCallback(const EnableCa
return default_enable_handler;
}
-LLUICtrl::visible_signal_t::slot_type LLUICtrl::initVisibleCallback(const VisibleCallbackParam& cb)
-{
- // Set the callback function
- if (cb.function.isProvided())
- {
- if (cb.parameter.isProvided())
- return boost::bind(cb.function(), this, cb.parameter);
- else
- return cb.function();
- }
- else
- {
- visible_callback_t* func = (VisibleCallbackRegistry::getValue(cb.function_name));
- if (func)
- {
- if (cb.parameter.isProvided())
- return boost::bind((*func), this, cb.parameter);
- else
- return visible_signal_t::slot_type(*func);
- }
- }
- return default_visible_handler;
-}
-
// virtual
void LLUICtrl::onMouseEnter(S32 x, S32 y, MASK mask)
{
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index b20ff5d798..983700065d 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -63,9 +63,6 @@ public:
typedef boost::function<bool (LLUICtrl* ctrl, const LLSD& param)> enable_callback_t;
typedef boost::signals2::signal<bool (LLUICtrl* ctrl, const LLSD& param), boost_boolean_combiner> enable_signal_t;
- typedef boost::function<bool (LLUICtrl* ctrl, const LLSD& param)> visible_callback_t;
- typedef boost::signals2::signal<bool (LLUICtrl* ctrl, const LLSD& param), boost_boolean_combiner> visible_signal_t;
-
struct CallbackParam : public LLInitParam::Block<CallbackParam>
{
Ignored name;
@@ -87,12 +84,7 @@ public:
{
Optional<enable_callback_t> function;
};
-
- struct VisibleCallbackParam : public LLInitParam::Block<VisibleCallbackParam, CallbackParam >
- {
- Optional<visible_callback_t> function;
- };
-
+
struct EnableControls : public LLInitParam::Choice<EnableControls>
{
Alternative<std::string> enabled;
@@ -148,7 +140,6 @@ protected:
commit_signal_t::slot_type initCommitCallback(const CommitCallbackParam& cb);
enable_signal_t::slot_type initEnableCallback(const EnableCallbackParam& cb);
- visible_signal_t::slot_type initVisibleCallback(const VisibleCallbackParam& cb);
// We need this virtual so we can override it with derived versions
virtual LLViewModel* getViewModel() const;
@@ -270,9 +261,7 @@ public:
class CommitCallbackRegistry : public CallbackRegistry<commit_callback_t, CommitCallbackRegistry>{};
class EnableCallbackRegistry : public CallbackRegistry<enable_callback_t, EnableCallbackRegistry>{};
- class VisibleCallbackRegistry : public CallbackRegistry<visible_callback_t, VisibleCallbackRegistry>{};
-
-
+
protected:
static bool controlListener(const LLSD& newvalue, LLHandle<LLUICtrl> handle, std::string type);