summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelobjectinventory.cpp6
-rw-r--r--indra/newview/llpreviewscript.cpp51
-rw-r--r--indra/newview/llpreviewscript.h12
-rw-r--r--indra/newview/skins/default/xui/en/floater_live_lsleditor.xml19
-rw-r--r--indra/newview/skins/default/xui/en/floater_script_preview.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_script_ed.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/menu.xml1
7 files changed, 89 insertions, 5 deletions
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index 6a82a3b35d..d935c01eb8 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -960,9 +960,15 @@ void LLTaskLSLBridge::openItem()
LLSD floater_key;
floater_key["taskid"] = mPanel->getTaskUUID();
floater_key["itemid"] = mUUID;
+
LLLiveLSLEditor* preview = LLFloaterReg::showTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key, TAKE_FOCUS_YES);
if (preview)
{
+ LLSelectNode *node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(NULL, TRUE);
+ if (node && node->mValid)
+ {
+ preview->setObjectName(node->mName);
+ }
preview->setObjectID(mPanel->getTaskUUID());
}
}
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 2add126b2d..62281d58f8 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -325,6 +325,38 @@ void LLFloaterScriptSearch::onSearchBoxCommit()
}
/// ---------------------------------------------------------------------------
+
+class LLScriptMovedObserver : public LLInventoryObserver
+{
+ public:
+ LLScriptMovedObserver(LLPreviewLSL *floater) : mPreview(floater) { gInventory.addObserver(this); }
+ virtual ~LLScriptMovedObserver() { gInventory.removeObserver(this); }
+ virtual void changed(U32 mask);
+
+ private:
+ LLPreviewLSL *mPreview;
+};
+
+void LLScriptMovedObserver::changed(U32 mask)
+{
+ const std::set<LLUUID> &mChangedItemIDs = gInventory.getChangedIDs();
+ std::set<LLUUID>::const_iterator it;
+
+ const LLUUID &item_id = mPreview->getScriptID();
+
+ for (it = mChangedItemIDs.begin(); it != mChangedItemIDs.end(); it++)
+ {
+ if (*it == item_id)
+ {
+ if ((mask & (LLInventoryObserver::STRUCTURE)) != 0)
+ {
+ mPreview->setDirty();
+ }
+ }
+ }
+}
+
+/// ---------------------------------------------------------------------------
/// LLScriptEdCore
/// ---------------------------------------------------------------------------
@@ -1554,6 +1586,14 @@ LLPreviewLSL::LLPreviewLSL(const LLSD& key )
mPendingUploads(0)
{
mFactoryMap["script panel"] = LLCallbackMap(LLPreviewLSL::createScriptEdPanel, this);
+
+ mItemObserver = new LLScriptMovedObserver(this);
+}
+
+LLPreviewLSL::~LLPreviewLSL()
+{
+ delete mItemObserver;
+ mItemObserver = NULL;
}
// virtual
@@ -1584,7 +1624,12 @@ void LLPreviewLSL::draw()
setTitle(LLTrans::getString("ScriptWasDeleted"));
mScriptEd->setItemRemoved(TRUE);
}
-
+ if (mDirty)
+ {
+ std::string item_path = get_category_path(item->getParentUUID());
+ getChild<LLUICtrl>("path_txt")->setValue(item_path);
+ getChild<LLUICtrl>("path_txt")->setToolTip(item_path);
+ }
LLPreview::draw();
}
// virtual
@@ -1870,7 +1915,8 @@ LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) :
mPendingUploads(0),
mIsModifiable(FALSE),
mIsNew(false),
- mIsSaving(FALSE)
+ mIsSaving(FALSE),
+ mObjectName("")
{
mFactoryMap["script ed panel"] = LLCallbackMap(LLLiveLSLEditor::createScriptEdPanel, this);
}
@@ -2007,6 +2053,7 @@ void LLLiveLSLEditor::loadAsset()
}
refreshFromItem();
+ getChild<LLUICtrl>("obj_name")->setValue(mObjectName);
// This is commented out, because we don't completely
// handle script exports yet.
/*
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index 2e5b8ad9bb..36e5253fb6 100644
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -53,6 +53,7 @@ class LLViewerInventoryItem;
class LLScriptEdContainer;
class LLFloaterGotoLine;
class LLFloaterExperienceProfile;
+class LLScriptMovedObserver;
class LLLiveLSLFile : public LLLiveFile
{
@@ -227,6 +228,12 @@ class LLPreviewLSL : public LLScriptEdContainer
{
public:
LLPreviewLSL(const LLSD& key );
+ ~LLPreviewLSL();
+
+ LLUUID getScriptID() { return mItemUUID; }
+
+ void setDirty() { mDirty = true; }
+
virtual void callbackLSLCompileSucceeded();
virtual void callbackLSLCompileFailed(const LLSD& compile_errors);
@@ -257,6 +264,8 @@ protected:
// Can safely close only after both text and bytecode are uploaded
S32 mPendingUploads;
+ LLScriptMovedObserver* mItemObserver;
+
};
@@ -289,6 +298,8 @@ public:
void requestExperiences();
void experienceChanged();
void addAssociatedExperience(const LLSD& experience);
+
+ void setObjectName(std::string name) { mObjectName = name; }
private:
virtual BOOL canClose();
@@ -347,6 +358,7 @@ private:
LLSD mExperienceIds;
LLHandle<LLFloater> mExperienceProfile;
+ std::string mObjectName;
};
#endif // LL_LLPREVIEWSCRIPT_H
diff --git a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml
index e8826034f6..88173e68fa 100644
--- a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml
+++ b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml
@@ -4,7 +4,7 @@
bevel_style="none"
border_style="line"
can_resize="true"
- height="582"
+ height="607"
layout="topleft"
min_height="271"
min_width="328"
@@ -45,6 +45,21 @@
name="loading">
Loading...
</floater.string>
+ <text
+ type="string"
+ length="1"
+ follows="left|top|right"
+ width="490"
+ use_ellipses="true"
+ font="SansSerif"
+ height="18"
+ layout="topleft"
+ left="13"
+ name="obj_name"
+ text_color="white"
+ top="21">
+ Object name
+ </text>
<panel
bevel_style="none"
@@ -54,7 +69,7 @@
layout="topleft"
left="10"
name="script ed panel"
- top="16"
+ top_pad="2"
width="501" />
<button
follows="left|bottom"
diff --git a/indra/newview/skins/default/xui/en/floater_script_preview.xml b/indra/newview/skins/default/xui/en/floater_script_preview.xml
index 5bec45e666..91c18035db 100644
--- a/indra/newview/skins/default/xui/en/floater_script_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_script_preview.xml
@@ -40,7 +40,7 @@
width="490"
use_ellipses="true"
font="SansSerif"
- height="19"
+ height="18"
layout="topleft"
left="13"
name="path_txt"
diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml
index be20cfd880..4ea4a4f38d 100644
--- a/indra/newview/skins/default/xui/en/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml
@@ -44,6 +44,7 @@
layout="topleft"
left="0"
mouse_opaque="false"
+ font="SansSerif"
name="File"
width="138">
<menu_item_call
@@ -74,6 +75,7 @@
label="Edit"
layout="topleft"
mouse_opaque="false"
+ font="SansSerif"
name="Edit"
width="139">
<menu_item_call
@@ -134,6 +136,7 @@
label="Help"
layout="topleft"
mouse_opaque="false"
+ font="SansSerif"
name="Help"
width="112">
<menu_item_call
diff --git a/indra/newview/skins/default/xui/en/widgets/menu.xml b/indra/newview/skins/default/xui/en/widgets/menu.xml
index 13ac84beb2..0e2b478aa5 100644
--- a/indra/newview/skins/default/xui/en/widgets/menu.xml
+++ b/indra/newview/skins/default/xui/en/widgets/menu.xml
@@ -4,5 +4,6 @@
bg_visible="true"
drop_shadow="true"
tear_off="false"
+ font="SansSerifSmall"
shortcut_pad="15">
</menu>