summaryrefslogtreecommitdiff
path: root/indra/llui/llcommandmanager.cpp
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-09-26 17:38:10 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-09-26 17:38:10 -0700
commit53a486649381af53d21de28aced388bc2aacac0f (patch)
tree9b7378da2c05e9dbd0c7a594b12d242e87ddf0dd /indra/llui/llcommandmanager.cpp
parentbb1776de6865715b2dd96185140d35e46d63c837 (diff)
EXP-1205 PROGRESS -- As a User, I want a toybox which will contain all buttons that I can d&d into the toolbars
* Command buttons are now enabled/disabled in toybox based on whether or not the LLToolBarView has them anywhere. * Commands now have argument to specify whether or not they should be in the toybox. * LLCommandId is now used a universal reference for commands. Reviewed by Richard.
Diffstat (limited to 'indra/llui/llcommandmanager.cpp')
-rw-r--r--indra/llui/llcommandmanager.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 6be616b980..62e1d186f5 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -38,11 +38,18 @@
//
+// LLCommandId class
+//
+
+const LLCommandId LLCommandId::null("null command");
+
+//
// LLCommand class
//
LLCommand::Params::Params()
: function("function")
+ , available_in_toybox("available_in_toybox", false)
, icon("icon")
, label_ref("label_ref")
, name("name")
@@ -53,9 +60,10 @@ LLCommand::Params::Params()
LLCommand::LLCommand(const LLCommand::Params& p)
: mFunction(p.function)
+ , mAvailableInToybox(p.available_in_toybox)
, mIcon(p.icon)
+ , mIdentifier(p.name)
, mLabelRef(p.label_ref)
- , mName(p.name)
, mParam(p.param)
, mTooltipRef(p.tooltip_ref)
{
@@ -90,26 +98,26 @@ LLCommand * LLCommandManager::getCommand(U32 commandIndex)
return mCommands[commandIndex];
}
-LLCommand * LLCommandManager::getCommand(const std::string& commandName)
+LLCommand * LLCommandManager::getCommand(const LLCommandId& commandId)
{
- LLCommand * command_name_match = NULL;
+ LLCommand * command_match = NULL;
- CommandIndexMap::const_iterator found = mCommandIndices.find(commandName);
+ CommandIndexMap::const_iterator found = mCommandIndices.find(commandId);
if (found != mCommandIndices.end())
{
- command_name_match = mCommands[found->second];
+ command_match = mCommands[found->second];
}
- return command_name_match;
+ return command_match;
}
void LLCommandManager::addCommand(LLCommand * command)
{
- mCommandIndices[command->name()] = mCommands.size();
+ mCommandIndices[command->id()] = mCommands.size();
mCommands.push_back(command);
- llinfos << "Successfully added command: " << command->name() << llendl;
+ llinfos << "Successfully added command: " << command->id().name() << llendl;
}
//static