summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-09-28 16:54:34 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-09-28 16:54:34 -0700
commitfdf042bdb9aeefa209694e04d4012a3a1f911a52 (patch)
tree37c27b51ac8d940b49073f27da35442f0c6029cc /indra/llui
parentfc0f5173eb20fad8934420e6eec8873d71490894 (diff)
EXP-1205 PROGRESS -- As a User, I want a toybox which will contain all buttons that I can d&d into the toolbars
EXP-1233 FIX -- Populate the toybox floater window with all FUI toolbar buttons indicated as such in the "commands.xml" definition. EXP-1267 FIX -- Enable/disable buttons in the toybox * Hooked up button callbacks to the toolbar buttons * Fixed toybox button enable/disable to function properly and live update as buttons change states. * Removed the toybox toolbar background image Reviewed by Leyla
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcommandmanager.cpp4
-rw-r--r--indra/llui/llcommandmanager.h6
-rw-r--r--indra/llui/lltoolbar.cpp10
-rw-r--r--indra/llui/lluictrl.cpp10
-rw-r--r--indra/llui/lluictrl.h3
5 files changed, 27 insertions, 6 deletions
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 783990780b..b1147134c2 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -53,7 +53,7 @@ LLCommand::Params::Params()
, icon("icon")
, label_ref("label_ref")
, name("name")
- , param("param")
+ , parameter("parameter")
, tooltip_ref("tooltip_ref")
{
}
@@ -64,7 +64,7 @@ LLCommand::LLCommand(const LLCommand::Params& p)
, mIcon(p.icon)
, mIdentifier(p.name)
, mLabelRef(p.label_ref)
- , mParam(p.param)
+ , mParameter(p.parameter)
, mTooltipRef(p.tooltip_ref)
{
}
diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h
index 4781f77177..6481a05689 100644
--- a/indra/llui/llcommandmanager.h
+++ b/indra/llui/llcommandmanager.h
@@ -93,7 +93,7 @@ public:
Mandatory<std::string> icon;
Mandatory<std::string> label_ref;
Mandatory<std::string> name;
- Optional<std::string> param;
+ Optional<LLSD> parameter;
Mandatory<std::string> tooltip_ref;
Params();
@@ -106,7 +106,7 @@ public:
const std::string& icon() const { return mIcon; }
const LLCommandId& id() const { return mIdentifier; }
const std::string& labelRef() const { return mLabelRef; }
- const std::string& param() const { return mParam; }
+ const LLSD& parameter() const { return mParameter; }
const std::string& tooltipRef() const { return mTooltipRef; }
private:
@@ -116,7 +116,7 @@ private:
std::string mFunction;
std::string mIcon;
std::string mLabelRef;
- std::string mParam;
+ LLSD mParameter;
std::string mTooltipRef;
};
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index c5219b11e8..45567d5859 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -500,7 +500,6 @@ void LLToolBar::createButtons()
{
createButton(command_id);
}
-
}
void LLToolBar::createButton(const LLCommandId& id)
@@ -509,12 +508,21 @@ void LLToolBar::createButton(const LLCommandId& id)
if (!commandp) return;
LLToolBarButton::Params button_p;
+ button_p.name = id.name();
button_p.label = LLTrans::getString(commandp->labelRef());
button_p.tool_tip = button_p.label();
button_p.image_overlay = LLUI::getUIImage(commandp->icon());
button_p.overwriteFrom(mButtonParams[mButtonType]);
LLToolBarButton* button = LLUICtrlFactory::create<LLToolBarButton>(button_p);
+ if (!mReadOnly)
+ {
+ LLUICtrl::CommitCallbackParam cbParam;
+ cbParam.function_name = commandp->functionName();
+ cbParam.parameter = commandp->parameter();
+ button->setCommitCallback(cbParam);
+ }
+
mButtons.push_back(button);
mButtonPanel->addChild(button);
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index d58df5801b..5e8bf498c0 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -992,6 +992,16 @@ void LLUICtrl::setTransparencyType(ETypeTransparency type)
mTransparencyType = type;
}
+boost::signals2::connection LLUICtrl::setCommitCallback(const CommitCallbackParam& cb)
+{
+ return setCommitCallback(initCommitCallback(cb));
+}
+
+boost::signals2::connection LLUICtrl::setValidateCallback(const EnableCallbackParam& cb)
+{
+ return setValidateCallback(initEnableCallback(cb));
+}
+
boost::signals2::connection LLUICtrl::setCommitCallback( const commit_signal_t::slot_type& cb )
{
if (!mCommitSignal) mCommitSignal = new commit_signal_t();
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index 09bed9b958..fc56e5fc35 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -235,6 +235,9 @@ public:
// topic then put in help_topic_out
bool findHelpTopic(std::string& help_topic_out);
+ boost::signals2::connection setCommitCallback(const CommitCallbackParam& cb);
+ boost::signals2::connection setValidateCallback(const EnableCallbackParam& cb);
+
boost::signals2::connection setCommitCallback( const commit_signal_t::slot_type& cb );
boost::signals2::connection setValidateCallback( const enable_signal_t::slot_type& cb );