summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelcontents.cpp11
-rw-r--r--indra/newview/llpanelcontents.h1
-rw-r--r--indra/newview/llviewermenu.cpp100
-rw-r--r--indra/newview/llviewermenu.h2
-rw-r--r--indra/newview/skins/default/xui/en/floater_tools.xml13
5 files changed, 77 insertions, 50 deletions
diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp
index 3bae0cebfb..116b23e595 100644
--- a/indra/newview/llpanelcontents.cpp
+++ b/indra/newview/llpanelcontents.cpp
@@ -54,6 +54,7 @@
#include "lltrans.h"
#include "llviewerassettype.h"
#include "llviewerinventory.h"
+#include "llviewermenu.h"
#include "llviewerobject.h"
#include "llviewerregion.h"
#include "llviewerwindow.h"
@@ -82,6 +83,7 @@ BOOL LLPanelContents::postBuild()
childSetAction("button new script",&LLPanelContents::onClickNewScript, this);
childSetAction("button permissions",&LLPanelContents::onClickPermissions, this);
+ childSetAction("btn_reset_scripts", &LLPanelContents::onClickResetScripts, this);
mPanelInventoryObject = getChild<LLPanelObjectInventory>("contents_inventory");
@@ -106,6 +108,7 @@ void LLPanelContents::getState(LLViewerObject *objectp )
if( !objectp )
{
getChildView("button new script")->setEnabled(FALSE);
+ getChildView("btn_reset_scripts")->setEnabled(FALSE);
return;
}
@@ -125,6 +128,8 @@ void LLPanelContents::getState(LLViewerObject *objectp )
((LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1)
|| (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1)));
+ getChildView("btn_reset_scripts")->setEnabled(editable);
+
getChildView("button permissions")->setEnabled(!objectp->isPermanentEnforced());
mPanelInventoryObject->setEnabled(!objectp->isPermanentEnforced());
}
@@ -206,3 +211,9 @@ void LLPanelContents::onClickPermissions(void *userdata)
LLPanelContents* self = (LLPanelContents*)userdata;
gFloaterView->getParentFloater(self)->addDependentFloater(LLFloaterReg::showInstance("bulk_perms"));
}
+
+// static
+void LLPanelContents::onClickResetScripts(void *userdata)
+{
+ handle_selected_script_action("reset");
+}
diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h
index 6ecc78afa0..5b1a57de42 100644
--- a/indra/newview/llpanelcontents.h
+++ b/indra/newview/llpanelcontents.h
@@ -53,6 +53,7 @@ public:
static void onClickNewScript(void*);
static void onClickPermissions(void*);
+ static void onClickResetScripts(void*);
// Key suffix for "tentative" fields
static const char* TENTATIVE_SUFFIX;
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();
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index 6882405407..74a15af50c 100644
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -110,6 +110,8 @@ void handle_object_return();
void handle_object_delete();
void handle_object_edit();
+void handle_selected_script_action(const std::string& action);
+
void handle_buy_land();
// Takes avatar UUID, or if no UUID passed, uses last selected object
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 0abee2ff80..1377bad6cf 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -2575,13 +2575,22 @@ even though the user gets a free copy.
border_visible="true"
bevel_style="in"
follows="left|top|right"
- height="325"
+ height="300"
layout="topleft"
left="10"
name="contents_inventory"
top="50"
width="275" />
- </panel>
+ <button
+ follows="left|bottom"
+ height="23"
+ label="Reset Scripts"
+ layout="topleft"
+ left="10"
+ name="btn_reset_scripts"
+ bottom="-1"
+ width="118" />
+ </panel>
</tab_container>
<panel
follows="left|top"