summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2020-06-16 17:26:39 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2020-06-16 17:26:39 +0300
commit307534c9781b312608ccce6a9b4e12499a66170a (patch)
tree03898242b561c5a5f6aaed5f6b086a11118cd4b8 /indra/newview/llviewermenu.cpp
parentb95d780b2ec38078100a96ed3b5760c29598a0db (diff)
SL-13463 Add 'Reset scripts' button to Content tab of Build floater
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp100
1 files changed, 52 insertions, 48 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index f5f8b87ed5..ef31f5e3bf 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7202,58 +7202,62 @@ class LLToolsSelectedScriptAction : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- std::string action = userdata.asString();
- bool mono = false;
- std::string msg, name;
- std::string title;
- if (action == "compile mono")
- {
- name = "compile_queue";
- mono = true;
- msg = "Recompile";
- title = LLTrans::getString("CompileQueueTitle");
- }
- if (action == "compile lsl")
- {
- name = "compile_queue";
- msg = "Recompile";
- title = LLTrans::getString("CompileQueueTitle");
- }
- else if (action == "reset")
- {
- name = "reset_queue";
- msg = "Reset";
- title = LLTrans::getString("ResetQueueTitle");
- }
- else if (action == "start")
- {
- name = "start_queue";
- msg = "SetRunning";
- title = LLTrans::getString("RunQueueTitle");
- }
- else if (action == "stop")
- {
- name = "stop_queue";
- msg = "SetRunningNot";
- title = LLTrans::getString("NotRunQueueTitle");
- }
- LLUUID id; id.generate();
-
- LLFloaterScriptQueue* queue =LLFloaterReg::getTypedInstance<LLFloaterScriptQueue>(name, LLSD(id));
- if (queue)
- {
- queue->setMono(mono);
- queue_actions(queue, msg);
- queue->setTitle(title);
- }
- else
- {
- LL_WARNS() << "Failed to generate LLFloaterScriptQueue with action: " << action << LL_ENDL;
- }
+ handle_selected_script_action(userdata.asString());
return true;
}
};
+void handle_selected_script_action(const std::string& action)
+{
+ bool mono = false;
+ std::string msg, name;
+ std::string title;
+ if (action == "compile mono")
+ {
+ name = "compile_queue";
+ mono = true;
+ msg = "Recompile";
+ title = LLTrans::getString("CompileQueueTitle");
+ }
+ if (action == "compile lsl")
+ {
+ name = "compile_queue";
+ msg = "Recompile";
+ title = LLTrans::getString("CompileQueueTitle");
+ }
+ else if (action == "reset")
+ {
+ name = "reset_queue";
+ msg = "Reset";
+ title = LLTrans::getString("ResetQueueTitle");
+ }
+ else if (action == "start")
+ {
+ name = "start_queue";
+ msg = "SetRunning";
+ title = LLTrans::getString("RunQueueTitle");
+ }
+ else if (action == "stop")
+ {
+ name = "stop_queue";
+ msg = "SetRunningNot";
+ title = LLTrans::getString("NotRunQueueTitle");
+ }
+ LLUUID id; id.generate();
+
+ LLFloaterScriptQueue* queue = LLFloaterReg::getTypedInstance<LLFloaterScriptQueue>(name, LLSD(id));
+ if (queue)
+ {
+ queue->setMono(mono);
+ queue_actions(queue, msg);
+ queue->setTitle(title);
+ }
+ else
+ {
+ LL_WARNS() << "Failed to generate LLFloaterScriptQueue with action: " << action << LL_ENDL;
+ }
+}
+
void handle_selected_texture_info(void*)
{
for (LLObjectSelection::valid_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_begin();