diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2011-10-05 15:12:07 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2011-10-05 15:12:07 -0700 |
commit | 11a0d0cd59c86cee18b6b2fd92fcbac62502ede0 (patch) | |
tree | 74dba5131b40874232a8dd50a2a79f9d81d3f143 /indra/llui/llcommandmanager.cpp | |
parent | 6f9ed8b303e9e840fcd624b03ec0958dceba3dc7 (diff) | |
parent | eda12bd009d8f71eb82b6e6238335a172d6e5fb0 (diff) |
merge
Diffstat (limited to 'indra/llui/llcommandmanager.cpp')
-rw-r--r-- | indra/llui/llcommandmanager.cpp | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index b1147134c2..2bd50af7af 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) { } @@ -112,9 +124,25 @@ LLCommand * LLCommandManager::getCommand(const LLCommandId& commandId) return command_match; } +LLCommand * LLCommandManager::getCommand(const LLUUID& commandUUID) +{ + LLCommand * command_match = NULL; + + CommandUUIDMap::const_iterator found = mCommandUUIDs.find(commandUUID); + + if (found != mCommandUUIDs.end()) + { + command_match = mCommands[found->second]; + } + + return command_match; +} + void LLCommandManager::addCommand(LLCommand * command) { - mCommandIndices[command->id()] = mCommands.size(); + LLCommandId command_id = command->id(); + mCommandIndices[command_id] = mCommands.size(); + mCommandUUIDs[command_id.uuid()] = mCommands.size(); mCommands.push_back(command); lldebugs << "Successfully added command: " << command->id().name() << llendl; |