diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 0e2f3f1961..6400e75947 100644 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -63,6 +63,7 @@ LLCommand::Params::Params() , is_running_parameters("is_running_parameters") , is_starting_function("is_starting_function") , is_starting_parameters("is_starting_parameters") + , control_name("control_name") // Add control_name to toolbar buttons { } @@ -83,6 +84,7 @@ LLCommand::LLCommand(const LLCommand::Params& p) , mIsRunningParameters(p.is_running_parameters) , mIsStartingFunction(p.is_starting_function) , mIsStartingParameters(p.is_starting_parameters) + , mControlVariable(p.control_name) // Add control_name to toolbar buttons { } diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h index a7276a48aa..f84ef05bb0 100644 --- a/indra/llui/llcommandmanager.h +++ b/indra/llui/llcommandmanager.h @@ -96,7 +96,11 @@ public: Mandatory name; Mandatory tooltip_ref; - Mandatory execute_function; + // Add control_name to toolbar buttons + // so we can have control_name instead of aall these functions. + // Mandatory execute_function; + Optional execute_function; + // Optional execute_parameters; Optional execute_stop_function; @@ -111,6 +115,8 @@ public: Optional is_starting_function; Optional is_starting_parameters; + Optional control_name; // Add control_name to toolbar buttons + Params(); }; @@ -161,6 +167,13 @@ private: std::string mIsStartingFunction; LLSD mIsStartingParameters; + +// Add control_variable to commands in toolbar + std::string mControlVariable; + +public: + const std::string& controlVariableName() const { return mControlVariable; } +// }; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 34a748d979..856d3c67b5 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -1017,6 +1017,16 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) button_p.name = commandp->name(); button_p.label = LLTrans::getString(commandp->labelRef()); button_p.tool_tip = LLTrans::getString(commandp->tooltipRef()); + + // Add control_variable to commands in toolbar if it's not read-only + if(!mReadOnly && !commandp->controlVariableName().empty()) + { + // set up button's control name and make it a toggle, so it works properly + button_p.control_name = commandp->controlVariableName(); + button_p.is_toggle = TRUE; + } + // + // Do not add an icon if we are using text only buttons // button_p.image_overlay = LLUI::getUIImage(commandp->icon()); if(mButtonType!=BTNTYPE_TEXT_ONLY) diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index c61f29c11e..80778a8ae8 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -292,4 +292,12 @@ is_running_parameters="web_content" /> + + diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 4a3b34dada..62ddf9277d 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3894,6 +3894,7 @@ Try enclosing path to the editor with double quotes. Quick prefs Animation Overrider Web Browser + Chat Information about the land you're visiting Change your avatar @@ -3924,6 +3925,7 @@ Try enclosing path to the editor with double quotes. Quick preferences for changing often used settings Animation Overrider Opens the internal web browser + Shows or hides the default chat bar currently in your bottom toolbar currently in your left toolbar