summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcommandmanager.cpp24
-rw-r--r--indra/llui/llcommandmanager.h43
-rw-r--r--indra/llui/lltoolbar.cpp4
3 files changed, 57 insertions, 14 deletions
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index b1147134c2..922f243806 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -48,24 +48,36 @@ const LLCommandId LLCommandId::null("null command");
//
LLCommand::Params::Params()
- : function("function")
- , available_in_toybox("available_in_toybox", false)
+ : available_in_toybox("available_in_toybox", false)
, icon("icon")
, label_ref("label_ref")
, name("name")
- , parameter("parameter")
, tooltip_ref("tooltip_ref")
+ , execute_function("execute_function")
+ , execute_parameters("execute_parameters")
+ , is_enabled_function("is_enabled_function")
+ , is_enabled_parameters("is_enabled_parameters")
+ , is_running_function("is_running_function")
+ , is_running_parameters("is_running_parameters")
+ , is_starting_function("is_starting_function")
+ , is_starting_parameters("is_starting_parameters")
{
}
LLCommand::LLCommand(const LLCommand::Params& p)
- : mFunction(p.function)
- , mAvailableInToybox(p.available_in_toybox)
+ : mAvailableInToybox(p.available_in_toybox)
, mIcon(p.icon)
, mIdentifier(p.name)
, mLabelRef(p.label_ref)
- , mParameter(p.parameter)
, mTooltipRef(p.tooltip_ref)
+ , mExecuteFunction(p.execute_function)
+ , mExecuteParameters(p.execute_parameters)
+ , mIsEnabledFunction(p.is_enabled_function)
+ , mIsEnabledParameters(p.is_enabled_parameters)
+ , mIsRunningFunction(p.is_running_function)
+ , mIsRunningParameters(p.is_running_parameters)
+ , mIsStartingFunction(p.is_starting_function)
+ , mIsStartingParameters(p.is_starting_parameters)
{
}
diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h
index 6481a05689..3ac5548a0d 100644
--- a/indra/llui/llcommandmanager.h
+++ b/indra/llui/llcommandmanager.h
@@ -83,41 +83,72 @@ private:
typedef std::list<LLCommandId> command_id_list_t;
+
class LLCommand
{
public:
struct Params : public LLInitParam::Block<Params>
{
Mandatory<bool> available_in_toybox;
- Mandatory<std::string> function;
Mandatory<std::string> icon;
Mandatory<std::string> label_ref;
Mandatory<std::string> name;
- Optional<LLSD> parameter;
Mandatory<std::string> tooltip_ref;
+ Mandatory<std::string> execute_function;
+ Optional<LLSD> execute_parameters;
+
+ Optional<std::string> is_enabled_function;
+ Optional<LLSD> is_enabled_parameters;
+
+ Optional<std::string> is_running_function;
+ Optional<LLSD> is_running_parameters;
+
+ Optional<std::string> is_starting_function;
+ Optional<LLSD> is_starting_parameters;
+
Params();
};
LLCommand(const LLCommand::Params& p);
const bool availableInToybox() const { return mAvailableInToybox; }
- const std::string& functionName() const { return mFunction; }
const std::string& icon() const { return mIcon; }
const LLCommandId& id() const { return mIdentifier; }
const std::string& labelRef() const { return mLabelRef; }
- const LLSD& parameter() const { return mParameter; }
const std::string& tooltipRef() const { return mTooltipRef; }
+ const std::string& executeFunctionName() const { return mExecuteFunction; }
+ const LLSD& executeParameters() const { return mExecuteParameters; }
+
+ const std::string& isEnabledFunctionName() const { return mIsEnabledFunction; }
+ const LLSD& isEnabledParameters() const { return mIsEnabledParameters; }
+
+ const std::string& isRunningFunctionName() const { return mIsRunningFunction; }
+ const LLSD& isRunningParameters() const { return mIsRunningParameters; }
+
+ const std::string& isStartingFunctionName() const { return mIsStartingFunction; }
+ const LLSD& isStartingParameters() const { return mIsStartingParameters; }
+
private:
LLCommandId mIdentifier;
bool mAvailableInToybox;
- std::string mFunction;
std::string mIcon;
std::string mLabelRef;
- LLSD mParameter;
std::string mTooltipRef;
+
+ std::string mExecuteFunction;
+ LLSD mExecuteParameters;
+
+ std::string mIsEnabledFunction;
+ LLSD mIsEnabledParameters;
+
+ std::string mIsRunningFunction;
+ LLSD mIsRunningParameters;
+
+ std::string mIsStartingFunction;
+ LLSD mIsStartingParameters;
};
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index efa077ffa1..a544aa9ec7 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -525,8 +525,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
if (!mReadOnly)
{
LLUICtrl::CommitCallbackParam cbParam;
- cbParam.function_name = commandp->functionName();
- cbParam.parameter = commandp->parameter();
+ cbParam.function_name = commandp->executeFunctionName();
+ cbParam.parameter = commandp->executeParameters();
button->setCommitCallback(cbParam);
button->setStartDragCallback(mStartDragItemCallback);
button->setHandleDragCallback(mHandleDragItemCallback);